Repository navigation
Description
Before submitting
- I searched existing issues (
#29034,#30095,#25622) and verified this specific case is still reproducible onmain. - I included source-level diagnosis and steps to reproduce.
Area
apps/mobile
Summary
When a thread from Project A is mounted in the detail route (currentRoute?.name === "Thread") and the user filters the thread list / sidebar to Project B and taps New thread, handleStartNewTask + newTaskDestination still prioritize currentProject (Project A) ahead of filteredProject (Project B), starting the new thread in Project A instead of the explicitly filtered Project B.
Steps to reproduce
- Connect the mobile app to an environment with at least two projects:
project-aandproject-b(with Settings -> General -> Use last project enabled, the default). - Open an existing thread in
project-asoThread(project-a) is the active detail route inworkspaceRoutesOf(state.routes). - In split view (
usesSplitView) or overlay sidebar (variant === "medium"/ Android sidebar rail), open the Threads sidebar, selectproject-bin the project filter chip (selectedProjectKey), and tap New thread (WorkspaceToolbar/AndroidWorkspaceSidebar->startNewTask).
Expected behavior
Because the user explicitly filtered the thread list to project-b and initiated New thread while the filtered sidebar is visible (or when an explicit single-project filter is active), the new thread opens in project-b (filteredProject), matching the intent of #29034.
Actual behavior
newTaskDestination resolves currentProject (project-a) ahead of filteredProject (project-b), so the composer and resulting creationSource: "mobile" thread start in project-a instead of project-b. If the user pastes a prompt and taps Send without noticing the composer header still says project-a, the run executes in the wrong repository.
Source-level diagnosis (main)
- In
apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsx(handleStartNewTask, lines 593-648),currentRouteis read fromworkspaceRoutesOf(state?.routes.slice(0, state.index + 1) ?? []).workspace.at(-1)regardless of whether the sidebar/list pane is currently visible or focused, and regardless of whether a single-project filter (filteredScope) is active:newTaskDestination({ projects, requestId: uuidv4(), useLastProject: saved?.useLastProjectForNewThreads, currentProject: environmentId && projectId ? { environmentId, projectId } : undefined, filteredProject: filteredScope ? newTaskFilteredProject( filteredScope, listEnvironmentId, connectedEnvironmentIds, saved?.lastThreadProject, ) : undefined, lastProject: saved?.lastThreadProject, })
- In
apps/mobile/src/features/threads/new-task-project-selection.ts(newTaskDestination, lines 185-208):const project = options.useLastProject === false ? undefined : (find(options.currentProject) ?? find(options.filteredProject) ?? (last?.archivedAt == null ? last : undefined));
#29034placedfilteredProjectahead oflastProject, which fixed compact single-column navigation after popping back toHome, but wheneverThread(project-a) remains onworkspaceRoutes(split layout, overlay sidebar, or sidebar toolbar New thread),find(options.currentProject)wins first and overridesfilteredProject.
Suggested fix
- When starting a new thread from the sidebar/list toolbar (or when the overlay sidebar is open, or whenever an explicit single-project filter
filteredProjectis active and differs fromcurrentProject), preferfilteredProjectovercurrentProject— or omitcurrentProjectwhenstartNewTaskis invoked from the sidebar/list chrome rather thanThreadHeader'sonCompose.
Environment
- Server: T3 Code
0.1.10(darwinarm64) - Client: T3 Code Mobile (
creationSource: "mobile")
Activity
juliusmarminge commentedon Nov 19, 2026
A fix for this was proposed in #39001, but when the reported steps were run in the real app the problem did not appear.
What was run on
a6d2bed55b, the commit before this change:On each commit, confirmed Settings > General > Use last project enabled; opened Alpha thread; selected Bravo in the project filter without closing Alpha detail; tapped the native New task control. Base opened an Alpha draft; head opened Bravo. Cleared the filter, reopened Alpha and repeated: both opened Alpha. Disabled Use last project, reopened Alpha, filtered to Bravo and repeated: both opened Choose project.
How: Manual native verification on the same pooled iPad Pro 13-inch (M5), iOS 27.2, portrait split view, light theme, 1032x1376 logical viewport. Separate real server and Metro per commit, fresh isolated databases, synthetic Alpha and Bravo projects with completed replay threads seeded through API and CLI. Stills were visually inspected and each pair was pixel-identical more than 500 ms apart. Recordings were inspected using decoded contact sheets and end frames. Device released, servers stopped, disposable worktrees and scratch removed.
Could you share the exact steps, what you see, and the version and platform you are on? The pull request is closed for now; the fix is picked up again once the problem can be shown.