Skip to content

fix(clients): refresh project folders when reopened - #5367

Open
Zeus-Deus wants to merge 1 commit into
pingdotgg:mainfrom
Zeus-Deus:t3code/fix-project-refresh-after-clone
Open

fix(clients): refresh project folders when reopened#5367
Zeus-Deus wants to merge 1 commit into
pingdotgg:mainfrom
Zeus-Deus:t3code/fix-project-refresh-after-clone

Conversation

@Zeus-Deus

@Zeus-Deus Zeus-Deus commented Aug 4, 2026

Copy link
Copy Markdown

Problem

The Add Project folder browser retained directory results for 30 seconds. If a user closed the picker, cloned a repository in a terminal, and reopened the picker during that window, the new folder was missing until the cache expired or T3 Code restarted.

Fix

  • Add an opt-in forced refresh to retained atom queries.
  • Force filesystem browse preloads to reread the directory when web/desktop opens or navigates the Add Project picker.
  • Refresh completed cached listings when the mobile folder browser remounts, while leaving initial and already-revalidating requests alone.
  • Preserve the existing short cache for rendering and back-navigation performance.

Before / after

Both captures reopen the picker within the old 30-second freshness window after a real external git clone.

Before: cloned folder is missing After: cloned folder appears immediately
Before: reopened picker omits the externally cloned folder After: reopened picker includes the externally cloned folder

Testing

  • vp test run packages/client-runtime/src/state/runtime.test.ts packages/client-runtime/src/state/filesystem.test.ts — 24 tests passed
  • client-runtime, web, and mobile typechecks passed
  • targeted lint and formatting checks passed; only pre-existing CommandPalette nested-component warnings remain
  • isolated browser E2E reproduced the stale listing on main 2.3 seconds after git clone
  • the same E2E passed on this branch: the cloned folder appeared after reopening in 400 ms without restarting T3 Code

Model: GPT-5.6; harness: Codex in T3 Code.


Note

Low Risk
Targeted query-cache refresh for filesystem browse only; existing SWR caching remains the default elsewhere.

Overview
Fixes stale Add Project folder listings when the picker is reopened while cached directory results are still fresh (e.g. after an external git clone).

Runtime: Adds opt-in refresh on AtomQueryOptions / executeAtomQuery, which calls registry.refresh(atom) before reading so retained queries can re-fetch even inside the SWR stale window. A unit test covers refresh vs cached reads.

Web & mobile: Filesystem browse preloads via useAtomQueryRunner now pass refresh: true, so opening or navigating the Add Project picker forces a directory re-read. On mobile, FolderBrowser also calls browseState.refresh() on mount when a completed cached listing is already present, without disturbing in-flight loads.

Short-lived cache behavior for rendering and back navigation is unchanged.

Reviewed by Cursor Bugbot for commit 4646f2c. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Refresh project folder contents when reopening the browse dialog

  • Adds a refresh option to executeAtomQuery in runtime.ts that calls registry.refresh(atom) before reading, returning up-to-date data even when the cache is fresh.
  • Updates useAtomQueryRunner (web and mobile) to accept and forward the refresh flag, and passes refresh: true when loading browse paths in the Command Palette and Add Project screen.
  • On mount, FolderBrowser in AddProjectScreen.tsx triggers a refresh if a non-pending cached value exists, ensuring stale directory listings are re-fetched.
  • Behavioral Change: browse queries now always trigger a network revalidation when the dialog opens, even if the cached value is considered fresh.

Macroscope summarized 4646f2c.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 78779c21-9db7-478f-8ed2-2038ff406a00

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 4, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 4646f2c

Straightforward bug fix adding a refresh option to atom queries to ensure folder listings are fresh when UI is reopened. Changes are self-contained, use existing infrastructure, and include a unit test validating the behavior.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant