From 5efeaf52c91ab53765d570876d704bbe052bd825 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 8 Nov 2026 22:56:30 -0500 Subject: [PATCH 1/5] fix(mobile): an answered question folds to its question and who answered At Checkpoint 3 the folded row split its width between a trimmed question, the answer and the name, so little of any showed, and the opened row repeated the question above itself. Folded, the row now shows the trimmed question and who answered; opened, it shows the full question and answer without the trimmed line. "answered by" reads in the label's own colour, with space before the chevron. Closes #959 Co-Authored-By: Claude Opus 5.5 --- FORK.md | 2 +- .../src/features/threads/thread-work-log.tsx | 12 ++++------ .../src/j5/sharing/sharedConversation.tsx | 23 ++++++------------- apps/mobile/src/j5/upstreamSeams.test.ts | 6 ++++- apps/mobile/src/lib/filePreview.test.ts | 2 +- docs/j5/product/upstream.md | 9 ++++---- 6 files changed, 23 insertions(+), 31 deletions(-) diff --git a/FORK.md b/FORK.md index 92fac016ab9c7..6285f96c65963 100644 --- a/FORK.md +++ b/FORK.md @@ -519,7 +519,7 @@ migrations after upstream migrations. 98. Mobile reads artifacts ([#833](https://github.com/Jacksondr5/j5code/issues/833)), landing two reserved mobile seams. Route registration: `apps/mobile/src/Stack.tsx` imports J5-owned `j5ThreadArtifactRoutes` (`apps/mobile/src/j5/artifacts/routes.ts`) and spreads it after `ThreadFile`, adding the thread-scoped `ThreadArtifacts` list and `ThreadArtifact` viewer (`apps/mobile/src/j5/artifacts/ThreadArtifactsScreen.tsx`), read-only, with no delete. Link resolver: `onMarkdownLinkPress` in `apps/mobile/src/features/threads/ThreadFeed.tsx` makes one call to J5-owned `openArtifactLink` before its thread, media and file branches, so an `artifacts/…` link opens the viewer instead of a missing workspace file; its `fileContextMenu` and `onFileContextMenuAction` each make one call first (`artifactLinkContextMenu`, `onArtifactLinkMenuAction`), so an artifact link's long press offers Open artifact and Copy path instead of workspace-file actions. Links inside a Markdown artifact go through the same helpers in the J5 viewer. Recognition, preview kind and the HTTP read are shared with web in `packages/client-runtime/src/j5/artifacts.ts`. No upstream entry point reaches the list yet; it is one tap from any opened artifact. -99. Mobile's shared conversations show who wrote each message and who answered each prompt, the mobile half of case 80 ([#832](https://github.com/Jacksondr5/j5code/issues/832), register D33, Shared conversations AC9 to AC11, AC14 and AC16). The record and its change feed are `threadAuthors` and `threadAuthorsChanges` in `packages/client-runtime/src/j5/sharing.ts`, beside who reaches the thread (`scopePeople` and `scopePeopleChanges`), which says the thread is shared before any author is recorded (`mayBeSharedConversation`, [#871](https://github.com/Jacksondr5/j5code/issues/871)); and the reading of it (`sharedMessageView`, the typed text, the answers without their mark, the search label) is `packages/client-runtime/src/j5/sharedConversation.ts`, both shared with web. `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` imports `useSharedConversationFeed` from J5-owned `apps/mobile/src/j5/sharing/sharedConversation.tsx` and passes its answer as `ThreadDetailScreen`'s `selectedThreadFeed` in place of `composer.selectedThreadFeed`: an authored message shows as typed, after its note to the agent as a muted line that opens (drawn by case 97's `renderJ5TimelineNotice`), a message whose author is not read yet is held back or shown as this client typed it, and a question's answers lose the platform's `[Answer from …]` mark. Case 97's `useJ5Timeline` also reads the record, so `resolveJ5FeedMessage` puts another person's message on the left and `J5MessageAuthorLine` names them, or says who edited the reader's own. `apps/mobile/src/features/threads/thread-work-log.tsx` mounts `PromptAnswerTail` after a work row's label: a question's answer and who gave it (" · answered by Priya", on an approval too), outside the label so the question truncates first. An answered question's opened row no longer draws the raw item JSON beneath its question and answer, as web draws neither ([#891](https://github.com/Jacksondr5/j5code/issues/891)). `apps/mobile/src/features/threads/ThreadQueueControl.tsx` reads its rows through `useSharedQueuedRuns` where it builds `queuedRuns`, ahead of case 97's hook, so a queued message's row and the text an edit loads are the words typed. `apps/mobile/src/features/threads/thread-search-match.tsx` labels a hit with `threadSearchMatchLabel` instead of "You:" for every user-role hit. `apps/mobile/src/lib/filePreview.test.ts` mocks `sharedConversation.tsx` as it mocks case 97's `timelineState.ts`. Proofs: `apps/mobile/src/j5/sharing/sharedConversationFeed.test.ts`, `apps/mobile/src/j5/a2a/timelinePresentation.test.ts`, `packages/client-runtime/src/j5/sharedConversation.test.ts`, `packages/client-runtime/src/j5/threadSearchMatchLabel.test.ts`, and the four files' rows in `apps/mobile/src/j5/upstreamSeams.test.ts`. On every rebase, keep the calls that test lists. +99. Mobile's shared conversations show who wrote each message and who answered each prompt, the mobile half of case 80 ([#832](https://github.com/Jacksondr5/j5code/issues/832), register D33, Shared conversations AC9 to AC11, AC14 and AC16). The record and its change feed are `threadAuthors` and `threadAuthorsChanges` in `packages/client-runtime/src/j5/sharing.ts`, beside who reaches the thread (`scopePeople` and `scopePeopleChanges`), which says the thread is shared before any author is recorded (`mayBeSharedConversation`, [#871](https://github.com/Jacksondr5/j5code/issues/871)); and the reading of it (`sharedMessageView`, the typed text, the answers without their mark, the search label) is `packages/client-runtime/src/j5/sharedConversation.ts`, both shared with web. `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` imports `useSharedConversationFeed` from J5-owned `apps/mobile/src/j5/sharing/sharedConversation.tsx` and passes its answer as `ThreadDetailScreen`'s `selectedThreadFeed` in place of `composer.selectedThreadFeed`: an authored message shows as typed, after its note to the agent as a muted line that opens (drawn by case 97's `renderJ5TimelineNotice`), a message whose author is not read yet is held back or shown as this client typed it, and a question's answers lose the platform's `[Answer from …]` mark. Case 97's `useJ5Timeline` also reads the record, so `resolveJ5FeedMessage` puts another person's message on the left and `J5MessageAuthorLine` names them, or says who edited the reader's own. `apps/mobile/src/features/threads/thread-work-log.tsx` mounts `PromptAnsweredBy` after a work row's label (" · answered by Priya", on an approval too), outside the label so the label truncates first. A folded answered question shows its trimmed question and who answered; its answer is in the opened row ([#959](https://github.com/Jacksondr5/j5code/issues/959)). Opened, an answered question's header drops the trimmed question, and the row draws no raw item JSON beneath the question and answer, as web draws neither ([#891](https://github.com/Jacksondr5/j5code/issues/891)). `apps/mobile/src/features/threads/ThreadQueueControl.tsx` reads its rows through `useSharedQueuedRuns` where it builds `queuedRuns`, ahead of case 97's hook, so a queued message's row and the text an edit loads are the words typed. `apps/mobile/src/features/threads/thread-search-match.tsx` labels a hit with `threadSearchMatchLabel` instead of "You:" for every user-role hit. `apps/mobile/src/lib/filePreview.test.ts` mocks `sharedConversation.tsx` as it mocks case 97's `timelineState.ts`. Proofs: `apps/mobile/src/j5/sharing/sharedConversationFeed.test.ts`, `apps/mobile/src/j5/a2a/timelinePresentation.test.ts`, `packages/client-runtime/src/j5/sharedConversation.test.ts`, `packages/client-runtime/src/j5/threadSearchMatchLabel.test.ts`, and the four files' rows in `apps/mobile/src/j5/upstreamSeams.test.ts`. On every rebase, keep the calls that test lists. 100. The mobile new-task composer gives a saved agent its own row and lets the slash menu cover the draft rows ([#866](https://github.com/Jacksondr5/j5code/issues/866), Jackson's direction at Checkpoint 1, 2026-11-01; register entry in the wave-2 docs PR). Upstream's composer shows the model in its input row and opens the slash menu above everything stacked over the input. In `apps/mobile/src/features/threads/NewTaskDraftScreen.tsx`, the draft controls render J5-owned `j5/agents/DraftAgentRow.tsx` under the checkout row: the saved-agent picker, then the chosen agent's persona, route and remove action. `apps/mobile/src/features/threads/ThreadComposer.tsx` renders the persona lock control, which wraps upstream's `usesLargeControls` model control since v0.1.7, only when `!props.isDraft`, so a draft's input row stays the editor, and wraps `ComposerPopoverAnchor` in a zero-height `relative` view placed after `draftControls`. The anchor's `bottom-full` (and the Android anchor's measured frame) then starts at the top of the input, so the menu draws over the checkout and agent rows instead of above them. A started thread has no draft controls, so its menu opens where it did. diff --git a/apps/mobile/src/features/threads/thread-work-log.tsx b/apps/mobile/src/features/threads/thread-work-log.tsx index 1896b14cc9b23..2b64a19db39a8 100644 --- a/apps/mobile/src/features/threads/thread-work-log.tsx +++ b/apps/mobile/src/features/threads/thread-work-log.tsx @@ -59,7 +59,7 @@ import { useMarkdownCodeHighlight } from "./markdownCodeHighlightState"; import { AppText as Text } from "../../components/ui/AppText"; import { J5Wordmark } from "../../j5/branding/J5Wordmark"; -import { PromptAnswerTail } from "../../j5/sharing/sharedConversation"; +import { PromptAnsweredBy } from "../../j5/sharing/sharedConversation"; import { BrowserAppIcon } from "./BrowserAppIcon"; import { useAppActive, useReduceMotionEnabled } from "../../lib/appState"; import { cn } from "../../lib/cn"; @@ -1155,17 +1155,13 @@ const ThreadWorkLogRow = function ThreadWorkLogRow( - {displayText} + {answered && expanded ? null : displayText} {answerPreview && !answered ? ( {` ${answerPreview}`} ) : null} - {/* J5 (case 99): the answer and who gave it, outside the label so the question truncates first. */} - + {/* J5 (case 99): who answered, outside the label so the question truncates first. */} + )} diff --git a/apps/mobile/src/j5/sharing/sharedConversation.tsx b/apps/mobile/src/j5/sharing/sharedConversation.tsx index 5aabd0b7480bc..1f1bd6091ddcf 100644 --- a/apps/mobile/src/j5/sharing/sharedConversation.tsx +++ b/apps/mobile/src/j5/sharing/sharedConversation.tsx @@ -135,28 +135,19 @@ export function useSharedConversationFeed( } /** - * The end of a work row for one of the agent's prompts: the answer, then who gave it (AC10). The - * question truncates before either. Who is drawn only for a prompt someone is recorded as answering. + * Who answered one of the agent's prompts, after the prompt's row label: "· answered by Priya" + * (AC10). Nothing for a prompt nobody is recorded as answering, or one still open. */ -export function PromptAnswerTail(props: { +export function PromptAnsweredBy(props: { readonly environmentId: EnvironmentId; readonly item: { readonly threadId: ThreadId }; - readonly answer: string | null; }) { const { answers } = useThreadAuthorIndex(props.environmentId, props.item.threadId); const by = isSettledPrompt(props.item) ? answers.get(props.item.requestId) : undefined; + if (by === undefined) return null; return ( - <> - {props.answer === null ? null : ( - - {props.answer} - - )} - {by === undefined ? null : ( - - · answered by {by.you ? "you" : (by.name ?? "someone")} - - )} - + + · answered by {by.you ? "you" : (by.name ?? "someone")} + ); } diff --git a/apps/mobile/src/j5/upstreamSeams.test.ts b/apps/mobile/src/j5/upstreamSeams.test.ts index 8381da8635f50..2b491a807deb1 100644 --- a/apps/mobile/src/j5/upstreamSeams.test.ts +++ b/apps/mobile/src/j5/upstreamSeams.test.ts @@ -156,7 +156,11 @@ const SEAMS: ReadonlyArray = [ file: "features/threads/thread-work-log.tsx", record: "case 99: answered by", from: "../../j5/sharing/sharedConversation", - reaches: [" ({ sharedAuthors: new Map(), }), })); -vi.mock("../j5/sharing/sharedConversation", () => ({ PromptAnswerTail: () => null })); +vi.mock("../j5/sharing/sharedConversation", () => ({ PromptAnsweredBy: () => null })); vi.mock("../j5/sharing/startAccess", () => ({ useCanForkThread: () => true })); vi.mock("../state/threads", () => ({ environmentThreadShells: {}, threadEnvironment: {} })); vi.mock("../state/entities", () => ({ diff --git a/docs/j5/product/upstream.md b/docs/j5/product/upstream.md index 327f793b79600..da52cb4f07b4d 100644 --- a/docs/j5/product/upstream.md +++ b/docs/j5/product/upstream.md @@ -256,17 +256,17 @@ Letter codes in the Decided lines (SC2, QS1, AR3, and so on) are rulings recorde **Decided:** Jackson, 2026-11-01, at Checkpoint 1 ([#866](https://github.com/Jacksondr5/j5code/issues/866)). Recorded in FORK.md case 100. -#### D45. On mobile, an answered question reads as its question, its answer and who gave it +#### D45. On mobile, an answered question folds to its question and who answered it **Upstream:** a resolved question's work row folds to one truncating label, so a long question hides its answer. Opened, it draws the readable answer, then the raw item as JSON. -**J5:** folded, the answer and who gave it sit after the label, so the question truncates first and both stay visible. Opened, the row stops at the question and its answer. Other work rows, approvals included, keep upstream's detail. +**J5:** folded, the row shows the trimmed question and who answered it. Opened, it shows the full question and the answer, without the trimmed question above them or the raw item below. Other work rows, approvals included, keep upstream's detail. -**Why:** Jackson saw a giant JSON blob under an answer, and a folded row that read as only the question, on his iPhone at Checkpoint 2. His direction was to minimize the row to the question, the answer and who answered. Web draws no raw item either. +**Why:** Jackson saw a giant JSON blob under an answer, and a folded row that read as only the question, on his iPhone at Checkpoint 2. His direction was to minimize the row to the question, the answer and who answered. Web draws no raw item either. At Checkpoint 3 the folded row split its width between a trimmed question, the answer and the name, so little of any showed, and the opened row repeated the question. So the folded row keeps the question and the name, and the answer moves to the opened row. **Consequences:** a small edit in upstream's mobile `thread-work-log.tsx`, carried at each advance (FORK.md case 99). If upstream stops drawing the raw item, drop J5's half of that edit. -**Decided:** Jackson, 2026-11-01, at Checkpoint 2 ([#891](https://github.com/Jacksondr5/j5code/issues/891)). Recorded in FORK.md case 99. +**Decided:** Jackson, 2026-11-01, at Checkpoint 2 ([#891](https://github.com/Jacksondr5/j5code/issues/891)), and 2026-11-08, at Checkpoint 3 ([#959](https://github.com/Jacksondr5/j5code/issues/959)). Recorded in FORK.md case 99. ### Storage, install, and identity @@ -677,3 +677,4 @@ J5 kept a run from resuming after a usage-limit reset when the person had presse - 2026-11-02 — D38 now covers J5's platform notices and prompts, built on web ([#698](https://github.com/Jacksondr5/j5code/issues/698)); the raw card is retired. Upstream's platform messages stay on upstream's own rows, since upstream no longer draws them as user messages (Jackson, 2026-10-24 and 2026-10-31; Captain's call on the build, Jackson told). - 2026-11-07 — the agent tools after linked environments: D1 names delegates beside subagents, keeps `delegate_task` for what the provider's own subagent can't do (settling #336) and lets a persona be delegated to another J5 machine; D2 admits `t3_thread_wait` and `t3_thread_interrupt`, retires `j5_stop_agent` for interrupt with J5's Captain rule, admits launch for link sessions only, keeps delegates launched from another machine out of the ledger, and replaces the naming rule; D42 holds a delegate on another J5 machine to that machine's lists (Jackson, 2026-11-06 and 2026-11-07; [record](../worklog/2026-11-07-agent-tool-boundary-session.md)). - 2026-11-07 — the advance onto upstream's stable v0.1.7: D2 admits the link tools and the pull-request link tools (88 tools), with J5's own refusal to fenced link work; D4 resumes a held queue on any J5 delivery, idle or busy, beside upstream's release of unattended held messages, and a person no longer reorders by hand; D6 names upstream's handoff-budget fresh start as a third deliberate case, with its own notice; D18 follows upstream's merged model control; D19 adds managed policy, the protect drop-in, the compile caches, the pairing app link and j5.codes thread links; D20 keeps the per-desktop track switch (#927 for a fleet switch) and retires the wait for a published release; D22 approved and moved out of Awaiting a decision; D25 points the star prompt at J5's repository; D26 adds the in-app triage; D35's upstream line now has release notes on every track; D36 adds `j5 up`'s hint; D38 gives queued messages their sides and sender on upstream's queue row; D40 hides only the guest-links row in Labs; D42 holds a link session's plain delegate to the target's lists; D24 retired, its aliases removed (Jackson, 2026-11-05 to 2026-11-07; FORK.md's pin log). +- 2026-11-08 — D45: a folded answered question shows its trimmed question and who answered, and the opened row drops the repeated question (Jackson, Checkpoint 3; [#959](https://github.com/Jacksondr5/j5code/issues/959)). From c262202977d0318dedc8c11e3706ac8c2c1fac7f Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 8 Nov 2026 22:59:36 -0500 Subject: [PATCH 2/5] docs(j5): D45's update moves to the wave 4 docs PR Co-Authored-By: Claude Opus 5.5 --- docs/j5/product/upstream.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/j5/product/upstream.md b/docs/j5/product/upstream.md index da52cb4f07b4d..327f793b79600 100644 --- a/docs/j5/product/upstream.md +++ b/docs/j5/product/upstream.md @@ -256,17 +256,17 @@ Letter codes in the Decided lines (SC2, QS1, AR3, and so on) are rulings recorde **Decided:** Jackson, 2026-11-01, at Checkpoint 1 ([#866](https://github.com/Jacksondr5/j5code/issues/866)). Recorded in FORK.md case 100. -#### D45. On mobile, an answered question folds to its question and who answered it +#### D45. On mobile, an answered question reads as its question, its answer and who gave it **Upstream:** a resolved question's work row folds to one truncating label, so a long question hides its answer. Opened, it draws the readable answer, then the raw item as JSON. -**J5:** folded, the row shows the trimmed question and who answered it. Opened, it shows the full question and the answer, without the trimmed question above them or the raw item below. Other work rows, approvals included, keep upstream's detail. +**J5:** folded, the answer and who gave it sit after the label, so the question truncates first and both stay visible. Opened, the row stops at the question and its answer. Other work rows, approvals included, keep upstream's detail. -**Why:** Jackson saw a giant JSON blob under an answer, and a folded row that read as only the question, on his iPhone at Checkpoint 2. His direction was to minimize the row to the question, the answer and who answered. Web draws no raw item either. At Checkpoint 3 the folded row split its width between a trimmed question, the answer and the name, so little of any showed, and the opened row repeated the question. So the folded row keeps the question and the name, and the answer moves to the opened row. +**Why:** Jackson saw a giant JSON blob under an answer, and a folded row that read as only the question, on his iPhone at Checkpoint 2. His direction was to minimize the row to the question, the answer and who answered. Web draws no raw item either. **Consequences:** a small edit in upstream's mobile `thread-work-log.tsx`, carried at each advance (FORK.md case 99). If upstream stops drawing the raw item, drop J5's half of that edit. -**Decided:** Jackson, 2026-11-01, at Checkpoint 2 ([#891](https://github.com/Jacksondr5/j5code/issues/891)), and 2026-11-08, at Checkpoint 3 ([#959](https://github.com/Jacksondr5/j5code/issues/959)). Recorded in FORK.md case 99. +**Decided:** Jackson, 2026-11-01, at Checkpoint 2 ([#891](https://github.com/Jacksondr5/j5code/issues/891)). Recorded in FORK.md case 99. ### Storage, install, and identity @@ -677,4 +677,3 @@ J5 kept a run from resuming after a usage-limit reset when the person had presse - 2026-11-02 — D38 now covers J5's platform notices and prompts, built on web ([#698](https://github.com/Jacksondr5/j5code/issues/698)); the raw card is retired. Upstream's platform messages stay on upstream's own rows, since upstream no longer draws them as user messages (Jackson, 2026-10-24 and 2026-10-31; Captain's call on the build, Jackson told). - 2026-11-07 — the agent tools after linked environments: D1 names delegates beside subagents, keeps `delegate_task` for what the provider's own subagent can't do (settling #336) and lets a persona be delegated to another J5 machine; D2 admits `t3_thread_wait` and `t3_thread_interrupt`, retires `j5_stop_agent` for interrupt with J5's Captain rule, admits launch for link sessions only, keeps delegates launched from another machine out of the ledger, and replaces the naming rule; D42 holds a delegate on another J5 machine to that machine's lists (Jackson, 2026-11-06 and 2026-11-07; [record](../worklog/2026-11-07-agent-tool-boundary-session.md)). - 2026-11-07 — the advance onto upstream's stable v0.1.7: D2 admits the link tools and the pull-request link tools (88 tools), with J5's own refusal to fenced link work; D4 resumes a held queue on any J5 delivery, idle or busy, beside upstream's release of unattended held messages, and a person no longer reorders by hand; D6 names upstream's handoff-budget fresh start as a third deliberate case, with its own notice; D18 follows upstream's merged model control; D19 adds managed policy, the protect drop-in, the compile caches, the pairing app link and j5.codes thread links; D20 keeps the per-desktop track switch (#927 for a fleet switch) and retires the wait for a published release; D22 approved and moved out of Awaiting a decision; D25 points the star prompt at J5's repository; D26 adds the in-app triage; D35's upstream line now has release notes on every track; D36 adds `j5 up`'s hint; D38 gives queued messages their sides and sender on upstream's queue row; D40 hides only the guest-links row in Labs; D42 holds a link session's plain delegate to the target's lists; D24 retired, its aliases removed (Jackson, 2026-11-05 to 2026-11-07; FORK.md's pin log). -- 2026-11-08 — D45: a folded answered question shows its trimmed question and who answered, and the opened row drops the repeated question (Jackson, Checkpoint 3; [#959](https://github.com/Jacksondr5/j5code/issues/959)). From 9bdcc9090d1c7ed40f4813d728256d7b2bafed26 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 8 Nov 2026 23:02:09 -0500 Subject: [PATCH 3/5] fix(mobile): an opened answered question reads "Answered by Priya", without a stray dot The opened header has no question text, so the separator dot led the line on its own. Refs #959 Co-Authored-By: Claude Opus 5.5 --- apps/mobile/src/features/threads/thread-work-log.tsx | 6 +++++- apps/mobile/src/j5/sharing/sharedConversation.tsx | 4 +++- apps/mobile/src/j5/upstreamSeams.test.ts | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/features/threads/thread-work-log.tsx b/apps/mobile/src/features/threads/thread-work-log.tsx index 2b64a19db39a8..43a9931203340 100644 --- a/apps/mobile/src/features/threads/thread-work-log.tsx +++ b/apps/mobile/src/features/threads/thread-work-log.tsx @@ -1161,7 +1161,11 @@ const ThreadWorkLogRow = function ThreadWorkLogRow( ) : null} {/* J5 (case 99): who answered, outside the label so the question truncates first. */} - + )} diff --git a/apps/mobile/src/j5/sharing/sharedConversation.tsx b/apps/mobile/src/j5/sharing/sharedConversation.tsx index 1f1bd6091ddcf..8edf9461b0f65 100644 --- a/apps/mobile/src/j5/sharing/sharedConversation.tsx +++ b/apps/mobile/src/j5/sharing/sharedConversation.tsx @@ -141,13 +141,15 @@ export function useSharedConversationFeed( export function PromptAnsweredBy(props: { readonly environmentId: EnvironmentId; readonly item: { readonly threadId: ThreadId }; + /** Nothing precedes it in the row, so it reads as a sentence rather than a trailing clause. */ + readonly alone?: boolean; }) { const { answers } = useThreadAuthorIndex(props.environmentId, props.item.threadId); const by = isSettledPrompt(props.item) ? answers.get(props.item.requestId) : undefined; if (by === undefined) return null; return ( - · answered by {by.you ? "you" : (by.name ?? "someone")} + {props.alone ? "Answered by" : "· answered by"} {by.you ? "you" : (by.name ?? "someone")} ); } diff --git a/apps/mobile/src/j5/upstreamSeams.test.ts b/apps/mobile/src/j5/upstreamSeams.test.ts index 2b491a807deb1..f7d1c5649a035 100644 --- a/apps/mobile/src/j5/upstreamSeams.test.ts +++ b/apps/mobile/src/j5/upstreamSeams.test.ts @@ -158,6 +158,7 @@ const SEAMS: ReadonlyArray = [ from: "../../j5/sharing/sharedConversation", reaches: [ " Date: Sun, 8 Nov 2026 23:51:26 -0500 Subject: [PATCH 4/5] fix(mobile): an opened answered question with no recorded answerer reads "Answered" Co-Authored-By: Claude Opus 5.5 --- FORK.md | 2 +- apps/mobile/src/j5/sharing/sharedConversation.tsx | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/FORK.md b/FORK.md index 6285f96c65963..d00a8051c9159 100644 --- a/FORK.md +++ b/FORK.md @@ -519,7 +519,7 @@ migrations after upstream migrations. 98. Mobile reads artifacts ([#833](https://github.com/Jacksondr5/j5code/issues/833)), landing two reserved mobile seams. Route registration: `apps/mobile/src/Stack.tsx` imports J5-owned `j5ThreadArtifactRoutes` (`apps/mobile/src/j5/artifacts/routes.ts`) and spreads it after `ThreadFile`, adding the thread-scoped `ThreadArtifacts` list and `ThreadArtifact` viewer (`apps/mobile/src/j5/artifacts/ThreadArtifactsScreen.tsx`), read-only, with no delete. Link resolver: `onMarkdownLinkPress` in `apps/mobile/src/features/threads/ThreadFeed.tsx` makes one call to J5-owned `openArtifactLink` before its thread, media and file branches, so an `artifacts/…` link opens the viewer instead of a missing workspace file; its `fileContextMenu` and `onFileContextMenuAction` each make one call first (`artifactLinkContextMenu`, `onArtifactLinkMenuAction`), so an artifact link's long press offers Open artifact and Copy path instead of workspace-file actions. Links inside a Markdown artifact go through the same helpers in the J5 viewer. Recognition, preview kind and the HTTP read are shared with web in `packages/client-runtime/src/j5/artifacts.ts`. No upstream entry point reaches the list yet; it is one tap from any opened artifact. -99. Mobile's shared conversations show who wrote each message and who answered each prompt, the mobile half of case 80 ([#832](https://github.com/Jacksondr5/j5code/issues/832), register D33, Shared conversations AC9 to AC11, AC14 and AC16). The record and its change feed are `threadAuthors` and `threadAuthorsChanges` in `packages/client-runtime/src/j5/sharing.ts`, beside who reaches the thread (`scopePeople` and `scopePeopleChanges`), which says the thread is shared before any author is recorded (`mayBeSharedConversation`, [#871](https://github.com/Jacksondr5/j5code/issues/871)); and the reading of it (`sharedMessageView`, the typed text, the answers without their mark, the search label) is `packages/client-runtime/src/j5/sharedConversation.ts`, both shared with web. `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` imports `useSharedConversationFeed` from J5-owned `apps/mobile/src/j5/sharing/sharedConversation.tsx` and passes its answer as `ThreadDetailScreen`'s `selectedThreadFeed` in place of `composer.selectedThreadFeed`: an authored message shows as typed, after its note to the agent as a muted line that opens (drawn by case 97's `renderJ5TimelineNotice`), a message whose author is not read yet is held back or shown as this client typed it, and a question's answers lose the platform's `[Answer from …]` mark. Case 97's `useJ5Timeline` also reads the record, so `resolveJ5FeedMessage` puts another person's message on the left and `J5MessageAuthorLine` names them, or says who edited the reader's own. `apps/mobile/src/features/threads/thread-work-log.tsx` mounts `PromptAnsweredBy` after a work row's label (" · answered by Priya", on an approval too), outside the label so the label truncates first. A folded answered question shows its trimmed question and who answered; its answer is in the opened row ([#959](https://github.com/Jacksondr5/j5code/issues/959)). Opened, an answered question's header drops the trimmed question, and the row draws no raw item JSON beneath the question and answer, as web draws neither ([#891](https://github.com/Jacksondr5/j5code/issues/891)). `apps/mobile/src/features/threads/ThreadQueueControl.tsx` reads its rows through `useSharedQueuedRuns` where it builds `queuedRuns`, ahead of case 97's hook, so a queued message's row and the text an edit loads are the words typed. `apps/mobile/src/features/threads/thread-search-match.tsx` labels a hit with `threadSearchMatchLabel` instead of "You:" for every user-role hit. `apps/mobile/src/lib/filePreview.test.ts` mocks `sharedConversation.tsx` as it mocks case 97's `timelineState.ts`. Proofs: `apps/mobile/src/j5/sharing/sharedConversationFeed.test.ts`, `apps/mobile/src/j5/a2a/timelinePresentation.test.ts`, `packages/client-runtime/src/j5/sharedConversation.test.ts`, `packages/client-runtime/src/j5/threadSearchMatchLabel.test.ts`, and the four files' rows in `apps/mobile/src/j5/upstreamSeams.test.ts`. On every rebase, keep the calls that test lists. +99. Mobile's shared conversations show who wrote each message and who answered each prompt, the mobile half of case 80 ([#832](https://github.com/Jacksondr5/j5code/issues/832), register D33, Shared conversations AC9 to AC11, AC14 and AC16). The record and its change feed are `threadAuthors` and `threadAuthorsChanges` in `packages/client-runtime/src/j5/sharing.ts`, beside who reaches the thread (`scopePeople` and `scopePeopleChanges`), which says the thread is shared before any author is recorded (`mayBeSharedConversation`, [#871](https://github.com/Jacksondr5/j5code/issues/871)); and the reading of it (`sharedMessageView`, the typed text, the answers without their mark, the search label) is `packages/client-runtime/src/j5/sharedConversation.ts`, both shared with web. `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` imports `useSharedConversationFeed` from J5-owned `apps/mobile/src/j5/sharing/sharedConversation.tsx` and passes its answer as `ThreadDetailScreen`'s `selectedThreadFeed` in place of `composer.selectedThreadFeed`: an authored message shows as typed, after its note to the agent as a muted line that opens (drawn by case 97's `renderJ5TimelineNotice`), a message whose author is not read yet is held back or shown as this client typed it, and a question's answers lose the platform's `[Answer from …]` mark. Case 97's `useJ5Timeline` also reads the record, so `resolveJ5FeedMessage` puts another person's message on the left and `J5MessageAuthorLine` names them, or says who edited the reader's own. `apps/mobile/src/features/threads/thread-work-log.tsx` mounts `PromptAnsweredBy` after a work row's label (" · answered by Priya", on an approval too), outside the label so the label truncates first. A folded answered question shows its trimmed question and who answered; its answer is in the opened row ([#959](https://github.com/Jacksondr5/j5code/issues/959)). Opened, an answered question's header drops the trimmed question for "Answered by Priya", or "Answered" where no one is recorded, and the row draws no raw item JSON beneath the question and answer, as web draws neither ([#891](https://github.com/Jacksondr5/j5code/issues/891)). `apps/mobile/src/features/threads/ThreadQueueControl.tsx` reads its rows through `useSharedQueuedRuns` where it builds `queuedRuns`, ahead of case 97's hook, so a queued message's row and the text an edit loads are the words typed. `apps/mobile/src/features/threads/thread-search-match.tsx` labels a hit with `threadSearchMatchLabel` instead of "You:" for every user-role hit. `apps/mobile/src/lib/filePreview.test.ts` mocks `sharedConversation.tsx` as it mocks case 97's `timelineState.ts`. Proofs: `apps/mobile/src/j5/sharing/sharedConversationFeed.test.ts`, `apps/mobile/src/j5/a2a/timelinePresentation.test.ts`, `packages/client-runtime/src/j5/sharedConversation.test.ts`, `packages/client-runtime/src/j5/threadSearchMatchLabel.test.ts`, and the four files' rows in `apps/mobile/src/j5/upstreamSeams.test.ts`. On every rebase, keep the calls that test lists. 100. The mobile new-task composer gives a saved agent its own row and lets the slash menu cover the draft rows ([#866](https://github.com/Jacksondr5/j5code/issues/866), Jackson's direction at Checkpoint 1, 2026-11-01; register entry in the wave-2 docs PR). Upstream's composer shows the model in its input row and opens the slash menu above everything stacked over the input. In `apps/mobile/src/features/threads/NewTaskDraftScreen.tsx`, the draft controls render J5-owned `j5/agents/DraftAgentRow.tsx` under the checkout row: the saved-agent picker, then the chosen agent's persona, route and remove action. `apps/mobile/src/features/threads/ThreadComposer.tsx` renders the persona lock control, which wraps upstream's `usesLargeControls` model control since v0.1.7, only when `!props.isDraft`, so a draft's input row stays the editor, and wraps `ComposerPopoverAnchor` in a zero-height `relative` view placed after `draftControls`. The anchor's `bottom-full` (and the Android anchor's measured frame) then starts at the top of the input, so the menu draws over the checkout and agent rows instead of above them. A started thread has no draft controls, so its menu opens where it did. diff --git a/apps/mobile/src/j5/sharing/sharedConversation.tsx b/apps/mobile/src/j5/sharing/sharedConversation.tsx index 8edf9461b0f65..063c60aaed245 100644 --- a/apps/mobile/src/j5/sharing/sharedConversation.tsx +++ b/apps/mobile/src/j5/sharing/sharedConversation.tsx @@ -141,15 +141,20 @@ export function useSharedConversationFeed( export function PromptAnsweredBy(props: { readonly environmentId: EnvironmentId; readonly item: { readonly threadId: ThreadId }; - /** Nothing precedes it in the row, so it reads as a sentence rather than a trailing clause. */ + /** + * Nothing precedes it in the row, so it reads as a sentence rather than a trailing clause, and + * says "Answered" where no one is recorded (an unshared thread), so the header is never empty. + */ readonly alone?: boolean; }) { const { answers } = useThreadAuthorIndex(props.environmentId, props.item.threadId); const by = isSettledPrompt(props.item) ? answers.get(props.item.requestId) : undefined; - if (by === undefined) return null; + if (by === undefined && !props.alone) return null; return ( - {props.alone ? "Answered by" : "· answered by"} {by.you ? "you" : (by.name ?? "someone")} + {by === undefined + ? "Answered" + : `${props.alone ? "Answered by" : "· answered by"} ${by.you ? "you" : (by.name ?? "someone")}`} ); } From ddb4ad3c3c62af081742371a09f87f6274efd4d5 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 8 Nov 2026 23:54:22 -0500 Subject: [PATCH 5/5] fix(mobile): an answer without its question text keeps the question in the header Co-Authored-By: Claude Opus 5.5 --- FORK.md | 2 +- apps/mobile/src/features/threads/thread-work-log.tsx | 8 ++++++-- apps/mobile/src/j5/upstreamSeams.test.ts | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/FORK.md b/FORK.md index d00a8051c9159..bb69e0b20999f 100644 --- a/FORK.md +++ b/FORK.md @@ -519,7 +519,7 @@ migrations after upstream migrations. 98. Mobile reads artifacts ([#833](https://github.com/Jacksondr5/j5code/issues/833)), landing two reserved mobile seams. Route registration: `apps/mobile/src/Stack.tsx` imports J5-owned `j5ThreadArtifactRoutes` (`apps/mobile/src/j5/artifacts/routes.ts`) and spreads it after `ThreadFile`, adding the thread-scoped `ThreadArtifacts` list and `ThreadArtifact` viewer (`apps/mobile/src/j5/artifacts/ThreadArtifactsScreen.tsx`), read-only, with no delete. Link resolver: `onMarkdownLinkPress` in `apps/mobile/src/features/threads/ThreadFeed.tsx` makes one call to J5-owned `openArtifactLink` before its thread, media and file branches, so an `artifacts/…` link opens the viewer instead of a missing workspace file; its `fileContextMenu` and `onFileContextMenuAction` each make one call first (`artifactLinkContextMenu`, `onArtifactLinkMenuAction`), so an artifact link's long press offers Open artifact and Copy path instead of workspace-file actions. Links inside a Markdown artifact go through the same helpers in the J5 viewer. Recognition, preview kind and the HTTP read are shared with web in `packages/client-runtime/src/j5/artifacts.ts`. No upstream entry point reaches the list yet; it is one tap from any opened artifact. -99. Mobile's shared conversations show who wrote each message and who answered each prompt, the mobile half of case 80 ([#832](https://github.com/Jacksondr5/j5code/issues/832), register D33, Shared conversations AC9 to AC11, AC14 and AC16). The record and its change feed are `threadAuthors` and `threadAuthorsChanges` in `packages/client-runtime/src/j5/sharing.ts`, beside who reaches the thread (`scopePeople` and `scopePeopleChanges`), which says the thread is shared before any author is recorded (`mayBeSharedConversation`, [#871](https://github.com/Jacksondr5/j5code/issues/871)); and the reading of it (`sharedMessageView`, the typed text, the answers without their mark, the search label) is `packages/client-runtime/src/j5/sharedConversation.ts`, both shared with web. `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` imports `useSharedConversationFeed` from J5-owned `apps/mobile/src/j5/sharing/sharedConversation.tsx` and passes its answer as `ThreadDetailScreen`'s `selectedThreadFeed` in place of `composer.selectedThreadFeed`: an authored message shows as typed, after its note to the agent as a muted line that opens (drawn by case 97's `renderJ5TimelineNotice`), a message whose author is not read yet is held back or shown as this client typed it, and a question's answers lose the platform's `[Answer from …]` mark. Case 97's `useJ5Timeline` also reads the record, so `resolveJ5FeedMessage` puts another person's message on the left and `J5MessageAuthorLine` names them, or says who edited the reader's own. `apps/mobile/src/features/threads/thread-work-log.tsx` mounts `PromptAnsweredBy` after a work row's label (" · answered by Priya", on an approval too), outside the label so the label truncates first. A folded answered question shows its trimmed question and who answered; its answer is in the opened row ([#959](https://github.com/Jacksondr5/j5code/issues/959)). Opened, an answered question's header drops the trimmed question for "Answered by Priya", or "Answered" where no one is recorded, and the row draws no raw item JSON beneath the question and answer, as web draws neither ([#891](https://github.com/Jacksondr5/j5code/issues/891)). `apps/mobile/src/features/threads/ThreadQueueControl.tsx` reads its rows through `useSharedQueuedRuns` where it builds `queuedRuns`, ahead of case 97's hook, so a queued message's row and the text an edit loads are the words typed. `apps/mobile/src/features/threads/thread-search-match.tsx` labels a hit with `threadSearchMatchLabel` instead of "You:" for every user-role hit. `apps/mobile/src/lib/filePreview.test.ts` mocks `sharedConversation.tsx` as it mocks case 97's `timelineState.ts`. Proofs: `apps/mobile/src/j5/sharing/sharedConversationFeed.test.ts`, `apps/mobile/src/j5/a2a/timelinePresentation.test.ts`, `packages/client-runtime/src/j5/sharedConversation.test.ts`, `packages/client-runtime/src/j5/threadSearchMatchLabel.test.ts`, and the four files' rows in `apps/mobile/src/j5/upstreamSeams.test.ts`. On every rebase, keep the calls that test lists. +99. Mobile's shared conversations show who wrote each message and who answered each prompt, the mobile half of case 80 ([#832](https://github.com/Jacksondr5/j5code/issues/832), register D33, Shared conversations AC9 to AC11, AC14 and AC16). The record and its change feed are `threadAuthors` and `threadAuthorsChanges` in `packages/client-runtime/src/j5/sharing.ts`, beside who reaches the thread (`scopePeople` and `scopePeopleChanges`), which says the thread is shared before any author is recorded (`mayBeSharedConversation`, [#871](https://github.com/Jacksondr5/j5code/issues/871)); and the reading of it (`sharedMessageView`, the typed text, the answers without their mark, the search label) is `packages/client-runtime/src/j5/sharedConversation.ts`, both shared with web. `apps/mobile/src/features/threads/ThreadRouteScreen.tsx` imports `useSharedConversationFeed` from J5-owned `apps/mobile/src/j5/sharing/sharedConversation.tsx` and passes its answer as `ThreadDetailScreen`'s `selectedThreadFeed` in place of `composer.selectedThreadFeed`: an authored message shows as typed, after its note to the agent as a muted line that opens (drawn by case 97's `renderJ5TimelineNotice`), a message whose author is not read yet is held back or shown as this client typed it, and a question's answers lose the platform's `[Answer from …]` mark. Case 97's `useJ5Timeline` also reads the record, so `resolveJ5FeedMessage` puts another person's message on the left and `J5MessageAuthorLine` names them, or says who edited the reader's own. `apps/mobile/src/features/threads/thread-work-log.tsx` mounts `PromptAnsweredBy` after a work row's label (" · answered by Priya", on an approval too), outside the label so the label truncates first. A folded answered question shows its trimmed question and who answered; its answer is in the opened row ([#959](https://github.com/Jacksondr5/j5code/issues/959)). Opened, an answered question whose answer records its question text drops the trimmed question from the header for "Answered by Priya", or "Answered" where no one is recorded, and the row draws no raw item JSON beneath the question and answer, as web draws neither ([#891](https://github.com/Jacksondr5/j5code/issues/891)). `apps/mobile/src/features/threads/ThreadQueueControl.tsx` reads its rows through `useSharedQueuedRuns` where it builds `queuedRuns`, ahead of case 97's hook, so a queued message's row and the text an edit loads are the words typed. `apps/mobile/src/features/threads/thread-search-match.tsx` labels a hit with `threadSearchMatchLabel` instead of "You:" for every user-role hit. `apps/mobile/src/lib/filePreview.test.ts` mocks `sharedConversation.tsx` as it mocks case 97's `timelineState.ts`. Proofs: `apps/mobile/src/j5/sharing/sharedConversationFeed.test.ts`, `apps/mobile/src/j5/a2a/timelinePresentation.test.ts`, `packages/client-runtime/src/j5/sharedConversation.test.ts`, `packages/client-runtime/src/j5/threadSearchMatchLabel.test.ts`, and the four files' rows in `apps/mobile/src/j5/upstreamSeams.test.ts`. On every rebase, keep the calls that test lists. 100. The mobile new-task composer gives a saved agent its own row and lets the slash menu cover the draft rows ([#866](https://github.com/Jacksondr5/j5code/issues/866), Jackson's direction at Checkpoint 1, 2026-11-01; register entry in the wave-2 docs PR). Upstream's composer shows the model in its input row and opens the slash menu above everything stacked over the input. In `apps/mobile/src/features/threads/NewTaskDraftScreen.tsx`, the draft controls render J5-owned `j5/agents/DraftAgentRow.tsx` under the checkout row: the saved-agent picker, then the chosen agent's persona, route and remove action. `apps/mobile/src/features/threads/ThreadComposer.tsx` renders the persona lock control, which wraps upstream's `usesLargeControls` model control since v0.1.7, only when `!props.isDraft`, so a draft's input row stays the editor, and wraps `ComposerPopoverAnchor` in a zero-height `relative` view placed after `draftControls`. The anchor's `bottom-full` (and the Android anchor's measured frame) then starts at the top of the input, so the menu draws over the checkout and agent rows instead of above them. A started thread has no draft controls, so its menu opens where it did. diff --git a/apps/mobile/src/features/threads/thread-work-log.tsx b/apps/mobile/src/features/threads/thread-work-log.tsx index 43a9931203340..a588b37e68f5d 100644 --- a/apps/mobile/src/features/threads/thread-work-log.tsx +++ b/apps/mobile/src/features/threads/thread-work-log.tsx @@ -1068,6 +1068,10 @@ const ThreadWorkLogRow = function ThreadWorkLogRow( : null; const answered = row.workEntry.questionAnswer !== undefined && hasQuestionAnswer(row.workEntry.questionAnswer); + // J5 (case 99): opened, the history below repeats the question, so the header drops it; an + // answer recorded before the history carried question text keeps it. + const historyHasQuestion = + answered && Object.values(row.workEntry.questionAnswer?.questionTextById ?? {}).some(Boolean); const accessiblePreview = [previewText, answerPreview].filter(Boolean).join(": "); const displayText = row.groupStandIn?.label ?? workEntryRowLabel(row.workEntry, expanded); const isSystemNotice = row.projectedItem.item.type === "system_notice"; @@ -1155,7 +1159,7 @@ const ThreadWorkLogRow = function ThreadWorkLogRow( - {answered && expanded ? null : displayText} + {historyHasQuestion && expanded ? null : displayText} {answerPreview && !answered ? ( {` ${answerPreview}`} ) : null} @@ -1164,7 +1168,7 @@ const ThreadWorkLogRow = function ThreadWorkLogRow( )} diff --git a/apps/mobile/src/j5/upstreamSeams.test.ts b/apps/mobile/src/j5/upstreamSeams.test.ts index f7d1c5649a035..027f5f0ffaf9a 100644 --- a/apps/mobile/src/j5/upstreamSeams.test.ts +++ b/apps/mobile/src/j5/upstreamSeams.test.ts @@ -158,9 +158,9 @@ const SEAMS: ReadonlyArray = [ from: "../../j5/sharing/sharedConversation", reaches: [ "