GeezerVison is showing github.com — fix(web): the Files tree remembers expanded folders by fixfon · Pull Request #18211 · pingdotgg/t3code
Conversation
fixfon
commented
Oct 11, 2026
•
edited by juliusmarminge
Loading
Uh oh!
There was an error while loading. Please reload this page.
The Files tree forgets expanded folders when its panel remounts or the app reloads. This remembers expansion per environment and workspace, restores folders as their listings arrive, and keeps a user’s collapse when a file preview remains open. Missing folders are removed only after their parent lists successfully. Storage failures leave the tree usable, and saved preferences are capped at 500 paths.
Fresh file opens and tab switches still reveal the active file. A retained selection does not reopen a collapsed folder after an explorer remount. Deep search results finish loading their ancestors, and expansion reconciliation and storage writes are coalesced during bulk toggles.
Maintainer takeover of @fixfon’s #18211, preserving the original commits and merging main. Refs #12041; mobile remains outside this PR’s scope.
Publication status: current-head CI jobs that ran passed; the cancelled duplicate native fingerprint job has a successful replacement. CodeRabbit completed with no actionable findings and Macroscope correctness passed. Macroscope approvability is neutral / Needs Human Approval because the persisted, asynchronous Files-tree behavior spans components. Human approval remains outstanding; this PR is unmerged.
Validation on the rebuilt head:
- 107 focused tests pass: 7 expansion, 10 mounted Files panel, 3 path reconciliation, and 87 right-panel store tests. The original standalone storage tests were consolidated into existing suites; expansion and panel coverage changed from 14 to 17 tests. Regression checks failed before their fixes, including retained-selection collapse, acknowledged tab selection, and deferred deep search loading interrupted by a remount.
- Scoped lint, formatting, web TypeScript, and diff checks pass.
- A mounted 500-folder Pierre probe restored in one reconciliation with zero storage writes. Expand all and collapse all each used one reconciliation and one storage write. These are operation counts, not frame-time guarantees.
- Live Linux web client with real filesystem listings: reopen Files, reload, switch workspaces, preserve a collapse with a selected file, and switch acknowledged file tabs. Matched images below use pinned main and the rebuilt head with the same fixture and viewport.
- Independent full-diff reviews: five rounds; final Opus and Sol reviews found no confirmed defects or blockers. Earlier findings about late restoration, repeated scans/writes, retained selection, tab selection, and deep search were fixed.
Before — reopening Files loses expansion:

After — reopening Files retains both folder levels:

Reopen, reload, and workspace-isolation recording · Tab selection and retained-collapse recording · Retained selection and collapsed-parent remount recording
Verification limits: delayed listings, pruning, malformed or unavailable storage, and environment-key isolation were covered in focused tests rather than by inducing those failures on a remote server. Electron, macOS, Windows, iOS, and Android were not run. Web and desktop share the changed tree; no mobile behavior is claimed. The interrupted deep-search/remount regression uses the real directory hook with deferred query responses; natural remote latency was not exercised. Multiple windows retain last-writer-wins preferences, and workspace keys are not evicted.
Implemented in T3 Code with the Codex harness: GPT-6.1-Sol implementation and GPT-6-Astra tests. Independent reviews used Claude Opus 5.5 and GPT-6-Sol.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Approvability
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — This introduces a substantial user-facing Files-tree behavior change involving localStorage persistence, asynchronous parent/child restoration, and persisted reveal state across multiple components. Although focused tests cover key lifecycle and storage cases, the cross-component statefulness and remount behavior warrant human review.
You can add or adjust custom eligibility rules. Learn more.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Oct 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8fafaf68-71d5-4692-b769-05c2338cc2ba
📥 Commits
-
Reviewing files that changed from the base of the PR and between 74f3bf5 and 2fcd03e.
📒 Files selected for processing: 7
-
apps/web/src/components/chat/RightPanelSurfaceContent.tsx
apps/web/src/components/files/FileBrowserPanel.browser.test.tsx
apps/web/src/components/files/FileBrowserPanel.tsx
apps/web/src/components/files/FilePreviewPanel.tsx
apps/web/src/components/files/fileTreeExpansion.test.ts
apps/web/src/components/files/fileTreeExpansion.ts
apps/web/src/rightPanelStore.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
📝 Walkthrough
-
The file browser now saves and restores expanded directories by environment and working directory. File-surface reveal requests carry handled state through the preview to the browser, which acknowledges reveals and retries when a selected entry is not yet available.
Changes: File explorer state
| Layer / File(s) |
Summary |
Expansion storage and restoration apps/web/src/components/files/fileTreeExpansion.ts, apps/web/src/components/files/useDirectoryEntries.ts, apps/web/src/components/files/FileBrowserPanel.tsx, apps/web/src/components/files/fileTreeExpansion.test.ts, apps/web/src/components/files/FileBrowserPanel.browser.test.tsx |
The file browser reads and writes expanded paths scoped to an environment and working directory. It reconciles saved paths with loaded directories, restores nested expansions as listings arrive, and tests persistence, pruning, storage failures, and remount behavior. |
Selection reveal acknowledgement apps/web/src/rightPanelStore.ts, apps/web/src/components/chat/RightPanelSurfaceContent.tsx, apps/web/src/components/files/FilePreviewPanel.tsx, apps/web/src/components/files/FileBrowserPanel.tsx, apps/web/src/components/files/FileBrowserPanel.browser.test.tsx |
File surfaces now store whether a reveal request was handled. The preview passes this state to the browser, which acknowledges completed reveals, retries missing selections, and preserves search during retained previews. Browser tests cover surface changes, pending directory listings, and remounts. |
Priority: ⬇️ Low
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant RightPanelSurfaceContent
participant FilePreviewPanel
participant FileBrowserPanel
participant rightPanelStore
RightPanelSurfaceContent->>FilePreviewPanel: Pass reveal-handled state and callback
FilePreviewPanel->>FileBrowserPanel: Pass selected-path reveal state and callback
FileBrowserPanel->>RightPanelSurfaceContent: Acknowledge the reveal request
RightPanelSurfaceContent->>rightPanelStore: Mark matching file surface request handled
Loading
Suggested reviewers: juliusmarminge
Merge Risk: ⚪ Minimal · up to 2fcd0
-
The change remembers expanded folders in the Files tree and tracks reveal handling. No concrete merge-blocking risk was found.
Security architecture risk: 🔵 Low · up to 2fcd0
-
The change is primarily browser-state persistence. Restoring folders reuses directory listing in the current environment and workspace rather than granting new file access. Remaining uncertainty concerns workspace identity changes and shared-browser state, not a demonstrated authorization bypass.
Retained concerns
No architecture-level concerns identified.
Security review details
-
Security Blast Radius
- observed — Restoration can automatically trigger directory listings, but persisted strings do not select an environment connection. Expanded current tree rows call the existing loader, which supplies the panel's current environmentId and cwd to projectEnvironment.listEntries.
Trust Boundaries and Controls
- observed — Reveal acknowledgement is scoped to a thread, path-derived file surface, and matching request ID. Missing, superseded, and already-handled requests leave state unchanged. The browser acknowledges only after the selected path exists in directory listings, not merely in provisional search results.
Resilience and Maintainability Implications
- observed — The reused listing loader deduplicates requests and limits execution to four concurrent requests per hook instance. Completion handlers avoid publishing results after unmount, while ancestor loading observes an abort signal. These controls contain restoration work without establishing cancellation of already-running server requests.
Hardening Proposals
- proposed — Use an unambiguous tuple encoding for the persisted environment/cwd key. The current delimiter concatenation can alias delimiter-bearing identities permitted by the identifier schema. This is namespace hardening; inspected listing calls still use the current panel's environment and cwd, so it is not a demonstrated cross-environment access path.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title clearly identifies the main change: preserving expanded folders in the Files tree. |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
| Description check |
 |
The description is complete and directly addresses the problem, implementation, scope, approval status, verification results, limitations, UI evidence, and agent usage. It does not use the template he… |
Full details: Description check
-
Explanation
The description is complete and directly addresses the problem, implementation, scope, approval status, verification results, limitations, UI evidence, and agent usage. It does not use the template headings, and it does not include a direct link to an explicit maintainer approval comment, but the required information is present and the description is otherwise detailed and relevant.
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The Files panel unmounts with its right-panel tab and on thread switch or
reload, and its expansion lived only in memory, so every remount collapsed
the tree. Persist the expanded folders per environment and workspace in
localStorage and restore them parent-before-child as each folder is listed.
Refs pingdotgg#12041
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
Taking over this one as maintainer for batch web-misc-06. I’ll preserve your commits, consolidate the tests, and verify folder restoration and workspace isolation in the running client. Credit to @fixfon for the fix. Mobile remains out of scope. No merge planned.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Acknowledge explorer reveals on the persisted file surface so retained selections do not reopen collapsed folders. Fresh file opens reset the acknowledgment. Coalesce tree reconciliation and storage writes, flushing pending toggles during cleanup.
Note 🤖 Claude Opus 5.5 responding on behalf of Theo
Closing. This PR conflicts with main in 5 files, which is more than we will review as a rebase. If the change still matters, open a fresh PR from current main.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 20, 2026
Uh oh!
There was an error while loading. Please reload this page.
Labels
macroscope-review
Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews
pr:needs-julius
Needs Julius: route gate, unverifiable surface, or blocked
size:L
100-499 changed lines (additions + deletions).
vouch:unvouched
Author is not yet trusted in the VOUCHED list.
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|