Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions FORK.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Mobile follows the same add-beside rule with a fixed seam set, decided on 2026-0
| ------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Timeline delegate | `features/threads/ThreadFeed.tsx` message rows | The A2A timeline's groups from the shared classifier, `packages/client-runtime/src/j5/userMessagePresentation.ts` (web case 7) | Landed: case 97. |
| Queue-row formatter | `features/threads/ThreadQueueControl.tsx` | The sender line and the letter's first line for queued deliveries (web case 24) | Landed: case 97. |
| Thread-row identity | `features/threads/thread-list-v2-items.tsx` | Crew membership (web case 23) | Landed for spawned agents (case 115). The row also mounts the persona's `AgentIdentityChip`, at upstream's title inset. |
| Thread-row identity | `features/threads/thread-list-v2-items.tsx` | Crew membership (web case 23) | Not landed. The row mounts only the persona's `AgentIdentityChip`, at upstream's title inset. |
| Route registration | `Stack.tsx` and the settings row targets | J5 screens such as Inbox, Fleet and Artifacts | Landed for Artifacts (case 98) and the Inbox (case 101): `Stack.tsx` spreads `j5ThreadArtifactRoutes` and `j5InboxRoutes`. Fleet is not landed. |
| Link resolver | the thread feed's markdown link press (`features/threads/ThreadFeed.tsx`) | `artifacts/…` links open the artifact instead of a workspace file | Landed (case 98). |

Expand Down Expand Up @@ -550,7 +550,7 @@ migrations after upstream migrations.

114. Mobile roster review for a Captain's Crew proposal ([#836](https://github.com/Jacksondr5/j5code/issues/836), Jackson's decisions 1 and 2 of 2026-11-07/08: a phone approves, declines and removes seats, showing each seat's access; other edits stay on web). `apps/mobile/src/features/threads/ThreadDetailScreen.tsx` mounts J5-owned `J5ComposerControls` (`apps/mobile/src/j5/composer/`) beside case 49's `PlaybookComposerControl`, under the same conditions; every J5 row above the composer joins there, not as another seam. Its first row, `CrewRosterStrip` (`apps/mobile/src/j5/crew/`), shows one row per open, human-approved proposal for the thread and opens the `ThreadCrewProposal` screen, which case 98's `j5ThreadRoutes` spread registers. The gate filter, seat lines, playbook notes and preview binding live in `packages/client-runtime/src/j5/crewProposals.ts` (a new `./j5/crew-proposals` export in `packages/client-runtime/package.json`), shared with web's card; approval sends only the token from a complete preview of the seats on screen. Its second row, `AdjudicationDock` (`apps/mobile/src/j5/a2a/`), pins a Captain's open asks to the person, as web's dock does (#836 piece 6): the Inbox's own asks from this thread, answered through the Inbox's `useInboxAnswers`, shown only when `useCrewMembership` (`apps/mobile/src/j5/crew/crewMemberships.ts`, over case 115's `threadReadConnectionsAtom`, re-read whenever the server's Crew revision moves) says the thread commands a Crew. It has no attachments and no owner's clear action, since the mobile Inbox has neither. The dock's logic is `packages/client-runtime/src/j5/adjudicationDock.ts` and the membership replace is `crewMemberships.ts`, both shared with web and reached through the `./j5/adjudication-dock` and `./j5/crew-memberships` exports this case appends to upstream-owned `packages/client-runtime/package.json`.

115. Mobile lists a spawner's agents under its row (register D22, the mobile half of case 23; [#836](https://github.com/Jacksondr5/j5code/issues/836) decisions 3 and 4). `apps/mobile/src/features/threads/useThreadListV2.ts` passes its threads through J5-owned `useCrewListedThreads` (`apps/mobile/src/j5/crew/spawnedChildren.ts`), which keeps the spawned-children read (`j5.fleet.listSpawnedChildren`) current for every listed thread and drops the threads an agent spawned unless they are pinned, so every list, shelf and reorder computed after it sees the same rows. Mobile has no Fleet roster to bound re-reads by, so a moved `crew` or `fleet` revision re-reads that server's listed rows in one batched read. `apps/mobile/src/features/threads/thread-list-v2-items.tsx` mounts J5-owned `CaptainSeatsToggle` (`apps/mobile/src/j5/crew/CaptainSeats.tsx`) inside the card row's bottom line, before the pull request badge, and inside the slim row before its time, so a collapsed spawner is no taller; and it mounts `CaptainSeats` after the row's swipeable, outside its long-press menu, handing it upstream's own `STATUS_LABEL_BY_STATUS` so seat rows read as rows do. The expanded seats show each Crew's summary, Stop crew while a seat is running, "Not started", and "Replaced by". The grouping, the membership rule and the Crew state labels moved from web to `packages/client-runtime/src/j5/spawnedChildren.ts` and `crewState.ts`, reached through the `./j5/spawned-children` and `./j5/crew-state` exports this case adds to `packages/client-runtime/package.json`. Its test mocks the hook as a passthrough, since the hook reads server connections. On a pin advance: keep the one wrap at the top of `useThreadListV2`, the toggle inside both row layouts, and the seats outside the swipeable.
115. Mobile shows a spawner's agents in its Agents sheet (register D22, the mobile half of case 23; [#836](https://github.com/Jacksondr5/j5code/issues/836) decisions 3 and 4, and [#1009](https://github.com/Jacksondr5/j5code/issues/1009), Jackson's call at Checkpoint 4 that replaced the Chats-row count). `apps/mobile/src/features/threads/useThreadListV2.ts` passes its threads through J5-owned `useCrewListedThreads` (`apps/mobile/src/j5/crew/spawnedChildren.ts`), which keeps the spawned-children read (`j5.fleet.listSpawnedChildren`) current for every listed thread and drops the threads an agent spawned unless they are pinned, so every list, shelf and reorder computed after it sees the same rows; its test mocks the hook as a passthrough, since the hook reads server connections. Mobile has no Fleet roster to bound re-reads by, so a moved `crew` or `fleet` revision re-reads that server's listed rows in one batched read. Upstream's in-thread Agents pill and sheet carry the rest. `apps/mobile/src/features/threads/ThreadDetailScreen.tsx` passes upstream's own `resolveSubagentPillSegment` result through J5-owned `useJ5AgentsPillSegment` (`apps/mobile/src/j5/crew/J5ThreadAgents.tsx`), which adds the thread's spawned agents to the pill's counts and keeps the pill while a Crew idles between turns; and `apps/mobile/src/features/threads/ThreadAgentsSheet.tsx` mounts `J5ThreadAgents` above upstream's subagent rows, opening a member through upstream's own `openChildThread`, and shows upstream's empty text only when neither list has a row (`useHasJ5Agents`). The J5 rows show each Crew's summary, Stop crew while a seat is running, "Not started" and "Replaced by", in the tones of upstream's agent rows. The grouping, the membership rule, the pill counts and the Crew state labels live in `packages/client-runtime/src/j5/spawnedChildren.ts` and `crewState.ts`, reached through the `./j5/spawned-children` and `./j5/crew-state` exports this case adds to `packages/client-runtime/package.json`. On a pin advance: keep the one wrap at the top of `useThreadListV2`, the segment wrap in `ThreadDetailScreen`, and the sheet's mount and empty-text condition.

116. The Lineage section shows J5's command relations ([#283](https://github.com/Jacksondr5/j5code/issues/283), Jackson's decision of 2026-09-24). Upstream's Lineage (`apps/web/src/components/chat/ThreadRelationshipsControl.tsx`) draws upstream's lineage only, so a Peer Agent or Crew seat looks like an unrelated root thread there. The file exports `ThreadLineageRowList` and `LineageTooltipContent` (one word each), calls J5-owned `useJ5LineageRows` once before its early return, adds `j5Lineage.length > 0` to `lineageVisible` and to the section's `showHeading`, and renders `<J5LineageRows>` after the delegated-from list. The rows live in `apps/web/src/j5/threads/J5LineageRows.tsx` and read the live Fleet roster: the thread's placement parent and Crew Captain, and the agents placed under it or seated in its Crews. They reuse upstream's row control, icon, tooltip and list, and they leave upstream's lineage and `relationshipToParent` alone. Upstream's `ThreadRelationshipsControl.browser.test.tsx` mocks them. Proof: `apps/web/src/j5/threads/j5Lineage.logic.test.ts`. On a pin advance, keep the clause in both visibility lists and the render beside upstream's own extra row lists. If upstream exports a shared row component, render J5's rows with it.

