Skip to content

refactor(client): share filesystem browse navigation - #4797

Merged
juliusmarminge merged 1 commit into
mainfrom
agent/share-filesystem-browse-navigation
Jul 28, 2026
Merged

refactor(client): share filesystem browse navigation#4797
juliusmarminge merged 1 commit into
mainfrom
agent/share-filesystem-browse-navigation

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jul 28, 2026

Copy link
Copy Markdown
Member

What changed

Web and mobile independently derived filesystem browse paths and filtered directory entries, so the same behavior lived in both apps and had already drifted around hidden directories.

This follow-up moves the React-free browse model into client-runtime: target-directory derivation, leaf filtering, parent navigation, hidden-directory visibility, and exact matches. It relocates the existing web deferred-navigation coordinator and preload policy beside that model. Web and mobile are now thin consumers that provide the current query and render the returned state; mobile keeps its existing immediate-navigation behavior without a second app-specific state machine.

Mobile and web now expose hidden directories consistently when the typed leaf starts with .. Desktop inherits the web behavior. No provider or wire-contract changes are involved.

Diff accounting:

  • production: +126 / -140 — net -14
  • tests: +70 / -64 — net +6, consolidated under client-runtime
  • total: +196 / -204 — net -8

Validation

  • vp test run packages/client-runtime/src/state/filesystem.test.ts apps/web/src/components/CommandPalette.logic.test.ts — 10 tests passed
  • vp run --filter @t3tools/client-runtime typecheck
  • vp run --filter @t3tools/web typecheck
  • vp run --filter @t3tools/mobile typecheck
  • targeted vp lint --report-unused-disable-directives for all changed files
  • vp run lint:mobile — SwiftLint, ktlint, and detekt passed
  • vp fmt --check for all changed files
  • React Doctor changed-file scan — 89/100; one pre-existing command-palette state-structure warning, no mobile findings

GPT-5.6-sol via the Codex harness in T3 Code.


Note

Low Risk
Refactor with behavior preserved via moved tests; no auth, RPC, or data-model changes—main risk is subtle browse UX regressions in add-project flows.

Overview
Moves filesystem browse logic out of web and mobile into @t3tools/client-runtime/state/filesystem: path derivation (getFilesystemBrowsePath), entry filtering (filterFilesystemBrowseEntries), deferred navigation (createBrowseNavigationCoordinator), and browse preload gating (canPreloadBrowsePath).

Web command palette and mobile add-project folder browser now call those helpers instead of duplicating browse-path math, filtering, and coordinator code in CommandPalette.logic / AddProjectScreen. Browse-related tests move from CommandPalette.logic.test.ts to filesystem.test.ts.

Shared filtering aligns hidden-directory behavior (e.g. showing dot-prefixed folders when the typed leaf starts with .) across platforms without wire or provider changes.

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

Note

Share filesystem browse navigation utilities across mobile and web clients

  • Adds getFilesystemBrowsePath, filterFilesystemBrowseEntries, createBrowseNavigationCoordinator, and canPreloadBrowsePath to packages/client-runtime/src/state/filesystem.ts as shared utilities.
  • Refactors CommandPalette.tsx and AddProjectScreen.tsx to use these shared utilities instead of duplicated local logic.
  • Removes createBrowseNavigationCoordinator, canPreloadBrowsePath, and filterBrowseEntries from CommandPalette.logic.ts along with their tests.
  • Behavioral Change: folder entries in FolderBrowser are no longer sorted alphabetically; they now render in source order.

Macroscope summarized a508142.

@coderabbitai

coderabbitai Bot commented Jul 28, 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: b3215a2a-2edb-4690-b1eb-5411c177a747

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/share-filesystem-browse-navigation

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 28, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge
juliusmarminge force-pushed the agent/share-filesystem-browse-navigation branch from f789747 to a508142 Compare July 28, 2026 23:17
@juliusmarminge
juliusmarminge marked this pull request as ready for review July 28, 2026 23:19
@macroscopeapp

macroscopeapp Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Mechanical refactor extracting shared filesystem browse navigation logic from web and mobile apps into the client-runtime package. The implementations are functionally equivalent with consistent call site updates and preserved tests.

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

@juliusmarminge
juliusmarminge merged commit 936593c into main Jul 28, 2026
22 checks passed
@juliusmarminge
juliusmarminge deleted the agent/share-filesystem-browse-navigation branch July 28, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant