Skip to content

fix(sidebar): don't render a folder twice when toggled while loading - #3002

Merged
bajrangCoder merged 3 commits into
mainfrom
fix/file-tree-duplicate-render
Oct 29, 2026
Merged

bajrangCoder merged 3 commits into
mainfrom
fix/file-tree-duplicate-render

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

Fixes a folder in the sidebar file tree showing its contents twice when it is collapsed and expanded again before its listing finishes loading (happens intermittently, e.g. tapping a folder header quickly or on slow storage).

Collapsing and re-expanding a folder before its listing finished let the
old load render alongside the new one. Stale loads now skip rendering,
and a new expand or collapse cancels a tree that is still loading.
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous test setup issue is fixed.

Summary

Prevents duplicate sidebar contents when a folder is toggled while its directory read is pending.

  • A collapsed folder ignores replies from its old tree.
  • A root folder keeps its newest read in charge.
  • File tiles keep their icon element and styling.

Reviews (3) · Last reviewed commit: "test(sidebar): stub global tag in root f..." · Reviewed by Greptile

Comment thread tests/unit/fileTreeRecycling.test.ts Resolved
Drive a real root folder through expand, collapse and expand with the
directory reads still pending, resolving them in both orders and failing
the stale one, and check that only the latest tree renders, a stale error
doesn't collapse the folder and the loading bar follows the latest read.
openFolder's single JSX expression becomes a tag() call so the module can
load in tests.
@bajrangCoder

This comment was marked as outdated.

Comment thread tests/unit/openFolderExpand.test.ts Resolved
@bajrangCoder

This comment was marked as outdated.

@bajrangCoder
bajrangCoder added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 9960e6e Oct 29, 2026
11 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Oct 29, 2026
@bajrangCoder
bajrangCoder deleted the fix/file-tree-duplicate-render branch October 29, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant