fix(mobile): Files search no longer carries into another workspace #35902
main fromrefs/pull/35902/head·merged by juliusmarminge View on GitHubThe review item was correct: the iOS AppBar only wired onChangeText and onCancelButtonPress into headerSearchBarOptions and never applied search.value. The inspector's native SearchBar lives in PaneHeader, outside the Files pane, and outlives thread switches, so resetting the React query left the old text in the field. This commit (on top of the first fix, which keys the query to [environmentId, cwd]) makes the iOS AppBar follow search.value. It passes a SearchBarCommands ref through headerSearchBarOptions.ref (V5StackHeader.ios forwards searchOptions.ref to ). It records the last text the native bar reported, and a layout effect calls ref.setText(value) when the caller's value differs from that, as WorkspaceToolbar.tsx already does with setText. Typing round-trips do not trigger setText. A workspace switch now clears the visible field together with the query, so the next keystroke starts a fresh search. Android already passed value= and is unchanged. Not verified on an iOS simulator in this round: the jsdom repro test covers the React-side reset, and the native setText path is untested here. No new regex or parser.
Fixes pingdotgg/t3code#35846
Reproduction on main#
Commit 95cb068c10 (origin/main). Ran T3CODE_DEV_SEED=0 vp run dev (fresh database) plus Metro, and installed the iOS dev client on a pooled 'iPad Pro 13-inch (M5)' simulator (split layout). Created two synthetic git projects through the server CLI: alpha-proj (src/, alpha-readme.md, shared-notes.txt) and beta-proj (lib/, beta-readme.md, package.json), each with one Replay (dev) thread. Steps: open 'alpha thread', tap Open files (tree shows src, alpha-readme.md, shared-notes.txt), type 'readme' into Search files, show the sidebar and select 'beta thread' (the inspector hides), tap Open files. Observed: the Files pane is titled beta-proj, but the search field still holds 'readme' and the list shows only beta-readme.md instead of beta-proj's unfiltered tree. Also wrote a jsdom test that renders ThreadFileNavigatorPane, types 'alpha', then changes cwd from /first to /second. On main useFileTreeEntries receives { cwd: '/second', searchQuery: 'alpha' }, so the test fails.
Evidence#
Environment: native iOS dev client on a pooled iPad Pro 13-inch (M5), portrait split layout (1032 × 1376), light theme; fresh databases, synthetic git projects and Replay (dev) threads.
Steps: open alpha thread → Open files → search readme → Show sidebar → beta thread → Open files.
Proven: the scenario fails on base and passes on head (scenarios:prove exit 0).
| Before | After | |
|---|---|---|
| Commit | 95cb068c10 | fcc682ed01 |
| Result | Search retains readme; beta workspace remains filtered | Search clears; full beta workspace tree appears |
| Alpha search | ![]() | ![]() |
| Beta settling | ![]() | ![]() |
| Beta Files | ![]() | ![]() |
| Failure capture | ![]() | |
| Recording | Before video | After video |
Scenario · iPad runner configuration
Final screenshots on each side matched byte-for-byte across captures at least 500 ms apart. Both recordings and all captures were visually inspected.
Not shown:
- iPhone layouts and other AppBar search consumers were not exercised; this proof covers the reported iPad Files inspector workspace-switch flow.
Tests#
vp test run src/features/files/thread-file-navigator-pane.test.tsx (apps/mobile): 1 passed. vp run check:changed: format, lint, knip, typecheck (2 packages), test (2 files) and react compiler all passed. No iPad simulator run.
Not in this change#
- The selected file/expanded state in useFileTreeEntries was not audited for the same carry-over; the FileTreeBrowser key already resets browser-local state per workspace.
- The compact mail-search toolbar path (createNativeMailSearchToolbarItem, used outside split view) also has no way to receive a value from the caller; it is not the reported layout and was left alone.
- Other selection/expanded state in useFileTreeEntries was not audited for carry-over across workspaces.
Who did the work#
- Written by Claude Opus 5.5, in Claude Code
- Reviewed by GPT-6.1 Sol, in Codex, and by Claude Opus 5.5, each on its own
- Proof captured by GPT-6.1 Sol and checked by Claude Opus 5.5
Run by the t3code factory in T3 Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
tanstack-source added labelsbug
No actionable comments were generated in the recent review.
Walkthrough
-
The Files pane now scopes search queries to the current workspace. AppBar synchronizes controlled search values with the native search bar.
Changes: Mobile Files search
Layer / File(s) Summary Scope Files search by workspace
apps/mobile/src/features/files/thread-file-navigator-pane.tsx,apps/mobile/src/features/files/thread-file-navigator-pane.test.tsx,apps/mobile/vite.config.tsThe pane stores the search query with a workspace key and displays an empty query when the workspace changes. The test checks that the query and input clear after switching workspaces. The test is added to the React test project. Synchronize controlled search text
apps/mobile/src/components/ui/AppBar.tsxAppBar tracks native search text and updates the native search bar when its controlled value differs. Text-change and cancel events update the tracked text and call search.onChangeText.Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested labels:
bugfixSuggested reviewers:
t3dotgg,macroscopeapp
Merge Risk:
Minimal · up tofcc68-
Files search text no longer carries into another workspace after switching, and the iOS search field resets with it. No concrete merge-blocking risk was identified.
Pre-merge checks:
4-
Check name Status Explanation Title check The title names the main change: Files search no longer carries over into another workspace. It uses the conventional commit format with a mobile scope. The changeset scopes the Files search query to … Linked Issues check Issue #35846requires that Files search not carry into another workspace. The PR scopes the search query to [environmentId, cwd] in thread-file-navigator-pane.tsx, so a workspace change yields an empt…Out of Scope Changes check Every changed area connects to issue #35846. AppBar.tsx wires the native iOS search bar to search.value, which is needed so the visible field resets with the query. thread-file-navigator-pane.tsx keys…Description check The description follows the repository template closely. It has the Problem, Change, Scope, and Verification sections. It explains the root cause: the iOS AppBar never applied search.value, so the nat… Full details: Title check
-
Explanation
The title names the main change: Files search no longer carries over into another workspace. It uses the conventional commit format with a mobile scope. The changeset scopes the Files search query to environment and working directory, and it syncs the iOS native search field, so the title matches the change.
Full details: Linked Issues check
-
Explanation
Issue
#35846requires that Files search not carry into another workspace. The PR scopes the search query to [environmentId, cwd] in thread-file-navigator-pane.tsx, so a workspace change yields an empty displayed query and an unfiltered tree. The issue allows either reset or restore, and this PR uses reset. Same-directory sharing is permitted by the issue and is not contradicted. The iOS AppBar (AppBar.tsx) now follows search.value through a SearchBarCommands ref and setText, so the native search field clears with the query. This covers the stale visible text reported in the PR description. Pane retention across inspector switches is not changed. The jsdom test (thread-file-navigator-pane.test.tsx) reproduces the cwd change and asserts the empty query and input value. The native setText path was not exercised on a simulator. That is a device-verification gap, not a missing coding requirement. The assessment rests on source evidence and the summary of the change set. The PR merge base is 95cb068c10 and the reviewed head is fcc682ed01.
Full details: Out of Scope Changes check
-
Explanation
Every changed area connects to issue
#35846. AppBar.tsx wires the native iOS search bar to search.value, which is needed so the visible field resets with the query. thread-file-navigator-pane.tsx keys the query to the workspace and reuses the same key for FileTreeBrowser, which is the core fix. thread-file-navigator-pane.test.tsx is the regression test for the reported carry-over. vite.config.ts adds that test to the reactTests list, which is test wiring for the new coverage. The PR description states that the selection and expanded state, and the compact mail-search toolbar path, were left unchanged. Those items are excluded from this PR and are not part of the change set, so they do not count as out-of-scope changes.
Full details: Description check
-
Explanation
The description follows the repository template closely. It has the Problem, Change, Scope, and Verification sections. It explains the root cause: the iOS AppBar never applied search.value, so the native search field kept stale text after a workspace switch. The Change section explains the query scoping to [environmentId, cwd] and the SearchBarCommands ref with a layout effect calling setText. Scope links issue
#35846and the PR objectives match. Verification gives a jsdom test result, check:changed results, and a before/after iPad simulator reproduction with screenshots and recordings, and it states that the iPad simulator was not run in this round. Only the Problem section is a bit loose on expected behavior, and the title is not a conventional commit title in the template's style, but the required information is present.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info-
Run configuration-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: factory/issue-35846
- File: .coderabbit.config.ts
- Commit: fcc682e
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
aef013da-976d-4c82-97a0-e8e462bf3958
Commits-
Reviewing files that changed from the base of the PR and between b1bc5ce20f33442daa194002f338fcf52f4dbb62 and fcc682ed0195438c7c2396ef00e8a48a04eb04e2.
Files selected for processing: 4-
apps/mobile/src/components/ui/AppBar.tsxapps/mobile/src/features/files/thread-file-navigator-pane.test.tsxapps/mobile/src/features/files/thread-file-navigator-pane.tsxapps/mobile/vite.config.ts
Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.
-
-
juliusmarminge merged this
bedc865juliusmarminge closed this
[Haiku 5.5][Claude Code] on behalf of shivam.
Notes on the issue this PR closes, for the record (the PR is already merged).
- Reproduced on base
95cb068c10a6, component level (jsdom, mocked services). Typingalphaincwd="/first", then rendering withcwd="/second", passessearchQuery: "alpha"touseFileTreeEntries. The issue's repro script on a Boat job printedRESULT: defect reproduced. The cause matches the issue: the search text isuseStatein the pane, which stays mounted across thread switches. - Reproduced on a phone (POCO F4, Android 14), base build. Thread A (Workspace A), search
needle: showsneedle-a.txt. Switch to Thread B (Workspace B) with the Files inspector still open: the field still readsneedle, and the tree shows onlyneedle-b.txt. Defect reproduced. - Same steps on the fixed build (commit
f6068a42424, my unpushed fix, not this PR's code). Thread A:needle-a.txt. Thread B: the field is empty and the tree is unfiltered (banana.txt,beta.md,needle-b.txt). Expected behavior observed. - Tests: the implementing agent reported the new component test failing on base and passing after the fix, with
useFileTreeEntries.test.tsxat 16/16. I read the diff but didn't rerun the job. - Not shown: tablet split view. The Pixel Tablet did not boot, and Medium Tablet timed out. The phone screen recordings were captured, but I haven't reviewed them. Screenshots and recordings are on corex under
/tmp/issue-35846/evidence; I can attach them if you want them on the PR.
- Reproduced on base
Sign in to join this conversation.







Approvability#
Verdict: Needs Human Approval
Macroscope's review found this PR requires human approval — The change prevents Files search text from carrying into another workspace and synchronizes native search-field resets. It also adds a lint-suppression directive in AppBar.tsx that requires human review.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).