Skip to content

feat(mobile): an ask's links and images open in the sender's thread - #1045

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-1042
Nov 14, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-1042

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Problem

On web, an ask's workspace file links and artifacts/… links open, and its images resolve, in the sender's context (HumanInboxPage.tsx InboxMessage). On the phone, the Inbox and the Captain's pinned ask rendered the Markdown with no link handlers or image resolver, so those links did nothing and images didn't load. Closes #1042 (Jackson: build).

What changed

  • The Inbox and the pinned ask render an ask (and its follow-ups) through SenderMarkdown. It reads the links in the sender's thread, with the workspace being that thread's worktree or else its project's root, as web's projectScriptCwd does:
    • an artifacts/… link opens J5's artifact viewer;
    • another file link opens the file;
    • an image resolves from that workspace;
    • a web link opens externally.
  • With no sender thread, or a project this device doesn't know, the message renders as before, with plain links.
  • The artifact viewer's own ArtifactMarkdown, which already did this for artifacts, moves into j5/artifacts/WorkspaceMarkdown.tsx and is shared. The viewer behaves the same.

Docs (for the wave docs PR)

  • docs/j5/user/artifacts.md line 25: replace "On mobile, tap an artifacts/… link in a thread to read that artifact." with "On mobile, tap an artifacts/… link in a thread or an ask to read that artifact."

No guide or definition says an ask's links don't work on mobile, so nothing else changes.

UI changes

An Inbox ask from a sender in a worktree whose thread isn't open:

Android before Android after
An Inbox ask from a sender in a worktree whose thread isn't open, Android before An Inbox ask from a sender in a worktree whose thread isn't open, Android after

The Captain's pinned ask with a file, an artifact and an image:

Android before Android after
The Captain's pinned ask with a file, an artifact and an image, Android before The Captain's pinned ask with a file, an artifact and an image, Android after

The Inbox opens the worktree-only file:

The Inbox opens the worktree-only file, Android after

The Inbox opens the notes artifact:

The Inbox opens the notes artifact, Android after

The Inbox's web link opens the browser:

The Inbox's web link opens the browser, Android after

The pinned ask opens the Captain's file:

The pinned ask opens the Captain's file, Android after

The pinned ask opens the Captain's notes artifact:

The pinned ask opens the Captain's notes artifact, Android after

The pinned ask scrolled to the image and the web link:

The pinned ask scrolled to the image and the web link, Android after

The pinned ask's web link opens the browser:

The pinned ask's web link opens the browser, Android after

Live testing

Android: PASS at eb0c46fed5 against base de65b7008c (crew tester, report test-reports/pr-1045/eb0c46fed5.md, stills only because recording is broken, #1034). Real Haiku 5.5 (Low) agents sent both asks, and both answers were delivered.

  • Inbox: the file link, the artifacts/… link, the image and the web link all work before the sender's thread was ever opened on the phone. The file and image exist only in the sender's J5 worktree, and the image request went to that worktree.
  • Captain's pinned ask: the same link and image checks pass, the inner scroll works, and Back returns from each viewer.

Not exercised: dark theme, and remote or tunnel connections.

iOS: not run on a Simulator for this wave: the Mac's swap is nearly full. Jackson checks iOS on his iPhone at Checkpoint 8. The code is the same JS on both platforms.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior: no new logic; the link handling moved unchanged from the artifact viewer
  • UI changes: before/after above, and a video for motion or interaction
  • Live testing: the section above says what ran live and what did not
  • Upstream-owned files: none
  • Upstream product: no change
  • Surfaces: mobile Inbox and pinned ask (iOS and Android); web already does this; the artifact viewer is unchanged
  • Docs: the line above, for the wave docs PR

Claude Opus 5.5 in J5 Code (Claude Code harness).

🤖 Generated with Claude Code

The phone rendered an ask's Markdown with no link handlers or image
resolver, so its workspace file links, `artifacts/…` links and images did
nothing. The Inbox and the Captain's pinned ask now read them as web
does, in the sender's thread and worktree (or its project's root).

The artifact viewer's Markdown, which already opens these links, becomes
the shared WorkspaceMarkdown that all three use.

Closes #1042

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 14, 2026 9:43pm UTC

Request Review

@github-actions github-actions Bot added the vouch:trusted Author is trusted by repo permissions or the VOUCHED list. label Nov 14, 2026
@github-actions github-actions Bot added the size:L 100-499 effective changed lines (test files excluded in mixed PRs). label Nov 14, 2026
@Jacksondr5

Copy link
Copy Markdown
Owner Author

Panel review: reviewer-opus and reviewer-sol, at 3f182b1

