Repository navigation
feat(mobile): offer new threads, forks and projects only where J5 allows them - #852
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
This review includes 12 billable files and costs up to $3.00.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 3 minutes for your next included review. View limit details
|
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined review: reviewer-opus and reviewer-sol (Claude Opus 5.5 and GPT Sol 6.1), head 5de6a19
Both of us reviewed the PR independently and checked each finding against the source. The shared policy is right. Two of the doors still offer what the server refuses.
Blocking
-
The main New thread door still opens a draft on a project the person can't start in (found by reviewer-opus, confirmed by reviewer-sol). Every New thread door goes through
AdaptiveWorkspaceLayout.handleStartNewTask(AdaptiveWorkspaceLayout.tsx:515): the header button, the toolbar, the iOS and Android tab and sidebar buttons, and thenewTaskkey command. It callsnewTaskDestination(…, projects, currentProject, …)(:543) with every project fromuseProjects()(:511).newTaskDestination(new-task-project-selection.ts:112) then picks the current thread's project, elseprojects[0].- So a thread-scope Collaborator who taps New thread from their shared thread lands straight on a draft in that thread's project.
useCanStartTaskInis false there, so the composer shows its read-only notice (ThreadComposer.tsx:1205). - They never see the startable-only picker or its new empty state.
new-task-flow-provider.tsx:226–254has the same problem:selectedEnvironmentIdandselectedProjectdefault from every project, notstartableProjects.
Web keeps this door closed:
useCanStartInAnyhides it, andchatThreadActions.ts:90checksreadCanStartThreadIn. Fix: passuseStartableProjects(projects)tonewTaskDestinationinAdaptiveWorkspaceLayout(one seam), and default the flow provider's selection fromstartableProjects. With nothing startable, the draft has no project, falls through toNewTaskProject, and shows "Nothing to start a thread in". - So a thread-scope Collaborator who taps New thread from their shared thread lands straight on a draft in that thread's project.
-
New project (a fresh repository) skips the Add-project gate (found by reviewer-sol, confirmed by reviewer-opus). The PR gates the local-folder and clone paths with
useCanAddProject, but not this one:AddProjectSourceScreen's "New project" row (AddProjectScreen.tsx:589) is disabled only on!isConnected.AddProjectNewScreen(:983 on) never callsuseCanAddProject, and its Create button (:1189) checks only submitting and an empty name beforeprojectEnvironment.createNew(:1063).
A Collaborator narrowed to a project or a thread receives the full server config,
newProjectsRootincluded, so they can open New project and submit a create that the server refuses (AC19). Fix: add!canCreateProjectto that row'sdisabled, and gateAddProjectNewScreenthe wayAddProjectLocalFolderScreenis gated. Record both in case 90 and the seam test.
Checked and fine
-
Shared policy.
sharingAllowsStartis used as on web: the project's level for a new thread or fork (AC14), and a server-scope level for Add project (AC19). -
Send.
readCanStartTaskInguards the send outside render. -
Fork. It reads the project of the shell's
sourceThreadId. -
Picker. The empty state shows only when the server reports projects but none can be started in.
-
Tests. Both test mocks (
AddProjectScreen.test.ts,filePreview.test.ts) are recorded. reviewer-sol checked direct assertions for each case:- a project-scope Collaborator, a thread-scope Collaborator and a server-scope Collaborator;
- a server Viewer;
- mixed access (Collaborator on A, Viewer on B);
- a server that hasn't answered yet, and an unknown device.
149 focused tests pass: 22 shared and 127 mobile.
Not yet done (merge gates, not code findings)
- Before and after captures for a narrowed Collaborator on Android and iOS, the tester's run, J5 CI, and the rebase onto #846.
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined review: reviewer-opus and reviewer-sol, head 37a6b7d
Fixed
- New project. The row is disabled on
!canCreateProject, andAddProjectNewScreengates both Create andsubmitwithuseCanAddProject. - New thread doors.
AdaptiveWorkspaceLayoutandUnavailableThreadDraftRedirectbuild their destination fromuseStartableProjects, and the flow provider's picker and fresh default use only startable projects.
Blocking (new in this push)
-
A draft stamped with a project the person can't start in now opens on, and can send to, a different project. We both found this independently.
openDraftnow checks the stamp againstallProjects(new-task-flow-provider.tsx:558) and sets the stamp's environment and project key. ButselectedEnvironmentId(:229–233),projectsForEnvironmentandselectedProject(:247–257) are still resolved from the startableprojects.- Say the draft is stamped with project A, which the person can't start in (they're a Viewer there, or hold only a thread). If A's server has no startable project,
selectedEnvironmentIdfalls toprojects[0]'s server. If it has one, B,selectedProjectcan't find A by key and falls back to B. activeDraftKeyis still A's draft, with its text.handleStart(NewTaskDraftScreen.tsx:789) readsflow.selectedProject, which is B, passesreadCanStartTaskInfor B, and starts the thread in B.- So the PR description's claim that "a draft already stamped with another project opens read-only" doesn't hold.
- This is reachable through a prompt link (
usePromptLinkResolver.ts:160creates a draft for the linked project), a PR thread draft (usePullRequestThreads.ts:104), or a draft saved before the person's level was lowered.
Fix: resolve an explicit selection against
allProjects, and take only the fallback from the startable list. For example: the override is valid whenallProjectshas that server;selectedProjectisallProjects.find(key) ?? startableForEnvironment[0] ?? null. A stamped draft then keeps A, anduseCanStartTaskInshows it read-only, as intended. Fresh defaults and the picker stay startable-only.
The panel has no other findings. Before merge it still needs the before/after captures, the tester's run, J5 CI and the rebase onto #846.
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined review: reviewer-opus and reviewer-sol, head aaf844f
Fixed. new-task-flow-provider resolves an explicit or stamped selection against all of useProjects(): the server override, the project key and openDraft's load check. startableProjects supplies only the picker's scopes, the fresh default server and project, selectEnvironment's match and the repository-host list. So a draft stamped with a project the person can't start in stays on that project, its composer is read-only and handleStart refuses it. Its text never moves to another project. The case 90 text and the seam row are updated.
The panel has no open code findings. The focused tests pass: AddProjectScreen, the seam test and new-task-project-selection (3 files, 49 tests).
Before merge it still needs the before/after captures for a narrowed Collaborator (Android and iOS), the tester's run, green J5 CI and the rebase onto #846.
aaf844f to
e596bbf
Compare
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined review: reviewer-opus and reviewer-sol, head e596bbf (rebased onto trunk with #846, #848 and #859)
We both checked the rebase.
- Code. The code changes outside the seam test are line-for-line identical to the reviewed aaf844f. The overlap with #846 in
NewTaskDraftScreen.tsxresolved with no change to either side. - Imports and mocks. The artifact, sharing and start-access imports coexist, and all three
filePreview.test.tsmocks are kept. - FORK.md and seams. The seam groups (21, 72, 90, 98, 99) are all kept, and the file-index rows are right: ThreadRouteScreen
69, 90, 99, new-task-flow-provider45, 90. - Selection. Explicit and stamped drafts still resolve against all projects, and fresh defaults still come only from startable projects.
- Docs. There are no docs changes.
193 focused tests pass (158 mobile, 35 shared). There are no new findings; the panel has no open code findings.
Before merge it still needs the captures, the tester's verdict and green J5 CI.
…ows them A thread-only Collaborator or a Viewer was offered New thread, Fork and Add project, which the server then refused (#831, gap P6). Mobile now asks the person's level, as web does since #640/#641: every New thread door and the picker start from projects they may start a thread in (an explicit or stamped draft still opens on its own project, read-only), the picker says so when there are none, Send and Add/New project need a Collaborator's level over the project or the server, and a fork asks the thread's project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e596bbf to
e830b51
Compare
Jacksondr5
left a comment
There was a problem hiding this comment.
Combined review: reviewer-opus and reviewer-sol, head e830b51 (rebased onto #861)
We both checked the rebase.
- Code. The code changes outside the seam test are still line-for-line identical to the reviewed patch.
- FORK.md. The tail of case 90 matches trunk byte for byte.
- Docs. There are no docs changes.
55 focused mobile tests pass. There are no new findings; the panel has no open code findings.
Problem
On mobile, a thread-only Collaborator or a Viewer is offered New thread, Fork and Add project. The server then refuses them: "COULD NOT START TASK / This is not shared with you on this server." Web stopped offering these in #640/#641. Part of #831 (gap P6).
What changed
Mobile asks the person's level before offering a start, as web does. It uses the shared
sharingAllowsStartrule (AC14, AC19) through J5-ownedapps/mobile/src/j5/sharing/startAccess.ts:handleStartNewTask. It, and the new-task flow's fresh default, now start from the projects the person may start a thread in, so a new task never lands in a project they can't start in. An explicit or stamped selection (a prompt link, a PR-thread draft, a draft saved before a level was lowered) still resolves against every project. It opens on its own project, read-only, and its text never moves to another project.canOperateandhandleStart's guard need that level as well as upstream's "Operate tasks". This covers a draft opened by a link or a share for a project the person can't start in.Before a server has answered, nothing is withheld, and the server stays authoritative.
Sequencing: #846 (#834), now merged, also edits
NewTaskDraftScreen.tsxon other lines. This PR rebases onto trunk after #843, #844 and #848 merge, in the Captain's order.UI changes
Android, same isolated home and device, base
31447c91c6vs headaaf844f899:iOS is deferred to Checkpoint 1, per the Captain's wave-1 Simulator hold.
Live testing
Verdict: PASS on Android 16 at head
aaf844f899. The crew tester ran it (GPT-6 Astra) against an isolated test server, with a real Claude Haiku 5.5 turn. Report:artifacts/test-reports/j5code-mobile-wave1a-tester/aaf844f899.md.Not exercised:
/newand Chats' New thread. All of them go through the samehandleStartNewTask.The incoming-share "load failed" dialog seen once at launch is the known #837 and is unrelated.
Upstream impact
FORK.md case 90 (web's start doors follow the level, Jackson's 2026-10-25 approval of one J5 check beside each upstream check). Its "Mobile is not covered" sentence is replaced by the mobile wiring, with each edit one import and one or two lines:
apps/mobile/src/features/threads/new-task-flow-provider.tsx:startableProjects = useStartableProjects(projects)feeds the picker's scopes, the fresh default server and project, and the servers offered when switching. Explicit selections resolve against upstream's full list.apps/mobile/src/features/layout/AdaptiveWorkspaceLayout.tsxandThreadRouteScreen.tsx's unavailable-thread redirect:newTaskDestinationgets the startable projects.apps/mobile/src/features/threads/NewTaskRouteScreen.tsx:noStartableProjectState(...) ?? deriveProjectEmptyState(...).apps/mobile/src/features/threads/NewTaskDraftScreen.tsx:useCanStartTaskInandreadCanStartTaskInin place of the bare "Operate tasks" reads.apps/mobile/src/features/threads/ThreadFeed.tsx:AssistantForkButtonalso asksuseCanForkThread. builder-timeline (feat(mobile): agents' messages read as letters, not envelopes #843) confirmed its edits don't touch this.apps/mobile/src/features/projects/AddProjectScreen.tsx: threecanCreateProjectreads useuseCanAddProject. The New project row is disabled on it, andAddProjectNewScreengates Create andsubmit.AddProjectScreen.test.tsandsrc/lib/filePreview.test.tsmockstartAccess.All of these are in
upstreamSeams.test.tsand FORK.md's file index.Checklist
client-runtime, and the seams are pinnedFORK.md(case text and file-table row) in this PRBuilt by Claude Opus 5.5 in Claude Code (J5 crew seat builder-identity).
🤖 Generated with Claude Code