Skip to content

feat(spaces): drive the sidebar list from the search box - #3864

Merged
trunk-io[bot] merged 8 commits into
mainfrom
code-spaces-layout-nav-search
Jul 28, 2026
Merged

feat(spaces): drive the sidebar list from the search box#3864
trunk-io[bot] merged 8 commits into
mainfrom
code-spaces-layout-nav-search

Conversation

@adamleithp

@adamleithp adamleithp commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Stacked on #3815.

The spaces list was a plain tree with a filter box bolted on: the only way to reach a row was the mouse, and the box couldn't be cleared without one either.

2026-07-28 11 53 51

What changes

Every row is now an Autocomplete option — filtered or not — so ↑/↓/⏎ work the moment the pane opens rather than only once you've typed something. Rows keep their hover menus, context menu and dialogs: SpaceRowSurface renders quill's Button off the layout and an AutocompleteItem on it, so only the click and highlight routing changes.

Returning from a space focuses the search box, selects any stale query, and reopens the list at the top. Escape clears the query, and the clear button gets a real tab stop.

All of it is behind code-spaces-layout; off the flag the list is the tree it was.

The non-obvious pieces

  • items carries the row values in DOM order even though the rows render as elements. Without it the highlight has no list to index into, and the first ArrowDown after a keystroke is swallowed re-establishing the highlight it already shows.
  • open, not defaultOpen. Picking a row closes an ordinary combobox, and a closed one stops answering the arrow keys — so coming back from a space found the list dead.
  • keepHighlight. Base UI resets the highlight on pointer-leave (resetOnPointerLeave: !keepHighlight) and autoHighlight="always" re-seeds it at the top, so drifting the mouse across the gap between two rows threw the keyboard back to #me.
  • Collapsed groups unmount under the layout. A kept-mounted collapsed row is still an option, and the arrows would walk onto spaces that were folded away. Trade-off: expanding a group rebuilds its rows' menus, the cost the keepMounted comment was avoiding.
  • quill sizes its list as a popup (a ~250px cap plus its own padding) and ships it unlayered, so the overrides that make the list fill the pane have to be !important to outrank it.
  • Home is how the highlight is reset. Autocomplete leaves it on the row you opened and exposes no way to move it, so the pane would otherwise come back mid-list.

Testing

11 new tests in ChannelsList.test.tsx (19 total); 374 pass across canvas + sidebar. The pointer-leave test was checked to fail with keepHighlight removed.

Manually, with the flag on:

  1. Arrow to a row, sweep the mouse across the gaps — highlight stays put.
  2. Open a space, come back — caret in the box, stale query selected, highlight at the top, arrows live.
  3. Type a query, ↓ once — lands on the second match.
  4. Tab → clear button, ⏎ clears. Escape clears from the input. Escape on an empty box still reaches whatever owns it.
  5. Right-click a row, hover "+"/"…" — menus work in the tree and in search results.
  6. Flag off — plain tree, no search box, collapse still kept-mounted.

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 1eaa4f9.

@adamleithp adamleithp added the Stamphog This will request an autostamp by stamphog on small changes label Jul 28, 2026
puemos added 5 commits July 28, 2026 12:39
Replace the flag-gated task thread with Timeline, Artifacts, and Comments views. Include multi-run artifacts and selected historical pull request review while leaving flag-off behavior unchanged.

Generated-By: PostHog Code
Task-Id: 6190e713-9b80-43d9-a05c-5e3b1ecdf297
The Activity panel's header was padding-sized (~41px) while the pane to its
left — TabbedPanel's tab bar — is a fixed 32px row, so the two bottom borders
never lined up. The panel also stacked a title row on top of a tabs row where
the left pane has a single strip.

Give ActivityPanel its own 32px header carrying the tabs directly: no separate
"Activity" title row, the tab list fills the row so the line indicator lands on
the bottom border, and the window controls sit right-aligned. Matches
TabbedPanel and ReviewToolbar, which share the same height and border token.

The shared ThreadPanelHeader is now the legacy panel's alone, so it stays
exactly as it was — flag-off chrome is unchanged.

Generated-By: PostHog Code
Task-Id: 8ccf3555-2c68-4dbb-8b9f-1a96fd85d95a
Starring a channel is already reachable from the sidebar back row's hover star
and the channel list's context menu, so the header's copy was a third
affordance for the same action sitting next to the channel name chip.

Generated-By: PostHog Code
Task-Id: 8ccf3555-2c68-4dbb-8b9f-1a96fd85d95a
The pane read the run artifact manifest and then dropped everything on
`type === "plan"` — a type nothing in the product has ever written. The
only deliverable type agents actually produce is `output`, via the
`upload_artifact` tool, so the manifest branch was unreachable and files
handed back by a run never appeared.

Verified against a live run's manifest: 6 `output`, 2 `user_attachment`,
zero `plan`. The `plan` row was speculative — down to a bare-UUID
fallback for names that never arrive — so it goes rather than shipping a
UI affordance for data that doesn't exist. It can come back with a
producer.

Same inversion is why the conversation's Files box showed these while
the pane said "No artifacts yet": it filters to `output`, the exact
complement.

- `parseRunPlans` becomes `parseRunArtifacts(raw, types)`, and reads the
  `size`/`content_type`/`uploaded_at` the rows need.
- Re-uploads collapse to the newest per name: agents revise a
  deliverable and upload it again, and keeping every copy buries the
  current one under its own drafts.
- `formatFileSize` moves out of CloudArtifactDownloads so both surfaces
  format sizes the same way.

