Skip to content

fix(web): Enter saves the default viewport size and skipped runs kept - #42480

Open
Mnigos wants to merge 1 commit into
pingdotgg:mainfrom
Mnigos:settings-number-fields-commit-on-enter
Open

Mnigos wants to merge 1 commit into
pingdotgg:mainfrom
Mnigos:settings-number-fields-commit-on-enter

Conversation

@Mnigos

@Mnigos Mnigos commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

In Settings → Browser → Advanced, typing a new "Default viewport width" or "Default viewport height" (say 1440) and pressing Enter does nothing. The same happens in Settings → Labs with "Skipped runs kept". The value saves only once the field loses focus, so a keyboard user who presses Enter and moves on never gets it saved.

These fields save through NumberField's onValueCommitted, and Base UI commits typed values on blur, not on Enter. Their NumberFieldInputs (apps/web/src/components/settings/IntegrationsSettings.tsx around lines 446 and 461, apps/web/src/components/settings/LabsSettingsPanel.tsx around line 276) have no Enter handling. #42392 fixed the same gap for the Background Activity interval field with an onKeyDown that blurs and refocuses the input on Enter, skipping Enter during IME composition.

This PR moves that handler into a small shared commitNumberFieldOnEnter in components/settings, keeps IntervalSecondsField on it unchanged, and adds it to the viewport width/height and skipped-runs inputs. The ui/number-field primitive is untouched.

Found while reading the settings panels after #42392 landed.

Tests: IntegrationsSettings.browser.test.tsx types 1440 into the viewport width, presses Enter, and checks that the stored default viewport becomes 1440×800 with focus still in the field. LabsSettingsPanel.browser.test.tsx extends the existing blur test with an Enter commit. Both fail on main (nothing is saved) and pass with the fix. The IME guard is already covered by the existing interval-field test in ProviderSettingsPanel.environment.browser.test.tsx, which still passes. vp run check:changed passes.

There's no image pair, because nothing looks different. Only Enter now saves.

Claude Opus 5.5 via T3 Code

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Nov 24, 2026
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Numeric settings now use a shared handler to commit values when Enter is pressed, while retaining focus. Browser tests check the saved viewport dimensions and skipped-runs value.

Changes: Numeric settings Enter-key commits

Layer / File(s) Summary
Shared Enter-key commit behavior
apps/web/src/components/settings/commitNumberFieldOnEnter.ts, apps/web/src/components/settings/IntegrationsSettings.tsx, apps/web/src/components/settings/IntervalSecondsField.tsx, apps/web/src/components/settings/LabsSettingsPanel.tsx, apps/web/src/components/settings/IntegrationsSettings.browser.test.tsx, apps/web/src/components/settings/LabsSettingsPanel.browser.test.tsx
A shared handler ignores non-Enter and composing events, then blurs and refocuses the input for Enter. The viewport, interval, and skipped-runs fields use the handler. Browser tests check saved values and retained focus.

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

Change: Bug fix

Suggested labels: bugfix

Suggested reviewers: maria-rcks, juliusmarminge, only21mil, macroscopeapp

Merge Risk: Minimal · up to 12d39

Pressing Enter now saves the default viewport size and the skipped-runs count in settings, matching the existing interval field. The change is narrow and low risk, with test coverage for the new behavior.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the two user-visible changes: Enter now saves the default viewport size and the skipped runs kept setting. It matches the changeset, which adds a shared Enter-commit handler to the vie…
Description check Passed The description follows the template. It states the problem with expected behavior and reproduction steps (typing 1440 and pressing Enter in Settings → Browser → Advanced, and Settings → Labs). It exp…
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 two user-visible changes: Enter now saves the default viewport size and the skipped runs kept setting. It matches the changeset, which adds a shared Enter-commit handler to the viewport width/height inputs and the skipped-runs input. The title uses the conventional fix(web) prefix. It omits the shared helper, which is acceptable because the title need not cover every detail.

Full details: Description check

Explanation

The description follows the template. It states the problem with expected behavior and reproduction steps (typing 1440 and pressing Enter in Settings → Browser → Advanced, and Settings → Labs). It explains the change (a shared commitNumberFieldOnEnter helper applied to the viewport and skipped-runs inputs, with the ui/number-field primitive untouched). It links the related fix #42392 as context. Verification lists focused browser tests, states that they fail on main and pass with the fix, and notes the IME guard coverage and the check command. It states that no screenshots are needed because nothing looks different. The Scope section is weak: it does not explicitly link a bug issue or say why none is needed. It also does not explicitly state that the change is a bug fix rather than a feature, although the description frames it as one. The model attribution line is present as the template requests.

Resolution

Optionally, add an explicit Scope statement: link the issue for this bug, or explain why no issue is needed. The current description already covers the other sections.

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 5d02075 and 12d3946.

Files selected for processing: 6

  • apps/web/src/components/settings/IntegrationsSettings.browser.test.tsx
  • apps/web/src/components/settings/IntegrationsSettings.tsx
  • apps/web/src/components/settings/IntervalSecondsField.tsx
  • apps/web/src/components/settings/LabsSettingsPanel.browser.test.tsx
  • apps/web/src/components/settings/LabsSettingsPanel.tsx
  • apps/web/src/components/settings/commitNumberFieldOnEnter.ts

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

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:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant