Registry Mirror
Skip to content

Conversation

@iamshadmantaqi

Copy link
Copy Markdown
Contributor

Problem

"Restore device defaults" lists "Snooze options" as a change, and stays enabled, when the snooze options are the same as the defaults and only their row order differs.

Steps (any device, no sign-in; do it at a time of day when "Today 6 PM" falls between "In 1 hour" and "In 3 hours", for example 4:00 PM):

  1. Open Settings > General > Snooze. Add an option, then remove it again (or edit one and set it back). The row saves the options in menu order, soonest first: In 1 hour, Today 6 PM, In 3 hours, Tomorrow, Monday.
  2. The Snooze row shows no reset button, because it treats the list as equal to the defaults.
  3. Press "Restore device defaults" in the header. Expected: nothing to restore. Actual: the button is enabled and the confirm text says "This will reset: Snooze options".

Cause

useSettingsRestore in SettingsPanels.tsx:564 compared settings.snoozePresets with Equal.equals, which is order sensitive. The Snooze row itself uses sameSnoozePresets (SnoozePresetsSettings.tsx:111, compares sorted ids, "Row order is only display order") and saves rows in wake-time order. The two checks disagreed.

Change

sameSnoozePresets is now exported where it already lives and changedSettingLabels uses it. Three lines changed in two files, no code moved, so the row and the restore button agree.

Scope

Small fix of an obvious bug, steps reproduce it, so it needs no issue.

Verification

New case in SnoozeRestore.browser.test.tsx, does not list snooze options that only differ from the defaults in row order: renders the real useSettingsRestore with the default snooze options but "Today 6 PM" before "In 3 hours", and expects "Restore: nothing".

Test commit alone, fails on main ae203ef:

FAIL  |browser (chromium)| src/components/settings/SnoozeRestore.browser.test.tsx > Restore device defaults > does not list snooze options that only differ from the defaults in row order
VitestBrowserElementError: Cannot find element with locator: locator('div').getByText('Restore: nothing')

ARIA tree:
- paragraph: "Restore: Snooze options"

Test Files 1 failed (1), Tests 1 failed (1)

With the fix: the new test and the existing SnoozePresetsSettings.browser.test.tsx and SnoozePresetsSettings.logic.test.ts pass (3 files, 7 tests).

vp run check:changed: format, lint, knip, typecheck (2 packages), test (4 files, 23 tests) and react compiler all pass.

Not verified: I did not click through Settings in a running app at 4:00 PM; the test drives the real restore hook with the same saved order the row writes.

Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Dec 2, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 18c0877

Macroscope's review found this PR approvable — Restore device defaults now ignores snooze-option row order when detecting changed settings, matching the existing snooze settings UI. Product defaults and reset behavior remain unchanged.

Notes:

  • All code in this push has already been reviewed. Approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The reset-label comparison now uses sameSnoozePresets. A browser test checks that presets in a different row order from the defaults display “Restore: nothing.”

Changes: Snooze preset restore comparison

Layer / File(s) Summary
Compare snooze presets for restore labels
apps/web/src/components/settings/SnoozePresetsSettings.tsx, apps/web/src/components/settings/SettingsPanels.tsx, apps/web/src/components/settings/SettingsRestore.browser.test.tsx
sameSnoozePresets is exported and used for snooze preset reset-label comparisons. A browser test checks reordered presets against the defaults.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: saphid

Merge Risk: Minimal · up to 18c08

Restore device defaults will no longer offer to reset snooze options when only the row order differs from the defaults. The change is small and covered by a regression test, and no merge risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix (restore device defaults ignoring snooze option row order), which matches the changeset: sameSnoozePresets is exported and used in changedSettingLabels so restore compares pres…
Description check Passed The description follows the template. It has Problem, Cause, Change, Scope, and Verification sections, with reproduction steps, the root cause, the scope rationale, and test evidence including a faili…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the fix (restore device defaults ignoring snooze option row order), which matches the changeset: sameSnoozePresets is exported and used in changedSettingLabels so restore compares presets order-insensitively. It is specific and follows the conventional commit style from the template.

Full details: Description check

Explanation

The description follows the template. It has Problem, Cause, Change, Scope, and Verification sections, with reproduction steps, the root cause, the scope rationale, and test evidence including a failing run before the fix and passing results after. It lacks a Problem/Change split that matches the template exactly, and a before/after screenshot is not needed for this non-visual logic fix. The author also discloses what was not verified in a running app. The template's agent-model line is present.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e929836 and 18c0877.

Files selected for processing: 1

  • apps/web/src/components/settings/SettingsRestore.browser.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 3, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review December 3, 2026 00:52

Dismissing prior approval to re-evaluate 18c0877

@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Environment: web client in Chromium, 1280×800, light theme, separate fresh scenario databases, synthetic project, browser clock fixed at 23:16 on both sides.

Steps: On fresh settings, open Settings > General; then Settings > Threads > Snooze options at browser-local 2026-12-03 23:16. Today 6 PM is passed and sorts last. Click Add option, remove option 6 (the added In 30 minutes row), observe the five defaults with no row reset action, and return to General. On base, click Restore device defaults, observe the Snooze options confirmation, and cancel. On head the restore button remains disabled.

Scenario: Restore device defaults ignores snooze display order

Proven: the scenario fails on base e378a3dcaa and passes on head 18c08771eb.

Before e378a3dcaa After 18c08771eb
Result ❌ failed
ASSERTION_FAILED: expect.toBeDisabled failed
locator: getByRole("button", name: "Restore device defaults")
expected: disabled
observed: states: focused (match count 1)
✅ passed
fresh defaults Base e378a3dcaa: fresh defaults Head 18c08771eb: fresh defaults
default presets reordered Base e378a3dcaa: default presets reordered Head 18c08771eb: default presets reordered
restore after row reorder Base e378a3dcaa: restore after row reorder Head 18c08771eb: restore after row reorder
restore confirmation Base e378a3dcaa: restore confirmation
failure Base e378a3dcaa: failure
Recording Before After
Same add/remove interaction Before recording After recording

Scenario source

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 3, 2026
@juliusmarminge
juliusmarminge merged commit 6b94e86 into pingdotgg:main Dec 3, 2026
43 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 3, 2026
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