Skip to content

feat(native): web-parity sidebar, thread actions, keybindings and command palette - #19

Merged
rynfar merged 9 commits into
nativefrom
nw/w3-sidebar
Nov 2, 2026
Merged

rynfar merged 9 commits into
nativefrom
nw/w3-sidebar

Conversation

@rynfar

@rynfar rynfar commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Problem

The native sidebar was a first-cut list: one row height, a few hard-coded statuses, no sections or shelves, no thread actions, no keybindings beyond quit/hide, and no command palette. Issues #2, #3 and #10 ask for the web's sidebar, thread actions and keys.

Approach

Core (pure, tested; cases ported from the TypeScript suites as the oracle)

  • core/src/sidebar/: the web's partition and list builder (partitionSidebarThreads and the list items in Sidebar.tsx): Pinned, Active, the Working shelf with the inbox return tracker and its 2s exit grace, Snoozed, Settled with the 10 + 25 "Show more" tail, collapsed shelves that still show the open thread. Thread presentation mirrors presentThreadShell/shellRuntime, including subagent approval roll-up. Ports threadSort.ts (settled/active/pinned/inbox/working sorts, pin order keys), threadSettled.ts (snooze rules, wake, presets with local calendar boundaries through an injected time zone), resolveSidebarThreadStatus, the row's top status, shouldRecedeSidebarThread, status pills, project grouping (projectGrouping.ts: repository / repository_path / separate, overrides, labels, project sort), the older-settled helpers, and the visit watermark (threadVisits.ts). splice_range lets the view splice only rows that changed.
  • core/src/thread_actions.rs: command builders matching operations/commands.ts, buildThreadActionMenuItems, planThreadUndo, and an undo store with the notice's grouping and 5s expiry.
  • core/src/keybindings/: DEFAULT_KEYBINDINGS, shortcut and when parsing, resolution, labels, jump helpers, the server keybindings decoder, and translation to GPUI keystrokes and predicates. GPUI matches a bare identifier against the innermost context only, so each when identifier x becomes !(!x), which reads "set anywhere on the focus path" — the web's flat semantics.
  • core/src/search/ and core/src/palette/: paletteSearch.ts (folding, token matching, thread scoring with recency and opens, ranked passes) and the palette's grouping and ordering from CommandPalette.logic.ts.

