Skip to content

fix(app): settings/digest UX — currency default, region All/None, history-days twitch, edit-time jank - #47

Merged
GJanos merged 5 commits into
developfrom
fix/settings-digest-ux
Jun 16, 2026
Merged

GJanos merged 5 commits into
developfrom
fix/settings-digest-ux

Conversation

@GJanos

@GJanos GJanos commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Fixes a batch of settings/digest issues reported from device testing.

Changes (focused commits)

  • Currency rates on by default (#6) — DEFAULT_PREFERENCES.showCurrencyRates: true (USD was already the base). Fresh installs only; existing saved prefs are untouched.
  • Restore region All/None toggle (#5) — reorder-mode pill toggles All ↔ None again. Per the keep-at-least-one invariant, None reduces to a single region rather than clearing all (legacy cleared all).
  • History-days twitch (#4) — the Settings screen is the rightmost page of the horizontal pager, so changing history-days reflowed the pager (day pages added/removed on the left), shifting the settings page index out from under the user. Now the page count is frozen while Settings is open and applied on leave (when the user is on a day page, so the reflow is off-screen); onContentSizeChange re-pins the offset once the new width is committed.
  • Edit-time jank / "saves too much" (#2/#3):
    • SettingsScreen subscribed to the whole prefs object → re-rendered the entire tree on every setPref. Now subscribes per field.
    • The mounted-but-hidden digest pages refetched on every region/count change. useSettledWhileSettings freezes those inputs until the user leaves Settings (mirrors the existing currency-query pause).
    • DigestPager derives canJump as a boolean so a region toggle no longer rebuilds every day page.
    • Prefs auto-save debounce raised 900ms → 5000ms; leave/background/unmount flushes still persist immediately.

Verification

  • tsc --noEmit, eslint, prettier: clean
  • jest: 503/503 passing (added a region All/None test; updated two debounce tests to read config.prefsDebounceMs)
  • /code-review (high effort) run before opening; surfaced one consistency bug (resize re-pin using live vs frozen maxDayIndex), fixed in the last commit.

Notes

  • The history-days leave-Settings transition and the region-toggle responsiveness are render/scroll runtime behaviors — worth a final on-device confirm.
  • Out of scope: the device-registration linkDeviceToUser 0-row warnings seen in testing are resolved by the separate feat/devices-rls-lockdown branch (DB lockdown is live but the matching RPC app code ships there); and the account-deletion → re-signup confirmation deep link (#1) is a separate auth/deep-link change needing a Supabase redirect-allowlist entry + /security-review.

🤖 Generated with Claude Code

GJanos and others added 5 commits June 16, 2026 22:21
Fresh installs now show per-region currency rates out of the box; baseCurrency
was already USD. Existing users keep their saved setting.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The reorder-mode pill again toggles All <-> None; per the keep-at-least-one
invariant, None reduces to a single region instead of clearing all.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Three sources of jank while editing in Settings:
- SettingsScreen subscribed to the whole prefs object, re-rendering the entire
  tree on every setPref. Now subscribes per field, so a region toggle (which only
  changes selectedRegions, read by RegionPicker) no longer re-renders it.
- The mounted-but-hidden digest pages refetched on every region/count change.
  useSettledWhileSettings freezes those inputs until the user leaves Settings,
  mirroring the existing currency-query pause.
- Prefs auto-save debounce raised 900ms -> 5000ms; leave/background/unmount
  flushes still persist immediately.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
History-days lives on the settings page; changing it reflowed the pager (day
pages added/removed on the left), shifting the settings page index out from
under the user and twitching the view. Freeze maxDayIndex in state while
Settings is open and apply the new count on leave, when the user is already on
a day page so the reflow stays off-screen; onContentSizeChange re-pins the
offset once the new width is committed. Also derive canJump as a boolean so a
region toggle no longer rebuilds every day page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
onContentSizeChange read live historyDays while the pages render from the frozen
maxDayIndex; they diverge if width changes for another reason (rotation) while a
history-days edit is pending in Settings, re-pinning to the wrong page. Use the
rendered value.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@GJanos
GJanos merged commit 813d56d into develop Jun 16, 2026
5 checks passed
@GJanos
GJanos deleted the fix/settings-digest-ux branch June 16, 2026 20:32
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