Skip to content

feat(new-workspace): inline create-branch row, scoped suggestions, name under Advanced, tab/focus polish - #1469

Merged
nwparker merged 5 commits into
mainfrom
nwparker/smart-composer-tweaks
May 5, 2026
Merged

nwparker merged 5 commits into
mainfrom
nwparker/smart-composer-tweaks

Conversation

@nwparker

@nwparker nwparker commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Polish pass on the unified Create Workspace composer. Throws away the +-button-plus-dialog approach from #1408 in favor of an inline "Create new branch …" row inside the existing autocomplete, and tightens up several other UX rough edges in the Smart name field.

Changes

Branch tab — create-new-branch row (replaces #1408 UX)

  • When on the Branch tab, the autocomplete now shows a "Create new branch name" row at the top whenever the query is non-empty.
  • Suppressed when the query exactly matches an existing branch (no point offering to "create" something already there).
  • Selection routes through the same path as a typed name — baseBranch stays unset so the new branch starts from the repo's default base.
  • No more + button, no more "New branch" dialog. The explicitName plumbing on launchFromBranch from feat: create workspace from new branch button in Branches sub-tab #1408 isn't needed because the unified composer already routes user-typed names through name / baseBranch correctly.

Scoped autocomplete suggestions

  • The generic "Use X as workspace name" row only appears on the Smart tab. On GitHub / Linear / Branch tabs it was off-topic noise — those tabs are about picking (or, on Branches, creating) a specific source.
  • Empty-state hints are now per-mode:
    • Smart: "Start typing to create a name or find a source."
    • GitHub: "Start typing to search GitHub PRs and issues."
    • Branch: "Start typing to find a branch or create a new one."
    • Linear: "Start typing to search Linear issues."

Auto-derived name moves under Advanced

  • When a source (PR/issue/Linear/branch) is selected, the smart input shows a pill — there's no inline name to review.
  • Surface the derived workspace name as a Name input inside the Advanced drawer, where it can be reviewed or overridden.
  • When the user typed an explicit name (no source picked), the smart input is the name field — Advanced does not duplicate it.

Tab navigation polish

  • Forward Tab from the Repo combobox now skips the Smart/GitHub/Branch/Linear/Name 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 for keyboard users who want to switch modes.
  • Implemented as an onFocusCapture interceptor on TabsList that distinguishes outside-entry (relatedTarget = Repo trigger → bounce to input) from the shift-tab case (relatedTarget = input → allow) and intra-list arrow-key moves (relatedTarget inside list → allow). This avoids fighting Radix's roving tabindex, which re-applies tabindex=0 on every render.

Linear status race fix

  • The composer can be the first Linear-aware surface to render in a session, before TaskPage/IntegrationsPane have called checkLinearConnection, leaving linearStatus.connected = false even when actually connected.
  • Now triggers checkLinearConnection() on mount when linearStatusChecked is false, and gates the "Connect Linear in Settings…" hint on linearStatusChecked so the in-flight check doesn't briefly mislabel a connected user as disconnected.

Testing

  • pnpm typecheck ✓
  • pnpm lint ✓ (6 pre-existing warnings unrelated to these files)
  • Manual: tabbed through Repo → Input, shift-tabbed back to segmented control; verified create-branch row appears/disappears around exact-match query; verified Advanced shows Name only when a source is picked; verified Linear empty state.

Made with Orca 🐋

nwparker and others added 5 commits May 5, 2026 14:55
…under Advanced, focus polish

- Branch tab autocomplete now offers "Create new branch <name>" instead of a
  separate + button + dialog (replaces the original UX from #1408 / #1400).
  Suppressed when the typed query exactly matches an existing branch.
- "Use <X> 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 <[email protected]>
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 <[email protected]>
…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 <[email protected]>
…ped-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 <[email protected]>
…, 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/<owner>/<repo>/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 <[email protected]>
@nwparker
nwparker merged commit d338860 into main May 5, 2026
2 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…me under Advanced, tab/focus polish (stablyai#1469)

* feat(new-workspace): branch-tab create row, scoped empty hints, name under Advanced, focus polish

- Branch tab autocomplete now offers "Create new branch <name>" instead of a
  separate + button + dialog (replaces the original UX from stablyai#1408 / stablyai#1400).
  Suppressed when the typed query exactly matches an existing branch.
- "Use <X> 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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 <[email protected]>

* 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: stablyai#1234
  - GitHub URL: https://github.com/<owner>/<repo>/issues/123 or stablyai/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 <[email protected]>

---------

Co-authored-by: Orca <[email protected]>
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.

1 participant