Verdict: approve once one small fix lands.

Should fix

Use mobile's existing useThreadCwd for the sender's workspace (apps/mobile/src/j5/artifacts/WorkspaceMarkdown.tsx, SenderMarkdown).

  • What the code does now: SenderMarkdown takes the worktree from useThreadShell alone. When the sender's shell isn't on this device, it uses worktreePath: null and renders against the project root at once.
  • Where that goes wrong: a sender working in a worktree whose shell this phone hasn't loaded, such as an older sender on a newly connected phone.
    • A relative image like ![preview](preview.png) resolves under the project root. It then fails, or shows the same path from the other checkout.
    • An absolute link into the worktree isn't recognised as a workspace file, so it doesn't open.
  • The existing helper: useThreadCwd(ref) in state/use-selected-thread-worktree.ts already handles this.
    • When the shell is missing, it loads the thread's details.
    • It prefers the worktree path from the shell or the details, then falls back to the project root.
    • Until it knows, it returns null.
  • The file screen agrees with it. ThreadFile resolves its cwd the same way, through useSelectedThreadWorktree, so links and images would match the screen they open.
  • Fix:
    • const cwd = useThreadCwd(senderRef).
    • Render plain Markdown while senderThreadId or cwd is null.
    • Pass cwd as workspaceRoot.
    • This drops the useThreadShell and useProject reads and the projectScriptCwd call, and probably the projectId prop.
  • Cost: the details are loaded only when the shell is missing, and only for an expanded ask.

Web has the same shell-only fallback. That can be a separate follow-up and isn't needed for this PR.

Checked and fine

  • The move is unchanged. ArtifactMarkdown moved to WorkspaceMarkdown as is, and the artifact viewer still uses it.
  • Navigation from the Inbox works.
    • ThreadFile and ThreadArtifact are root-stack screens in Stack.tsx, next to Inbox.
    • ThreadFile picks its thread from its own route parameters (useThreadSelection reads useRoute()), so opening it from the Inbox with the sender's threadId selects the sender's thread.
    • The dock already lives inside the Captain's thread.
  • The workspace matches web's. The cwd is computed as HumanInboxPage's InboxMessage computes it (projectScriptCwd over the shell's worktree, else the project root). With no sender thread, the message falls back to plain Markdown, because ThreadFile needs a thread.
  • Dock layout: the question's scroll view measures its own frame, so an image that loads later scrolls inside it and doesn't resize the dock.
  • Scope: four J5-owned mobile files. No upstream edit.

Checks run on the PR head

  • git diff --check: clean.
  • Mobile typecheck: clean.
  • Mobile reactCompilerCoverage, upstreamSeams and src/j5/artifacts: 1164 passed.
  • Lint: clean.

Still to come

The tester's device evidence: a file link, an artifacts/… link, an image (from a worktree if possible) and a web link, from the Inbox and from the Captain's dock.

— Claude Opus 5.5 (reviewer-opus) and GPT 6.1 Sol (reviewer-sol), J5 Code

…f guessing the root

A sender whose thread shell wasn't on this phone resolved its links and
images against the project root, so a worktree's image failed or showed
the other checkout's file. SenderMarkdown now uses useThreadCwd, which
loads the thread when its shell is missing, and stays plain until the
workspace is known.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Jacksondr5

Copy link
Copy Markdown
Owner Author

Panel re-check at eb0c46f: approved. The should-fix is resolved. SenderMarkdown now gets the sender's workspace from useThreadCwd, which loads the thread's details when the shell is missing and prefers the worktree, then the project root. The ask shows as plain Markdown until that is known. The unused projectId prop is gone from both callers. The delta is three files. Mobile typecheck, the React Compiler coverage test, lint and git diff --check pass.

Still to come: the tester's device evidence.

— Claude Opus 5.5 (reviewer-opus) for the panel with GPT 6.1 Sol (reviewer-sol), J5 Code

@Jacksondr5
Jacksondr5 marked this pull request as ready for review November 14, 2026 22:26
@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 4 billable files and costs up to $1.00.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 11 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 55 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between de65b70 and eb0c46f.

Files selected for processing: 4

  • apps/mobile/src/j5/a2a/AdjudicationDock.tsx
  • apps/mobile/src/j5/artifacts/ThreadArtifactsScreen.tsx
  • apps/mobile/src/j5/artifacts/WorkspaceMarkdown.tsx
  • apps/mobile/src/j5/inbox/InboxScreen.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

This branch was successfully deployed

1 active deployment
Preview — eb0c46fe Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobile: links and images inside an ask open on the phone

1 participant