Repository navigation
Conversation
The Worktree location field saved only on blur, so pressing Enter did nothing. Blur on Enter outside IME composition, as the project name field does. Co-authored-by: only21mil <263261067+only21mil@users.noreply.github.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Pressing Enter now saves an edited worktree location through the existing blur-to-save behavior, while preserving IME composition handling. Defaults, save scope, and existing worktree locations remain unchanged. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Problem
In Settings → Worktrees, typing a path into Worktree location and pressing Enter does nothing. The path is saved only when the field loses focus.
WorktreesDirectoryRowinapps/web/src/components/settings/StorageSettings.tsxcommits inonBlurand has noonKeyDown, unlike the project name field inProjectSettingsPanel.Change
Enter now blurs the input outside IME composition, so the existing
onBlurcommit runs. The guard matchesProjectSettingsPanel(isComposingorkeyCode === 229returns early). Trimming, validation and pasted-path handling are unchanged.This re-lands only21mil's #45504 on current
main, with credit in the commit. Macroscope approved it with no review threads, and the author closed it to free a slot.Scope
Small fix for an obvious bug (Enter does nothing in a single-line settings field), so no issue. Same shape as the merged #45539 and #45541. Web only: the row renders only in
WorktreesSettings.tsx, and mobile has no worktree location setting.Verification
Scenario: Enter saves the worktree location in Settings
vp run scenarios:prove scripts/scenarios/enter-saves-worktree-location.e2e.ts --base 8c4008f17f, with Chromium at 1280×800 and fresh scenario data. Steps: open/settings/worktrees, fill Worktree location with~/custom-worktrees, press Enter.Proven: the scenario fails on base
8c4008f17fand passes on headb502b30d0b.8c4008f17fb502b30d0bASSERTION_FAILED: expect.toBeVisible failed
locator: getByRole("button", name: "Reset worktree location to default")
observed: no node (match count 0)
On head, the reset arrow next to "Worktree location" shows that the path was saved. On base, nothing was saved.
Browser test
StorageSettings.browser.test.tsxgets one regression test, borrowed from #45504. Composition Enter (isComposing: true, thenkeyCode: 229) keeps focus and saves nothing. A real Enter blurs and saves{ worktreesDirectory: "/tmp/custom-worktrees" }.StorageSettings.tsxfrom8c4008f17f), it fails:expect(element).not.toHaveFocus().vp test run apps/web/src/components/settings/StorageSettings.browser.test.tsxpassed 13 of 13.vp run check:changed upstream/mainpassed format, lint, knip, typecheck (2 packages), test and react compiler.Not checked: a real OS IME session (the composition guard is covered by synthetic events in Chromium), and the macOS and Windows desktop shells, which share the same React handler.
Claude Opus 5.5 via T3 Code