Repository navigation
Show thread storage as a folder tree in the Info panel - #5144
Conversation
Folders nest in the shared Info list rows with carets and indent guides, single-folder chains join into one row, and search expands matches. Info rows no longer highlight on hover, and changed-file line counts appear only while the size squares are hovered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clickable rows show a pointer cursor now that hover backgrounds are gone, clicking a changed file's size squares opens its diff again, keyboard focus on a changed-file row reveals its line counts, and selecting a stored file opens the folders above it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The hint truncates from the start so the nearest folder stays visible, and row names keep their width while the hint gives way. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
TruncateStart now anchors both ends of its text so trailing punctuation stays at the end inside its right-to-left truncation box. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Row names shrink again so rows with two actions keep them clear of the timestamp, with folder hints yielding first via a high flex-shrink. Storage search flattens matches before the shared list cap, so large result sets show five rows and "N more" as on main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e61dba924f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return { | ||
| kind: "folder", | ||
| path: current.path, | ||
| name, |
There was a problem hiding this comment.
Keep merged folder identities stable
When an expanded chain such as qa/shots/* later gains a sibling like qa/summary.md, the merged node's identity changes from qa/shots to qa. Since expandedFolders still contains only qa/shots, the realtime inventory update unexpectedly collapses the entire branch. Use the chain's stable outer path as the expansion identity, or migrate expansion state when the tree shape changes.
Useful? React with 👍 / 👎.
| <InfoList | ||
| items={filteredFiles} | ||
| getKey={(file) => file.path} | ||
| renderItem={(file) => ( | ||
| <InfoListRow | ||
| leading={ | ||
| <Icon | ||
| name={resolveRightPanelFileIconName(file.path)} | ||
| className="size-3 text-subtle-foreground" | ||
| aria-hidden | ||
| /> | ||
| } | ||
| name={getFileNameFromPath({ path: file.path })} | ||
| context={getParentFolderNameFromPath({ path: file.path })} | ||
| title={`Open ${file.path}`} | ||
| selected={selectedPath === file.path} | ||
| target={{ kind: "button", onSelect: () => selectPath(file.path) }} | ||
| actions={[ | ||
| { | ||
| icon: "ExternalLink", | ||
| label: "Open in tab", | ||
| onSelect: () => selectPath(file.path), | ||
| }, | ||
| ]} | ||
| /> | ||
| )} | ||
| items={tree} | ||
| getKey={(node) => node.path} | ||
| renderItem={(node) => | ||
| flattenThreadStorageNode(node, isFolderExpanded).map(renderRow) |
There was a problem hiding this comment.
Apply the row limit to flattened visible nodes
When many files share one top-level folder, items has length one, so InfoList never enables its limit; expanding that folder immediately renders every descendant, potentially all 1,000 files returned by the storage query. This removes the previous five-row overflow gate and can make the panel extremely long and expensive to render. Limit the flattened visible rows rather than only the root nodes.
Useful? React with 👍 / 👎.
| const [expandedFolders, setExpandedFolders] = useState<ReadonlySet<string>>( | ||
| () => new Set(selectedPath ? threadStorageAncestorPaths(selectedPath) : []), | ||
| ); | ||
| const [revealedPath, setRevealedPath] = useState(selectedPath); |
There was a problem hiding this comment.
Reset folder expansion when switching threads
When the mounted thread-detail view navigates from one thread to another, this state is retained because the hook has no thread-scoped reset. Any matching folder paths in the new thread therefore start expanded instead of honoring the documented collapsed-by-default behavior, and the set accumulates paths across navigation. Scope the state to the thread ID or reset it when the thread changes.
Useful? React with 👍 / 👎.
…iant Co-Authored-By: Claude Opus 5.5 <[email protected]>
## Human comments ## What was wrong The Slop Cop review of #5144 left five P2 follow-ups in the thread storage tree. - **Slow sort:** the tree sorted names with `localeCompare` and options, which builds a new collator on every comparison. - **Merged folders closing:** a merged single-child folder (`qa/screenshots`) remembered only its deepest path. When an agent wrote a file that split the chain, the open folder closed on its own. - **State leaking between threads:** the open-folder state lived on the thread view instance, so it carried over between threads. - **Uncapped overflow:** the "N more" cap counted only top-level entries. An opened folder rendered every child, and a selected file behind the top-level "N more" stayed hidden even though its folders opened. - **Duplicate helper:** the changed-file folder hint used a local parent-path helper that duplicated `directoryFromPath` from `@bb/thread-view`. ## What changed - `thread-storage-tree.ts` sorts with one module-level `Intl.Collator`. Folder nodes carry `chainPaths`. Flattening caps each open folder's children at five and adds a "N more" row for that folder. - `useThreadStorageBrowser`: - opens and closes a whole merged chain together - tracks folders that show all their children - remembers the last selected file - resets folder state when `threadId` changes - `InfoList` takes a `revealIndex` and expands when that index is behind "N more". Its "N more" row is now `InfoListMoreRow`, which the tree reuses at depth. - `ChangesSection` uses `directoryFromPath`. The local `getParentFolderPathFromPath` is removed. No API, CLI, SDK, persisted data or wire changes. ## How you verified The screenshots come from the branch web app at 2×, in headless Chrome for Testing through the Browser Automation plugin. Both sides use the same fixture thread: 24 storage files, including a `logs/` folder with 10 files, and `plan.md` and `summary.md` behind the top-level "N more". Before: `89f40e7` (main) · After: `d545579` (PR head) · Captured at 2× | Screen / state | Viewport | Before | After | | --- | --- | --- | --- | | Thread storage / 10-file folder opened | Desktop · 1440×1800 |  |  | | Thread storage / folder "N more" clicked (main has no per-folder cap) | Desktop · 1440×1800 |  |  | | Thread storage / merged `deep/nested` opened, then `deep/top.md` written | Desktop · 1440×1800 |  |  | | Thread storage / `logs` opened, switched to another thread and back | Desktop · 1440×1800 |  |  | | Thread storage / after opening summary.md from its tab | Desktop · 1440×1800 |  |  | | Thread storage / 10-file folder opened | Mobile · 390×844 |  |  | **End-to-end QA** on `d545579` (headless Chrome for Testing 154 through the Browser Automation plugin) passed. It covered the folder cap and its "N more", a merged folder splitting while the panel was open, switching threads without a reload, and the console, which had no errors. **Unit tests:** - per-folder cap, and the case where only one child would be hidden - `chainPaths` - opening and closing a merged chain together - resetting folder state on thread change - remembering the last selected file - `InfoList` `revealIndex` The existing ordering tests cover the collator. Remote CI runs on the PR. Tests, typecheck and lint were not run locally. Follow-up to #5144. BB-Thread: [Thread storage viz design](https://brsbl.getbb.app/projects/proj_khiw2za95v/threads/thr_pkx7jnw5gf) BB-Thread-ID: thr_pkx7jnw5gf > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
## Human comments ## What was wrong Changed-file rows show the file's full folder path as a hint. When the panel had room, a deeply nested file's hint ran most of the row's width (`…s/design-system/src/components/navigation/sidebar/`) while the other hints stayed short (`src/`, `docs/`). The one long hint broke the list's rhythm. ## What changed The Info row folder hint is capped at `max-w-44` (11rem). Long paths still truncate from the left, so the nearest folders stay visible. Plugin names three or four folders above a file stay readable (`plugins/navigation/app/ui/`, `…/provider-claude-code/src/bridge/`). Short hints don't change, and the full path stays in the row's tooltip. Widths were compared on real bb paths. At 7rem every plugin name was cut, and at 9rem `provider-claude-code` was still cut. At 13rem, long `apps/` and `packages/` hints began to sprawl across the row again. Narrow panels already truncated the hint below this width, so phone-width layouts look the same. ## How you verified Captured from the branch web app at 2× in headless Chrome for Testing through the Browser Automation plugin. Both captures use the same fixture thread. Its uncommitted files use real bb paths from `plugins/`, `apps/app/src/` and `packages/shared-ui/`. Before: `d18f6f2` (main) · After: `78cb136` (PR head) · Captured at 2× | Screen / state | Viewport | Before | After | | --- | --- | --- | --- | | Uncommitted files / bb paths, list expanded | Desktop · 1440×1800 |  |  | Remote CI runs on the PR. Tests, typecheck and lint were not run locally. Follow-up to #5144. BB-Thread: [Thread storage viz design](https://brsbl.getbb.app/projects/proj_khiw2za95v/threads/thr_pkx7jnw5gf) BB-Thread-ID: thr_pkx7jnw5gf > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Human comments
What was wrong
#4898 replaced the thread storage file tree with a flat list. Files in nested folders lost their structure and showed only the last folder name as a hint. The Info panel rows also highlighted on every hover, and the changed-file line counts appeared whenever the pointer crossed a row. That made the panel busy to move through.
What changed
Thread storage tree
@pierre/trees.qa/screenshots).Info rows
bg-state-hover) instead of a ring.Changed files
src/feature/). It is truncated from the left, so the nearest folder stays visible, and it gives way before the file name.Panel
Shared code
TruncateStartadds a trailing direction mark, so trailing punctuation stays at the end.No API, CLI, SDK, persisted data or wire changes.
How you verified
Screenshots come from the branch web app in headless Chrome for Testing through the Browser Automation plugin, at 2×. Both revisions use the same seeded fixture threads:
Before:
54a4a22(merge base) · After:e61dba9, except the properties-only row at652e555(PR head). The only commit aftere61dba9changes the keyboard-focus reveal of line counts, which none of these states show. Captured at 2×.Slop Cop (one cumulative review of all five panels, at
d1b5033):7a74b10:directoryFromPathManual QA: signed off by the user.
Tests: new unit tests cover tree building, folder merging, ordering, ancestor paths, and opening the folders above a selected file. Remote CI runs on the PR. Tests, typecheck and lint were not run locally.
BB-Thread: Thread storage viz design
BB-Thread-ID: thr_pkx7jnw5gf
🤖 Generated with Claude Code