Generated-By: PostHog Code
Task-Id: 8d187d00-0633-4706-8443-f79130b65f9f
The rows already use the same FileIcon the chat's file list does, so
markdown resolves to the markdown icon and HTML to the HTML one. Lock
that in — the row it replaced hardcoded a single clipboard glyph, and
nothing else would catch a regression back to a generic icon.

Generated-By: PostHog Code
Task-Id: 8d187d00-0633-4706-8443-f79130b65f9f
@puemos
puemos force-pushed the posthog-code/channels-stack-4-activity-view branch from 5048498 to 1dbd099 Compare July 28, 2026 10:39
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(spaces): drive the sidebar list fro..." | Re-trigger Greptile

@stamphog

stamphog Bot commented Jul 28, 2026

Copy link
Copy Markdown

Note

🤖 stamphog reviewed f184b84aa1c7f4f5a907d40f8c2e91b685c2d6c1 — verdict: REFUSED

Gates denied the PR outright due to unresolved merge conflicts, a deny-listed auth file match, and size far over the auto-review ceiling; none of these can be waived by review judgment.

  • 👍 on the PR from greptile-apps[bot].
  • Gates denied: merge conflicts present, deny-list match on auth-related files, and PR far exceeds size ceiling (7063 lines/108 files vs 1200 line limit)
  • Touches auth-related files (auth-side-effects.ts) without independent assurance beyond a passive bot reaction
Gate mechanics and policy version
Gate Result
prerequisites merge conflicts present
deny-list matches: auth
size too large for auto-review (4850L, 84F substantive, 7063L/108F incl. docs/generated/snapshots — ceiling is 1200L)
tier classified as T2-never: T2-never (7063L, 108F, two-areas, feat)
stamphog 2.0.0b3 .stamphog/policy.yml @ 542eee4 · reviewed head f184b84

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 28, 2026
@posthog

posthog Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

👋 Visual changes detected for this PR.

Review and approve in PostHog Visual Review

If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix.

@adamleithp adamleithp added the Stamphog This will request an autostamp by stamphog on small changes label Jul 28, 2026
adamleithp and others added 2 commits July 28, 2026 11:50
The spaces list was a plain tree with a filter box bolted on: the only
way to reach a row was the mouse, and the box could not be cleared
without one either.

Every row is now an Autocomplete option, filtered or not, so the arrows
and Enter work the moment the pane opens rather than only once you have
typed something. Rows keep their hover menus, context menu and dialogs —
SpaceRowSurface renders quill's Button off the layout and an
AutocompleteItem on it, so only the click and highlight routing changes.

Notes on the pieces that are not obvious:

- `items` carries the row values in DOM order even though the rows
  render as elements. Without it the highlight has no list to index
  into, and the first ArrowDown after a keystroke is swallowed
  re-establishing the highlight it is already showing.
- `open` rather than `defaultOpen`: picking a row closes an ordinary
  combobox, and a closed one stops answering the arrow keys, so coming
  back from a space found the list dead.
- `keepHighlight`: Base UI resets the highlight on pointer-leave and
  `autoHighlight="always"` re-seeds it at the top, so drifting the mouse
  across the gap between two rows threw the keyboard back to #me.
- Collapsed groups unmount under the layout. A kept-mounted collapsed
  row is still an option, and the arrows would walk onto spaces that
  were folded away.
- quill sizes its list as a popup (a ~250px cap, its own padding) and
  ships it unlayered, so the overrides that make the list fill the pane
  have to be important to outrank it.

Returning from a space focuses the box, selects any stale query, and
sends Home so the list reopens at the top — Autocomplete otherwise
leaves the highlight on the row you opened and exposes no way to move
it. Escape clears the query and the clear button gets a real tab stop;
Base UI's is a tabIndex=-1 decoration.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The channel pane's placeholder rows were fixed-height pills that sat at
their own scale rather than the rows' — a stack of near-white bars that
didn't read as the list they become.

SkeletonText sizes its bar off the line it stands in, so giving each row
the type scale of the title it replaces (and the label bar the scale of
the MenuLabel above it) makes the placeholder the shape of the content.
Row widths move from Tailwind fractions to the percentages the primitive
takes. The item glyph stays a plain Skeleton: it is a square, not text.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@adamleithp
adamleithp force-pushed the code-spaces-layout-nav-search branch from 53629f2 to c7ca956 Compare July 28, 2026 10:51

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contained, flag-gated UI refactor of the sidebar/search component in packages/ui — no touch of data models, APIs, auth, billing, deps, or CI, so it's outside risky territory and my own reading of the diff (plus the added test coverage) suffices without requiring independent assurance.

  • Author wrote 15% of the modified lines and has 16 merged PRs in these paths (familiarity MODERATE).
  • 👍 on the PR from greptile-apps[bot].
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 527L, 2F substantive, 722L/3F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1d-complex (722L, 3F, single-area, feat)
stamphog 2.0.0b3 .stamphog/policy.yml @ 542eee4 · reviewed head c7ca956

Base automatically changed from posthog-code/channels-stack-4-activity-view to main July 28, 2026 10:56
@trunk-io

trunk-io Bot commented Jul 28, 2026

Copy link
Copy Markdown

😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details.

@adamleithp
adamleithp enabled auto-merge (squash) July 28, 2026 11:20
@stamphog

stamphog Bot commented Jul 28, 2026

Copy link
Copy Markdown

Retaining stamphog approval — delta since last review classified as merge_only.

@trunk-io
trunk-io Bot merged commit 9ddb5f3 into main Jul 28, 2026
32 checks passed
@trunk-io
trunk-io Bot deleted the code-spaces-layout-nav-search branch July 28, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants