From d3388603bb6a4ced45cbceccf65d6e667660c2e8 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 5 May 2026 16:27:20 -0700 Subject: [PATCH] feat(new-workspace): inline create-branch row, scoped suggestions, name under Advanced, tab/focus polish (#1469) * feat(new-workspace): branch-tab create row, scoped empty hints, name under Advanced, focus polish - Branch tab autocomplete now offers "Create new branch " instead of a separate + button + dialog (replaces the original UX from #1408 / #1400). Suppressed when the typed query exactly matches an existing branch. - "Use as workspace name" row is restricted to Smart mode; on dedicated source tabs (GitHub/Linear/Branch) it was off-topic noise. - Per-mode empty-state hints ("search GitHub PRs and issues", "find a branch or create a new one", etc.) replace the generic message. - When a source (PR/issue/Linear/branch) is selected, the auto-derived workspace name is exposed as a "Name" input under Advanced where it can be reviewed/overridden. With an explicitly typed name the smart input itself is the name field, so no duplicated control. - Forward Tab from the Repo combobox now skips the Smart/GitHub/Branch/Linear segmented control and lands directly in the search input. Shift-Tab from the input still focuses the active tab trigger so the segmented control is reachable in reverse. Implemented via a focusCapture interceptor on TabsList that distinguishes outside-entry from intra-list moves and from the input's own shift-tab. - Trigger checkLinearConnection() on mount so the "Connect Linear in Settings" hint isn't shown stalely when the composer is the first Linear-aware surface to render in the session; gate the disconnected message on linearStatusChecked. Co-authored-by: Orca * fix(new-workspace): Enter commits typed text while results are stale When the user types faster than the 200ms search debounce, rows and commandValue still reflect the previous query, so Enter would silently pick a stale source row (e.g. a PR from the prior letters). Treat results as stale while loading or while debouncedQuery hasn't caught up to the input value, and commit the typed text via onValueChange instead. Co-authored-by: Orca * fix(new-workspace): suppress stale source rows in autocomplete while typing Source rows (GitHub items / branches / Linear issues) are driven by debouncedQuery, so they're stale until the user pauses for the 200ms debounce. The previous attempt only short-circuited Enter in the input's onKeyDown, but cmdk's Command component has its own Enter handler that still fires onSelect on the highlighted (stale) row. Filter source rows out of the rows list itself when debouncedQuery hasn't caught up to value, leaving only the typed-text row (use-name in Smart, create-branch in Branches). With no stale rows present, neither cmdk nor our own handler can pick a wrong source on Enter, and the popover gives visual feedback (collapses to the typed-text row) while results catch up. Co-authored-by: Orca * fix(new-workspace): keep stale results visible, force highlight to typed-text row Previous attempt removed source rows while debouncedQuery hadn't caught up to value, which caused funky disappear/reappear flicker as the user typed (rows present briefly while fresh, gone after the next keystroke). Keep all source rows visible at all times to preserve continuity, but control which row is highlighted while stale: - Smart/Branches: force highlight onto the typed-text row (use-name / create-branch) so cmdk's Enter handler commits the typed text instead of a stale issue/PR/branch. - GitHub/Linear: no typed-text fallback row exists, so clear the highlight; the input's onKeyDown falls through to onPlainEnter rather than picking a stale source. Also fixed the input's Enter handler to fall through to onPlainEnter when no row matches the (possibly empty) commandValue, so the keypress isn't inert in the cleared-highlight case. Co-authored-by: Orca * feat(new-workspace): auto-highlight matching source for #NNN, GH URLs, Linear IDs When the typed value is unambiguously a source reference, snap the autocomplete highlight onto the matching source row once it appears instead of leaving it on the typed-text fallback. Enter then picks the intended source. Recognized patterns: - GitHub shorthand: #1234 - GitHub URL: https://github.com///issues/123 or /pull/123 - Linear identifier: STA-123 (case-insensitive [A-Z][A-Z0-9_]*-\d+) Stale-results behavior is unchanged: while debouncedQuery hasn't caught up to value, the typed-text row stays highlighted (Smart/Branches) or the highlight is cleared (GitHub/Linear) regardless of intent. Co-authored-by: Orca --------- Co-authored-by: Orca --- .../components/NewWorkspaceComposerCard.tsx | 19 ++ .../new-workspace/SmartWorkspaceNameField.tsx | 171 ++++++++++++++++-- 2 files changed, 177 insertions(+), 13 deletions(-) diff --git a/src/renderer/src/components/NewWorkspaceComposerCard.tsx b/src/renderer/src/components/NewWorkspaceComposerCard.tsx index 98219c7a5..7cacd39f4 100644 --- a/src/renderer/src/components/NewWorkspaceComposerCard.tsx +++ b/src/renderer/src/components/NewWorkspaceComposerCard.tsx @@ -398,6 +398,25 @@ export default function NewWorkspaceComposerCard({ : '-translate-y-1 opacity-0 delay-0' )} > + {smartNameSelection ? ( + // Why: when a source (PR/issue/Linear/branch) is picked the + // smart field shows a pill instead of an editable name, so + // surface the auto-derived workspace name here under Advanced + // where it can be reviewed/overridden. When the user typed an + // explicit name there's no source pill — the smart input is + // already the name field, so we don't duplicate it here. +
+ + onNameValueChange(event.target.value)} + placeholder="Workspace name" + className="w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1.5 text-sm shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50" + /> +
+ ) : null} +