Expand Down Expand Up @@ -768,7 +768,7 @@ explicitly marked.
| `apps/mobile/metro.config.js` | A | 113 |
| `apps/mobile/package.json` | A | B, 45 |
| `apps/mobile/src/features/threads/NewTaskDraftScreen.tsx` | A | 45, 90, 100, Saved-agent mentions |
| `apps/mobile/src/features/threads/ThreadDetailScreen.tsx` | A | 45, 49, 114 |
| `apps/mobile/src/features/threads/ThreadDetailScreen.tsx` | A | 45, 49, 114, 115 |
| `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` | A | 69, 90, 99 |
| `apps/mobile/src/features/settings/SettingsRouteScreen.tsx` | A | 72, Role library, 105 |
| `apps/mobile/src/features/settings/components/SettingsScreen.tsx` | N | 72 |
Expand Down Expand Up @@ -984,7 +984,7 @@ explicitly marked.
| `apps/mobile/src/lib/filePreview.test.ts` | N | 97, 99 |
| `apps/mobile/src/features/threads/thread-search-match.tsx` | N | 99 |
| `apps/mobile/src/features/threads/thread-work-log.tsx` | N | 99 |
| `apps/mobile/src/features/threads/thread-list-v2-items.tsx` | N | 115 |
| `apps/mobile/src/features/threads/ThreadAgentsSheet.tsx` | N | 115 |
| `apps/mobile/src/features/threads/useThreadListV2.ts` | N | 115 |
| `apps/mobile/src/features/threads/useThreadListV2.test.tsx` | N | 115 |
| `apps/mobile/src/features/threads/ThreadComposer.tsx` | A | 49, 100, Role library, Saved-agent mentions |
Expand Down
10 changes: 9 additions & 1 deletion apps/mobile/src/features/threads/ThreadAgentsSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ScreenStack } from "react-native-screens";
import { useSafeAreaInsets } from "react-native-safe-area-context";

