Skip to content

fix(web): adding the last snooze option no longer reorders rows mid-edit - #33279

Open
benoneill66 wants to merge 1 commit into
pingdotgg:mainfrom
benoneill66:fix/snooze-add-option-sort
Open

benoneill66 wants to merge 1 commit into
pingdotgg:mainfrom
benoneill66:fix/snooze-add-option-sort

Conversation

@benoneill66

Copy link
Copy Markdown

Problem

In Settings → Threads → Snooze options, clicking Add option for the 8th (last allowed) option made the rows jump. The new option landed mid-list, and it looked like it had overwritten an existing row.

The rows are meant to sort by wake time only once focus leaves the list. At the limit, though, the button became disabled while it had focus. Chromium then drops focus to body, the list's blur handler treats that as leaving, and it sorts straight away.

Change

At the limit the button uses aria-disabled instead of disabled, and its click handler is removed. Focus stays on the button, so sorting waits until the user actually leaves the list. Button already styles aria-disabled (dimmed, not-allowed cursor), so it looks the same.

Scope and approval

This is a small, focused fix for an obvious bug, under the CONTRIBUTING exception: one prop swap in one component, plus a test. It doesn't change how or when rows sort otherwise.

Verification

  • New SnoozePresetsSettings.browser.test.tsx: starting one short of the limit, it adds an option and checks that focus stays on Add, that the button is aria-disabled, and that the new row is last. It fails on main (focus is lost) and passes with the fix. Headless Chromium doesn't fire the blur, so the test checks the root cause (lost focus) rather than the jump itself.
  • vp run check:changed passes.
  • Manual check in a dev build, adding options 6, 7 and 8 from the defaults:
    • Before: the 8th add sorted at once, and "In 1 day" landed at row 6.
    • After: it stays at row 8. A 9th click does nothing, and clicking outside still sorts.
Before After
before after

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

🤖 Generated with Claude Code

Disabling the focused "Add option" button at the limit dropped focus,
which the list read as leaving it and sorted immediately. Use
aria-disabled so focus stays put until the user actually leaves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 9, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Would Approve

Macroscope's review found this PR approvable — The snooze settings Add option button now retains focus at the preset limit, preventing rows from reordering mid-edit. The preset limit and settings-saving behavior remain unchanged.

Needs human approval because:

  • Macroscope's correctness review did not reach a verdict

Notes:

  • The correctness review was unavailable. Eligibility was assessed without its result.

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

@coderabbitai

coderabbitai Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Add option button remains focusable when the snooze preset limit is reached. Its click handler is omitted and aria-disabled is set. A browser test checks the button state, focus, and final preset amount.

Changes: Snooze preset add button

Layer / File(s) Summary
Limit behavior and browser coverage
apps/web/src/components/settings/SnoozePresetsSettings.tsx, apps/web/src/components/settings/SnoozePresetsSettings.browser.test.tsx
At the preset limit, the Add option button uses aria-disabled and has no click handler instead of being natively disabled. The browser test checks that the button retains focus and that the final option has amount "30".

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

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: t3dotgg, macroscopeapp

Merge Risk: Minimal · up to 17105

The change addresses the reported mid-edit reordering, and no actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: adding the last snooze option no longer reorders rows while the user is editing. It is a conventional commit title in plain language and matches the raw summary, the o…
Description check Passed The description follows the template. It has Problem, Change, Scope and approval, and Verification sections with substantive content. The problem, the root cause (disabled button losing focus, trigger…
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 main change: adding the last snooze option no longer reorders rows while the user is editing. It is a conventional commit title in plain language and matches the raw summary, the objectives, and the aria-disabled change in SnoozePresetsSettings.tsx.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope and approval, and Verification sections with substantive content. The problem, the root cause (disabled button losing focus, triggering the blur-based sort), and the fix (aria-disabled with the click handler removed) are all explained. The scope section justifies the small-fix exception. Verification lists a focused browser test, a check command, a manual before/after run, and before/after screenshots. The template's instruction to end with the model and harness is satisfied by the 'Created with Claude Opus 5.5' line. The description also does not follow the template's 'Read CONTRIBUTING.md' comment, which is an HTML comment and not a required section.

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 402d062 and 1710571.

Files selected for processing: 2

  • apps/web/src/components/settings/SnoozePresetsSettings.browser.test.tsx
  • apps/web/src/components/settings/SnoozePresetsSettings.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.

@maria-rcks

maria-rcks commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

verified exact head 17105710c6096db2ea20c1b965f2e143148e1a9d on linux with the real dev web app, repo playwright, and /usr/bin/google-chrome. main was checked first in a separate worktree; only one dev server ran at a time. all scenario data was created through the app.

  • settings → threads → snooze options: the eighth add keeps the new row last and retains focus on add (aria-disabled=true). a ninth click, enter, and space keep eight rows.
  • leaving the list sorts by wake time. removing a row enables add; adding again restores eight. settings survive reload.
  • created a project for a real git repository and completed a codex gpt-6.1-sol turn through the composer. the configured "in 1 day" menu entry snoozes that thread; snooze survives reload and "wake now" returns it.
  • blacksmith: focused browser and snooze logic tests passed, 2 files / 5 tests. no source changes were needed.
main eighth add: active element = dialog Close
pr eighth add: active element = Add option; aria-disabled = true
ninth click + enter + space: row count = 8
remove / re-add: row count = 7 / 8
real provider: pwd -> /home/user/snooze-verification
real provider: git status --short; reply SNOOZE_VERIFY_OK (9s)
reload: 8 presets and snoozed thread persisted; wake now succeeded

matching preset data after the eighth add, main then pr. these images show the rows; the focus difference was checked directly above.

main after eighth add

pr after eighth add

eighth add, limit, blur sort, remove and re-add, real thread snooze and wake

real codex turn completed in the client

Not verified

main reproduces the lost-focus bug, but this chrome build did not reproduce the immediate automatic row jump, in either headed or headless mode. the pr focus fix and sorting after an actual outside click were exercised directly. native desktop, ios/android, other providers, relay/tunnel connections, and automatic wake after waiting 24 hours were not exercised.

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

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants