GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(web): the Files tree remembers expanded folders by fixfon · Pull Request #18211 · pingdotgg/t3code

Conversation

@fixfon

@fixfon fixfon commented Oct 11, 2026 •
edited by juliusmarminge
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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:

Before: Files reopens with src collapsed

After — reopening Files retains both folder levels:

After: Files restores src and nested with save.txt visible

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.

All reactions
@fixfon fixfon mentioned this pull request Oct 11, 2026
[Bug]: Files tree forgets which folders were expanded on every remount #12041
Closed
2 tasks done
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Oct 11, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the macroscope-review Opt PRs made by unvouched contributors in for Macroscope review. Vouched contributors auto-reviews label Oct 11, 2026 — with ChatGPT Codex Connector
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review in Change Stack →

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: Passed 4
Check name Status Explanation
Title check Passed The title clearly identifies the main change: preserving expanded folders in the Files tree.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed 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)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot approved these changes Oct 11, 2026
View reviewed changes
@saphid saphid mentioned this pull request Oct 12, 2026
perf(web): coalesce overlapping file tree refreshes #18421
Merged
@fixfon
fixfon force-pushed the fix/files-tree-remember-expanded branch from a8cfb59 to 0d53b9c Compare October 14, 2026 08:22
@fixfon @claude
fix(web): the Files tree remembers expanded folders
74f3bf5
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]>
@fixfon
fixfon force-pushed the fix/files-tree-remember-expanded branch from 0d53b9c to 74f3bf5 Compare October 17, 2026 10:53
@juliusmarminge juliusmarminge mentioned this pull request Oct 18, 2026
[Bug]: "Expand all folders" in Files walks the whole workspace, node_modules included, and keeps the app busy for minutes #21246
Closed
2 tasks done
@juliusmarminge juliusmarminge self-assigned this Oct 19, 2026
@juliusmarminge

juliusmarminge commented Oct 19, 2026

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

juliusmarminge added 11 commits October 19, 2026 17:19
@juliusmarminge
Merge remote-tracking branch 'origin/main' into fix/files-tree-rememb…
96dbc2a
…er-expanded
@juliusmarminge
test(web): cover remembered file tree expansion
a13a017
@juliusmarminge
fix(web): keep collapsed folders closed during restoration
b9d1bc4
@juliusmarminge
test(web): cover retained file selection across explorer remounts
9af9dcc
@juliusmarminge
fix(web): preserve collapsed folders across explorer remounts
a9c8803
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.
@juliusmarminge
test(web): cover file tree search loading and tab selection regressions
8c81af2
@juliusmarminge
fix(web): keep file reveals active after acknowledgement
ae67dac
@juliusmarminge
test(web): cover retained file selection after remount
bb1ce66
@juliusmarminge
fix(web): restore retained file selection after remount
6264eae
@juliusmarminge
test(web): reproduce deep file reveal loss after explorer remount
64e28e2
@juliusmarminge
fix(web): defer file reveal acknowledgment until listings arrive
2fcd03e
@juliusmarminge juliusmarminge added the pr:needs-julius Needs Julius: route gate, unverifiable surface, or blocked label Oct 22, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Oct 31, 2026
refactor(web): open the Files side panel through the panel host #16043
Closed
@Pyseph Pyseph mentioned this pull request Nov 5, 2026
perf(web): Expand all in the Files panel no longer rescans every folder for each expansion #31463
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Nov 12, 2026
fix(web): Files tree keeps expanded folders across remounts #35067
Merged
@t3dotgg

t3dotgg commented Nov 12, 2026

Copy link
Copy Markdown
Member

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@t3dotgg t3dotgg closed this Nov 12, 2026
This was referenced Nov 20, 2026
fix(web): keep revealed folder in view while restored folders load #39470
Merged
perf(web): Files panel Refresh reads only the folders on screen #42870
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@juliusmarminge juliusmarminge

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.

Projects

None yet

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.

3 participants

@fixfon @juliusmarminge @t3dotgg
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.