import { AndroidSheetHeader } from "../../components/ui/AndroidScreenHeader";
import { J5ThreadAgents, useHasJ5Agents } from "../../j5/crew/J5ThreadAgents";
import { AppText as Text } from "../../components/ui/AppText";
import { environmentThreadDetails } from "../../state/threads";
import { NativeStackScreenOptions, nativeHeaderScrollEdgeEffects } from "../../native/StackHeader";
Expand Down Expand Up @@ -61,6 +62,8 @@ export function ThreadAgentsSheet({ route }: StaticScreenProps<AgentsTarget>) {
const turn = useThreadTurnSubagents(target);
const subagents = turn?.subagents ?? [];
const hasLiveAgent = (turn?.liveCount ?? 0) > 0;
// J5 (case 115): the Crew seats and Peer Agents this thread spawned list above the subagents.
const hasJ5Agents = useHasJ5Agents(target);
const workflowGroups = useMemo(
() =>
new Map(
Expand Down Expand Up @@ -100,7 +103,12 @@ export function ThreadAgentsSheet({ route }: StaticScreenProps<AgentsTarget>) {
contentContainerClassName="px-5 pb-6"
contentContainerStyle={{ paddingBottom: Math.max(insets.bottom, 16) + 8 }}
>
{subagents.length === 0 ? (
<J5ThreadAgents
environmentId={target.environmentId}
threadId={target.threadId}
onOpen={openChildThread}
/>
{subagents.length === 0 && !hasJ5Agents ? (
<Text className="pt-6 text-center text-sm text-foreground-muted">
No agents in this turn.
</Text>
Expand Down
8 changes: 7 additions & 1 deletion apps/mobile/src/features/threads/ThreadDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ import { ComposerPopoverHost } from "./ComposerPopoverHost";
import { ThreadFeed, type ThreadFeedHandle, type ThreadFeedHistoryControls } from "./ThreadFeed";
import { WorkspaceMutationIdProvider } from "./WorkspaceMutationIdProvider";
import { useThreadTurnSubagents } from "./ThreadAgentsSheet";
import { useJ5AgentsPillSegment } from "../../j5/crew/J5ThreadAgents";
import { ComposerQueuedEditBanner } from "./ComposerQueuedEdit";
import { useThreadQueuedCount } from "./ThreadQueueControl";
import { ThreadGuestShareBar } from "./ThreadGuestShareBar";
Expand Down Expand Up @@ -483,7 +484,12 @@ function ThreadDetailBody(
const composerError = useAtomValue(threadComposerErrorsAtom)[selectedThreadKey]?.message ?? null;
const queuedCount = useThreadQueuedCount(props.selectedThreadDetailRef);
const turnSubagents = useThreadTurnSubagents(props.selectedThreadDetailRef);
const agentsSegment = resolveSubagentPillSegment(turnSubagents);
// J5 (case 115): the pill counts the Crew seats and Peer Agents this thread spawned too.
const agentsSegment = useJ5AgentsPillSegment(
props.selectedThreadDetailRef,
turnSubagents,
resolveSubagentPillSegment(turnSubagents),
);
const defaultComposerEditorRef = useRef<ComposerEditorHandle>(null);
const composerEditorRef = props.draftMode?.editorRef ?? defaultComposerEditorRef;
const isProviderSubagent = isProviderNativeSubagentThread(props.selectedThread.source);
Expand Down
33 changes: 1 addition & 32 deletions apps/mobile/src/features/threads/thread-list-v2-items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import { SymbolView, type AppSymbolName } from "../../components/ui/AppSymbol";
import { AppText as Text } from "../../components/ui/AppText";
import { Menu } from "../../components/ui/Menu";
import { AgentIdentityChip } from "../../j5/agents/AgentIdentityChip";
import { CaptainSeats, CaptainSeatsToggle } from "../../j5/crew/CaptainSeats";
import { EnvironmentMachineSymbol } from "../../components/EnvironmentMachineSymbol";
import { ProjectFavicon } from "../../components/ProjectFavicon";
import { ProviderIcon, ProviderInstanceIcon } from "../../components/ProviderIcon";
Expand Down Expand Up @@ -1278,14 +1277,6 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
) : (
<View className="flex-1" />
)}
<CaptainSeatsToggle
thread={thread}
mutedClassName={
selected
? selectedThreadRowColors.mutedForegroundClassName
: rowAppearance.tertiaryForegroundClassName
}
/>
{pr ? (
<Pressable
// Padding cancelled by negative margin grows the touch target into
Expand Down Expand Up @@ -1449,14 +1440,6 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
/>
) : null}
</View>
<CaptainSeatsToggle
thread={thread}
mutedClassName={
selected
? selectedThreadRowColors.mutedForegroundClassName
: rowAppearance.tertiaryForegroundClassName
}
/>
{props.hasQueuedMessages ? <QueuedMessageIcon selected={selected} /> : null}
<Text
className={cn(
Expand All @@ -1477,21 +1460,8 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
</RowPressable>
);

const captainSeats = (
<CaptainSeats
thread={thread}
statusLabels={STATUS_LABEL_BY_STATUS}
onSelectThread={onSelectThread}
/>
);

if (!canOperateThread)
return (
<>
<View style={rowAppearance.swipeContainerStyle}>{rowContent(() => {})}</View>
{captainSeats}
</>
);
return <View style={rowAppearance.swipeContainerStyle}>{rowContent(() => {})}</View>;

return (
<View collapsable={false}>
Expand Down Expand Up @@ -1547,7 +1517,6 @@ export const ThreadListV2Row = memo(function ThreadListV2Row(props: {
</Menu>
)}
</ThreadSwipeable>
{captainSeats}
</View>
);
});
Loading
Loading