Skip to content

stack/getpaid 2 61 la advanced settings - #229

Draft
BullishNode wants to merge 3 commits into
stack/getpaid-2-60-naming-uxfrom
stack/getpaid-2-61-la-advanced-settings
Draft

stack/getpaid 2 61 la advanced settings#229
BullishNode wants to merge 3 commits into
stack/getpaid-2-60-naming-uxfrom
stack/getpaid-2-61-la-advanced-settings

Conversation

@BullishNode

Copy link
Copy Markdown
Owner

Stack created with GitHub Stacks CLIGive Feedback 💬

Auto-sweep and hide-on-home were rendered by four separate copies of the same
two switches: one inside the shared Advanced Settings sheet, and one private
widget per product screen for the case where the online product is unavailable.
Collapse them into a single card so the labels, the ordering and — next — the
rule coupling the two switches exist in exactly one place.
Tapping Auto-sweep in Lightning Address advanced settings appeared to do
nothing. The write did run — the failure was that it could not be seen: the sheet
is handed to `showModalBottomSheet` as an already-built widget, so the modal
route holds one snapshot of the wallet behavior for as long as it is open. The
switch is driven by that snapshot's value, so it never moved, and the happy path
logs nothing, which is why the log looked idle too.

Carry the cubit into the modal and rebuild the sheet from state, so a toggle
made inside the sheet is reflected inside that same sheet. The same snapshot
wiring existed on the Donation Page and Point of Sale sheets and is fixed with
it; the cross-product test now asserts the reflection, and fails without it.
Hide on home and auto-sweep were independent switches, so a wallet could be
hidden from the home list while still accumulating every payment it received —
its balance gone from the only list its owner counts.

Couple them one way: auto-sweep gates hiding. Turning auto-sweep off unhides the
wallet, hiding is refused while sweeping is off, and unhiding stays allowed
whatever the state — including for a wallet left hidden by data written before
this rule. The rule is one pure function applied at the write itself, in
WalletRepository, so no screen (existing or future, Get Paid or BTCPay) can
persist the forbidden pair; the same function resolves the optimistic UI update,
and the shared behavior card disables hiding and says what it depends on.
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.

2 participants