Repository navigation
Cap open storage folders and keep folder state stable - #5155
Conversation
- Sort tree names with one shared collator instead of one per comparison. - Open and close merged folder chains together so a folder stays open when a new file splits the chain. - Reset open folders when the thread changes. - Cap each open folder at five children with its own "N more" row, and expand the top-level list when the last selected file sits behind it. - Use directoryFromPath for changed-file folder hints. 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: d545579793
ℹ️ 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".
| if (revealIndex !== revealedIndex) { | ||
| setRevealedIndex(revealIndex); | ||
| if (revealIndex !== null && revealIndex >= limit) setIsExpanded(true); |
There was a problem hiding this comment.
Reset automatic list expansion when changing threads
When thread A selects a storage file past the top-level limit, this permanently sets isExpanded to true. Navigating to thread B can change revealIndex to null, but nothing collapses the same InfoList instance, so a second thread with many root entries displays everything and leaks thread A's visibility state. Reset or scope the expansion state to the storage/thread context while preserving manual toggles within one thread.
Useful? React with 👍 / 👎.
Human comments
What was wrong
The Slop Cop review of #5144 left five P2 follow-ups in the thread storage tree.
localeCompareand options, which builds a new collator on every comparison.qa/screenshots) remembered only its deepest path. When an agent wrote a file that split the chain, the open folder closed on its own.directoryFromPathfrom@bb/thread-view.What changed
thread-storage-tree.tssorts with one module-levelIntl.Collator. Folder nodes carrychainPaths. Flattening caps each open folder's children at five and adds a "N more" row for that folder.useThreadStorageBrowser:threadIdchangesInfoListtakes arevealIndexand expands when that index is behind "N more". Its "N more" row is nowInfoListMoreRow, which the tree reuses at depth.ChangesSectionusesdirectoryFromPath. The localgetParentFolderPathFromPathis 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, andplan.mdandsummary.mdbehind the top-level "N more".Before:
89f40e7(main) · After:d545579(PR head) · Captured at 2×deep/nestedopened, thendeep/top.mdwrittenlogsopened, switched to another thread and backEnd-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:
chainPathsInfoListrevealIndexThe 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
BB-Thread-ID: thr_pkx7jnw5gf
🤖 Generated with Claude Code