Skip to content

fix(web): pin "Add workspace…" below the New session workspace list - #948

Merged
ericleepi314 merged 2 commits into
mainfrom
fix/web-new-session-add-workspace-pinned
Sep 22, 2026
Merged

ericleepi314 merged 2 commits into
mainfrom
fix/web-new-session-add-workspace-pinned

Conversation

@ericleepi314

@ericleepi314 ericleepi314 commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Why

With a long list of workspaces, the "Create new workspace…" option at the end of the New session dialog's native select was hard to find. The reference shows the workspace list with Add workspace… pinned below it in its own section.

What changed

  • The dialog's workspace picker is now the app's own Menu: a row per folder with a folder glyph, the current one checked, the full path as a second line only where two folders share a name (so two clawcodex checkouts stay distinguishable while the common case stays one compact line). The list scrolls; Add workspace… sits below it, after a divider, pinned in view at any list length. Picking it reveals the folder-path field as before.
  • Menu gains footer (rows rendered outside the scrolling viewport, after a divider, never marked selected) and block (the trigger fills the owner, the list spans it).
  • Latent Menu bug fixed: rows/separators/labels are flex items of a height-constrained viewport with an explicit min-height, so a long list squashed every row to its minimum before scrolling — a two-line row's hint overlapped the next row. Unreachable before this change (the composer menus are short); flex: none on those rows.
  • Escape and a press outside the open list close only the list; the next one closes the dialog. Focus returns to the trigger when the list closes, and the trigger's accessible name carries the chosen folder ("Workspace: /path").
  • Menu measures the room above and below its anchor once open (and on resize), caps the list to the room on its side, and opens on the other side when its own has too little and the other has more (menuPlacement, unit-tested). Before, the stylesheet capped the list by the window's height regardless of where the anchor sat, so on a 1366×768 window the picker ran below the fold with the page unable to scroll — the pinned row was off-screen. The composer pickers keep opening upward.
  • Cascade fix: the block list's width rule now compounds with .list and follows it, so the list spans its trigger (it was 360px under a 402px trigger).

Verification

  • vitest: 692 tests green (new: pinned footer outside the viewport after a divider with 41 rows, selection check, add-workspace flow, Escape/outside-press scoping, Menu footer/block); tsc clean; bundle builds.
  • Browser (served ui-web/dist on this machine's 37-workspace sidebar) at 1366×768, 1440×900 and 1280×640: the list spans the trigger (402px), scrolls, and its pinned Add workspace… row is within the viewport at every size (list capped to 366px / 420px / 302px); hinted rows 50px and plain rows 34px with no overlap; picking a row returns focus to the trigger; the composer's model picker still opens upward and in view; no console errors.
  • One critic review round applied (viewport fit, cascade order, accessible name, focus return, Escape closure, name truncation).

🤖 Generated with Claude Code

ericleepi314 and others added 2 commits September 21, 2026 17:03
The New session dialog offered its workspaces in a native select with
"Create new workspace…" as the last option — at the end of a long list it
was the row nobody scrolled to. The picker is now the app's own Menu: a
row per folder (the path as a second line only where two folders share a
name, the current one checked) in a scrolling list, with "Add workspace…"
pinned below it after a divider, as the reference does.

Menu gains a `footer` (rows outside the scrolling viewport, after a
divider, never checked) and a `block` mode (the trigger fills the owner
and the list spans it — the form-control shape). Rows, separators and
labels no longer shrink in a height-constrained list: they are flex items
of the viewport, and with an explicit min-height a long list squashed
every row before it scrolled, so a two-line row's hint overlapped the row
below. Unreachable before — the composer menus are short.

Escape and a press outside the open list close only the list; the dialog
closes on the next one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ck list spans its trigger

Review round: the list's stylesheet cap bounded it by the window's height,
not by where its anchor sat, so the New session picker opening below a
control in the middle of a 768px-tall window ran past the bottom edge —
with the page unable to scroll, the pinned "Add workspace…" was not on
screen at all. The menu now measures the room above and below its anchor
once open (and on resize), caps the list to the room on its side, and
opens on the other side when its own has too little and the other more.
The composer pickers keep opening upward. `.listBlock` was declared before
`.list` at equal specificity, so the base width bounds won: the block list
was 360px under a 402px trigger; it is now a compound rule after `.list`.
The trigger's accessible name carries the chosen folder, not just the
field label; focus returns to the trigger when the list closes; the
Escape handler reads the menu state from its own closure instead of a
ref written during render; the name in the trigger keeps its width and
the path absorbs the truncation.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@ericleepi314
ericleepi314 merged commit 071c7da into main Sep 22, 2026
6 of 7 checks passed
@ericleepi314
ericleepi314 deleted the fix/web-new-session-add-workspace-pinned branch September 22, 2026 00:21
@ericleepi314

Copy link
Copy Markdown
Collaborator Author

Deferred follow-ups from the review (non-gating, shared with the composer pickers built on the same Menu):

  • Keyboard: the menu has no arrow-key navigation or typeahead, and Tab walks the rows and continues past the footer into the next control with the list still open. aria-haspopup="menu" promises the menu-button pattern; worth a Menu-primitive follow-up that would cover the model, effort and permission pickers too.
  • Click-through: a press outside the open list but inside the dialog card closes the list and also activates the target (Create submits, the Worktree switch toggles). A native select swallowed that press.

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