App

  • Sidebar (app/src/sidebar/): card rows (78px; project name, pin, status with icon and live duration or relative time, title, branch line) for pinned/active/working, 36px slim rows for snoozed/settled, shelf headers with count and chevron, Show more, hover actions (Snooze presets, Settle; Wake; Un-settle), Woke dismissal, inline rename (double-click or menu; Enter/blur commits, Escape cancels), jump hints after holding the modifier 200ms, and the Undo notice in the footer. Variable heights use GPUI list with incremental splices, so streaming never resets scroll; the pane stays .cached(). Search header: local ranking via the ported scorer plus debounced orchestration.searchThreads message matches, keyboard navigation.
  • Context menu (context_menu.rs, §6.3) and confirm dialog (dialog.rs, §6.4); delete uses the web's copy and stops a live runtime first. Every one-way action has its reverse in the menu and row (pin/unpin, settle/un-settle, snooze/wake, archive → Undo).
  • Keymap (keymap.rs): all defaults registered; implemented: sidebar.toggle (cmd-b, plus the titlebar toggle at x=91 and a collapsed layout), thread.previous/next, thread.jump.1..9, thread.settle (settles and moves on, or un-settles), thread.pin, thread.undo, thread.copyReference, commandPalette.toggle. The rest bind to Unimplemented, which propagates. keymap::install(server_keybindings) is the seam for user overrides once the server-config subscription lands.
  • Command palette (palette.rs): 576 × ≤420, radius 16, 10vh; actions, recent threads, and ranked threads/projects on a query.
  • Menus: Edit (undo/redo/cut/copy/paste/delete/select all to the focused field), View (Toggle Sidebar, Command Palette, Full Screen), Window (Minimize, Zoom), File (Close Window).
  • Icons: my icons are folded into the shared icons.rs from feat(native): transcript rows and streaming markdown at web fidelity #17/feat(native): drive agents from the composer: new threads, pickers, approvals #20 (plus sized, which keeps the inherited hover color, and from_name for menu models). scripts/vendor-icons.ts regenerates any icons/lucide/ path that icons.rs names, at stroke 1.75 or 2 under stroke-2/; --check verifies.
  • Client: reuses ClientHandle::request(method: &'static str, …), now in native from feat(native): drive agents from the composer: new threads, pickers, approvals #20 (same signature as feat(native): right panel with tabs and the diff panel #18).
  • Custom snooze (snooze_dialog.rs): "Date and time" or "Duration" (minutes/hours/days), validated by a port of resolveCustomSnooze including the DST-gap rejection; the web's calendar popover is a typed YYYY-MM-DD field.

Review fixes (Sol 6.1) and integration with #16/#17/#20

  • Palette rows own the jump and pin keys (Cmd+1–9 runs the row carrying that shortcut, else is swallowed; Cmd+Shift+P toggles the highlighted thread's pin), and keyboard highlight scrolls into view.
  • Connection changes rebuild the sidebar, so a disconnect re-places the Working shelf.
  • Undo steps go through their actions' claim invalidation (pin uses the same path as pinThread, including the top-of-pins key).
  • The sidebar clock ticks per second only while a live duration was drawn in the last frame and the sidebar is expanded, otherwise per minute, and stops while collapsed. GPUI marks a notified view's ancestors dirty, so a per-label view would redraw the same views; the visibility gate is what bounds the work.
  • Streaming-only shell ticks (sameApartFromStreaming) skip the sidebar rebuild and the sidebar redraw; only real changes rebuild.
  • Id ties use W4's locale_compare (a_b before a-b).
  • Menus, dialogs, the palette and toasts paint paint_backdrop_blur under their translucent fill (glass.rs).
  • Escape and arrows yield to IME composition in the palette, sidebar search and rename.
  • Menu capabilities come from one ThreadCapabilities seam: threadAutoSettleOptOut now comes from the server config; can_operate stays assumed true (the native client has no session-scope read yet).
  • W2 (feat(native): drive agents from the composer: new threads, pickers, approvals #20): chat.new, modelPicker.toggle, composer.effort and composer.mode bind through the keymap to new_thread::NewThread, composer::ToggleModelPicker and composer::OpenPermissions; W2's direct Cmd+N/Cmd+Shift+M/E/A bindings are removed (Shift+Tab stays, it is not a keybinding command). The server config's keybindings install as user overrides; bindings a new set drops are shadowed by a propagating no-op.

Ledger rows

SB-LIST done, SB-UNDO done; KB-USER (new), SB-SECTIONS, SB-GROUPING, SB-ROW, SB-HEADER, SB-SEARCH, SB-MENU, SB-SNOOZE, KB-DEFAULTS, KB-PALETTE, KB-MENUS partial (gaps below).

Verification

  • cargo test --workspace: 220 core tests plus the conformance replay pass. The shell fields this PR adds to ThreadShell (and olderSettled on the snapshot) are set in the rich shell scenario (conformance/shellCases.ts), regenerated, and compared against TypeScript; generate.ts --check passes. cargo clippy --workspace --all-targets -- -D warnings: clean. node scripts/gen-theme.ts --check, node --test parity/sync.test.ts (42 pass), node scripts/vendor-icons.ts --check: pass.
  • App launches against the dev server (with the server-config subscription and user keybindings installed) with no warnings (no screen-recording permission on this host, so no screenshots; a reviewer with one should capture the sidebar, menu and palette).
  • Probe and a new headless example, cargo run -p t3-client --example thread_actions, against the isolated dev server:
thread mcp:9d445d3b-d7fb-4036-89e4-20c367ef1698 "W1 transcript fixture": section Some(Active)
thread.pin: accepted
  shell pinnedAt=Some("2026-11-02T10:11:42.880Z") -> section Some(Pinned)
thread.unpin: accepted
  shell pinnedAt=None -> section Some(Active)
thread.settle: accepted
  shell settledOverride=Some("settled") -> section Some(Settled)
thread.unsettle: accepted
  shell settledOverride=Some("active") -> section Some(Active)
thread.snooze: accepted
  shell snoozedUntil=Some("2026-11-02T11:11:43.318Z") -> section Some(Snoozed)
thread.unsnooze: accepted
  shell snoozedUntil=None -> section Some(Active)
orchestration.searchThreads: 0 message matches
ok

Gaps (why the issues stay open)

  • Older-settled pages: helpers are ported, but the shell is not subscribed with omitOlderSettled (needs shellOlderSettled/shellThreadFamilies from the config before the shell subscribes, plus omitIdleSubagents, which changes what the transcript's subagent rows can read), so Show more pages through local rows only.
  • Rows: no project favicons, PR badge, terminal indicator, provider stack, draft indicator or diff stats; no drag and drop or multi-select (SB-DRAG, SB-SELECT).
  • Header: no New thread (W2), Add project or project filter; the boring-sidebar folder mode is not rendered though grouping is ported.
  • Menu: New thread on branch, Project settings, Find, Share with guest and Turn into project stay out of the menu until those surfaces exist (gated, not dead items). can_operate is assumed until the client reads session scopes.
  • Custom snooze: no calendar popover or "Edit snooze options" (no settings surface).
  • Keys: commands without a native surface are registered no-ops; no keybindings settings UI; the Undo notice does not yet claim mod+z inside a text field.
  • Palette: no file, message-content or settings search, no submenus.

Refs #2, #3, #10

Model: Claude Opus 5.5 (Claude Code, autonomous worker W3)

Ports the web's sidebar partition (pinned, active, working, snoozed,
settled), inbox return tracking, thread sort and pin order keys, snooze
rules and presets, project grouping, the older-settled helpers, and the
thread action commands, menu model and undo store, with tests ported from
the TypeScript suites.
…in core

Ports DEFAULT_KEYBINDINGS, shortcut and when-expression parsing, rule
resolution, labels, thread jump helpers and the server keybindings
decoder, plus GPUI keystroke and context-predicate translation.
…its in core

Ports paletteSearch (folding, token matching, thread scoring with recency
and opens, ranked passes) and the command palette's grouping and
ordering, ranks sidebar search with it, and adds the open thread's visit
watermark from threadVisits.ts.
… and menus

The sidebar renders the web's sections with card and slim rows in a
variable-height list that splices only changed rows, a thread search
header, shelf toggles, Show more, and the Undo notice. Thread rows get
the context menu (pin, settle, snooze presets, wake, rename, mark unread,
regenerate title, auto-settle, copy path/branch/thread/id, archive,
delete with confirmation), hover actions, inline rename and visit
tracking. Default keybindings register as GPUI bindings with their when
clauses, cmd-k opens the command palette, and the menu bar gains Edit,
View and Window. Lucide icons are vendored with the web's stroke.
Palette rows own the jump and pin keys and keyboard highlight scrolls
into view; connection changes re-place the Working shelf; undo steps go
through their actions' claim invalidation; the sidebar clock ticks per
second only while a live duration is drawn and the sidebar shows;
streaming-only shell ticks skip the sidebar rebuild; id ties use W4's
localeCompare; menus, dialogs, the palette and toasts paint backdrop
blur under their glass; Escape and arrows yield to IME composition; and
menu capabilities come from one ThreadCapabilities seam.
…fig drives overrides

chat.new, modelPicker.toggle, composer.effort and composer.mode bind
through the keymap to W2's actions, so their when clauses live in one
place, and W2's direct bindings are removed. The server config's
keybindings install as user overrides (dropped bindings are shadowed by a
propagating no-op), and its threadAutoSettleOptOut capability shows the
Auto-settle menu.
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