Skip to content

Confirm before discarding Address Element changes - #14848

Draft
cttsai-stripe wants to merge 1 commit into
masterfrom
cttsai/address-element-discard-dialog
Draft

cttsai-stripe wants to merge 1 commit into
masterfrom
cttsai/address-element-discard-dialog

Conversation

@cttsai-stripe

@cttsai-stripe cttsai-stripe commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

[skip ci]

Summary

Address Element asks before dismissal when rendered address input or the visible custom checkbox differs from its initial state. Unchanged or reverted input cancels directly. This applies to both standalone Address Element and Shipping Address Element.

Motivation

Replace #14978's SAE launch-mode condition with actual edit detection, including checkbox-only edits to match iOS. AddressFormController compares rendered inputs, and InputAddressViewModel adds the visible checkbox state; the existing result-state holder handles confirmation and cancellation.

The Activity queries the input destination's existing ViewModel for each dismissal attempt, preserving its navigation scope and autocomplete result subscription.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Local checks passed: 116 tests across AddressElementActivityTest, AddressElementActivityAnalyticsTest, AddressFormControllerTest, and InputAddressViewModelTest. These cover edit detection and reversion, dismissal across both launch modes, keeping edits, discarding, and recreation. No emulator checks for this revision.

Screenshots

Uses the dialog renderer and six appearance/theme snapshots from #14978.

Changelog

  • [Changed] Address Element asks for confirmation before discarding unsaved address changes.

Committed and created by Codex.

@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch from 9beadcd to 62a76bc Compare October 9, 2026 23:51
@cttsai-stripe
cttsai-stripe changed the base branch from master to cttsai/address-element-discard-dialog-sae October 9, 2026 23:51
@cttsai-stripe
cttsai-stripe added this pull request to stack #14979 October 9, 2026 23:51
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch from 1e5e3cb to 2ae44c7 Compare October 15, 2026 17:58
@cttsai-stripe
cttsai-stripe removed this pull request from stack #14979 October 15, 2026 23:07
@cttsai-stripe
cttsai-stripe added this pull request to stack #15031 October 15, 2026 23:07
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch from 2ae44c7 to ceef91b Compare October 15, 2026 23:08
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch 2 times, most recently from 58c6d86 to 7778347 Compare October 16, 2026 05:15
@cttsai-stripe
cttsai-stripe removed this pull request from stack #15031 October 16, 2026 05:30
@cttsai-stripe
cttsai-stripe added this pull request to stack #15035 October 16, 2026 05:31
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch from 7778347 to 65e3b94 Compare October 16, 2026 05:34
@cttsai-stripe
cttsai-stripe removed this pull request from stack #15035 October 16, 2026 16:58
@cttsai-stripe
cttsai-stripe added this pull request to stack #15040 October 16, 2026 16:58
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch from 65e3b94 to 6cd21d1 Compare October 16, 2026 17:01
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch 6 times, most recently from 801f2bc to f1304e7 Compare October 16, 2026 18:28
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch from f1304e7 to 720e19f Compare October 16, 2026 18:52
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch from 720e19f to f36d451 Compare October 19, 2026 17:45
Base automatically changed from cttsai/address-element-discard-dialog-sae to master October 19, 2026 21:42
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
Committed-By-Agent: codex
Co-authored-by: codex <noreply@openai.com>
@cttsai-stripe
cttsai-stripe force-pushed the cttsai/address-element-discard-dialog branch from f36d451 to bd0d0c1 Compare October 19, 2026 21:42

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant