Skip to content

feat(mobile): a Crew member or Peer Agent opens its parent - #1064

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-open-parent
Nov 15, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/mobile-open-parent

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Problem

On the phone, a Crew member or Peer Agent has no way to its Captain or the agent that spawned it. Web has the Lineage panel for this, and upstream's provider subagents have an Open parent button. Closes #1062.

What changed

  • The bar. Upstream's ProviderSubagentBar style and wording are reused: a rounded row with the parent's thread title (falling back to its agent name, as web's Lineage row does), its role ("Captain · " or "Parent agent"), and an Open parent button (tone secondary). The button opens the parent through upstream's useOpenLinkedThread, as upstream's bar does.
  • Placement. The bar sits above the composer, in J5's existing slot (J5ComposerControls). That is where upstream's bar sits. Upstream's bar takes the composer's place; a J5 member keeps its composer, so this bar goes above it. I didn't use the other two spots:
    • Agents sheet: it lists a thread's children, and a member usually has none, so its pill doesn't show.
    • Header: it would need a new edit to upstream's ThreadHeader on both platforms.
  • Data. The bar reads the thread's server Fleet roster with web's Lineage logic (deriveJ5LineageRows). It shows the first parent or Captain row. That logic moves from apps/web/src/j5/threads/j5Lineage.logic.ts to packages/client-runtime/src/j5/lineage.ts with its test, behaviour unchanged except sort on a fresh array for Hermes. Web imports it from there.
  • Who sees it. Like web's Lineage, the bar needs a server-wide read, so a person who reaches less than the whole server gets no bar. A thread with no J5 parent gets none.
  • Dock room. The adjudication dock below now subtracts the measured height of the rows above it (Crew proposal, Open parent), so a Captain that also has a parent keeps the dock unclipped.

Docs line for the docs PR: none planned. Open parent follows upstream's own button.

UI changes

Android. Before is trunk e9e5085cfd. The seat and Peer Agent afters are at 461e8f3553. The other afters are at ca6ee3b3a4, which differs only in how the parent's name is looked up.

State Before After
Crew seat, its Captain above the composer Crew seat with its Captain above the composer, before Crew seat with its Captain above the composer, after
Peer Agent, its parent above the composer Peer Agent with its parent above the composer, before Peer Agent with its parent above the composer, after
Captain thread, no parent bar Captain thread without a parent bar, before Captain thread without a parent bar, after
Plain thread, no parent bar Plain thread without a parent bar, before Plain thread without a parent bar, after
Open parent tapped After
From the Crew seat: its Captain opens Captain opened from the Crew seat's Open parent button, after
From the Peer Agent: its spawner opens Parent opened from the Peer Agent's Open parent button, after

Live testing

Pass on Android at 461e8f3553, by the wave Android tester (Sol 6.1), with a real Claude Haiku Crew of one seat and a real Haiku Peer Agent:

  • Both bars show the parent's thread title over "Captain · Parent Navigation 1064" or "Parent agent". A long title is cut off with an ellipsis on screen, and screen readers get the full title.
  • Both Open parent buttons open the right thread.
  • The Captain with no parent and a plain thread show no bar.

Not exercised: iOS, video (#1034), a Viewer or offline connection, the keyboard up, and a Captain that also has a parent with the dock open.

Upstream impact

  • No new upstream edit. packages/client-runtime/package.json gains the ./j5/lineage export (case 114). Case 114 now names the bar and the dock's new room, and case 116's proof path moves.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior: the moved lineage.test.ts covers parent and Captain rows; the bar is proved on device
  • UI changes: before/after above
  • Live testing: the section above says what ran and what did not
  • Upstream-owned files: recorded in FORK.md cases 114 and 116
  • Upstream product: none
  • Surfaces: mobile thread view. Web's Lineage is unchanged and reads the moved logic. Agents reach parents through their own tools.
  • Docs: none

Built by Claude Opus 5.5 in Claude Code, as builder-timeline in the mobile catch-up Crew.

🤖 Generated with Claude Code

Upstream's Open parent button, in a bar above the composer, leads to the
Captain or spawner. It reads the Fleet roster through web's Lineage logic,
moved to client-runtime.

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

vercel Bot commented Nov 15, 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 15, 2026 10:41pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds a mobile Open parent bar for J5 Crew members and Peer Agents. It also exports the shared lineage module through client-runtime, updates its consumers, and changes child-row ordering to use .sort().

Changes: J5 Parent Navigation

Layer / File(s) Summary
Shared lineage module and consumers
packages/client-runtime/src/j5/lineage.ts, packages/client-runtime/package.json, apps/web/src/j5/threads/J5LineageRows.tsx, packages/client-runtime/src/j5/lineage.test.ts, apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx, FORK.md
The client-runtime package exports the shared lineage module. Child rows use .sort() instead of .toSorted(). The web consumer and lineage test import from the shared module. The test-location comment and Lineage documentation point to the client-runtime module and test.
Mobile parent bar and composer layout
apps/mobile/src/j5/threads/J5OpenParentBar.tsx, apps/mobile/src/j5/composer/J5ComposerControls.tsx, FORK.md
The mobile composer shows the parent or captain’s details and an open button when a matching lineage row exists. The roster strip and parent bar are measured together, and their height is added to the composer height passed to AdjudicationDock. The documentation describes the updated composer controls.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MobileUser
  participant J5OpenParentBar
  participant FleetRoster
  participant LinkedThread
  J5OpenParentBar->>FleetRoster: Query when ledger support is not false and sharing is not narrow
  FleetRoster-->>J5OpenParentBar: Matching parent or captain row
  J5OpenParentBar-->>MobileUser: Display parent details and open button
  MobileUser->>J5OpenParentBar: Press open button
  J5OpenParentBar->>LinkedThread: Open linked thread
Loading
Merge Risk: Minimal · up to 461e8

This change adds an Open parent bar on mobile for Crew members and Peer Agents and moves the shared lineage logic into the client runtime. The server already refuses Fleet reads from narrow-scope sessions, so the bar does not expose parent information to them. The only open item is the author's pending on-device layout check, which does not block merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(mobile): a Crew member or Peer Agent opens its parent" matches the main change: an Open parent bar on mobile that lets a J5 Crew member or Peer Agent open its parent or Captain. It is …
Linked Issues check Passed Issue #1062 requires an Open parent button on mobile for a J5 Crew member or Peer Agent. The button opens its Captain or spawner, follows upstream's button, and uses the shared J5 lineage logic. The r…
Out of Scope Changes check Passed The changes support the mobile Open parent objective of #1062. The new J5OpenParentBar.tsx and its placement in J5ComposerControls.tsx implement the button. The adjudication dock height change in J5Co…
Description check Passed The description follows the repository template closely. It covers Problem (with the linked issue #1062), What changed (bar, placement, data source, visibility, and dock room), UI changes (before/afte…
Full details: Title check

Explanation

The title "feat(mobile): a Crew member or Peer Agent opens its parent" matches the main change: an Open parent bar on mobile that lets a J5 Crew member or Peer Agent open its parent or Captain. It is specific and conventional, and it names the platform and the feature.

Full details: Linked Issues check

Explanation

Issue #1062 requires an Open parent button on mobile for a J5 Crew member or Peer Agent. The button opens its Captain or spawner, follows upstream's button, and uses the shared J5 lineage logic. The reviewed head meets these points. apps/mobile/src/j5/threads/J5OpenParentBar.tsx renders a secondary-tone 'Open parent' Button. It opens the parent through useOpenLinkedThread. Its parent lookup uses deriveJ5LineageRows, imported from @t3tools/client-runtime/j5/lineage, and selects the row with role 'parent' or 'captain'. J5ComposerControls places the bar above the composer, which members keep. The logic moved to packages/client-runtime/src/j5/lineage.ts, and web imports it from there (J5LineageRows.tsx). The bar shows nothing when no J5 parent exists. The issue does not require automated tests, and the bar has no unit test. The server-wide read limit for narrow sharing follows web's Lineage behaviour and is not a gap in the issue's requirements.

Full details: Out of Scope Changes check

Explanation

The changes support the mobile Open parent objective of #1062. The new J5OpenParentBar.tsx and its placement in J5ComposerControls.tsx implement the button. The adjudication dock height change in J5ComposerControls.tsx adds the measured bar row height to composerHeight. This keeps the dock unclipped when the bar appears, so it is a direct consequence of the bar placement. The lineage move (lineage.ts, lineage.test.ts, package.json './j5/lineage' export, web import in J5LineageRows.tsx and the comment in ThreadRelationshipsControl.browser.test.tsx) supports the shared-logic requirement. The FORK.md update records the moved and changed upstream-owned files. The sort-in-place change in lineage.ts is a Hermes compatibility change inside the moved logic. No unrelated functional change was found in the reviewed summary.

Full details: Description check

Explanation

The description follows the repository template closely. It covers Problem (with the linked issue #1062), What changed (bar, placement, data source, visibility, and dock room), UI changes (before/after Android screenshots in a table), Live testing (verdict, commit tested, what was not exercised), Upstream impact (FORK.md cases 114 and 116 named), and a completed checklist. The description is detailed and specific. Two points are weaker: the Upstream impact section states the FORK.md case text is updated but does not show the file-table row, and the 'Docs line for the docs PR' sentence is not part of the template. These are minor and do not block merge.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

LanguageTool

FORK.md

LanguageTool checks are incomplete because the per-file request limit of 5 was reached. Remaining text was skipped; findings from completed checks are retained.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e9e5085 and 461e8f3.

Files selected for processing: 8

  • FORK.md
  • apps/mobile/src/j5/composer/J5ComposerControls.tsx
  • apps/mobile/src/j5/threads/J5OpenParentBar.tsx
  • apps/web/src/components/chat/ThreadRelationshipsControl.browser.test.tsx
  • apps/web/src/j5/threads/J5LineageRows.tsx
  • packages/client-runtime/package.json
  • packages/client-runtime/src/j5/lineage.test.ts
  • packages/client-runtime/src/j5/lineage.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M 30-99 effective changed lines (test files excluded in mixed PRs). labels Nov 15, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined review (reviewer-opus + reviewer-sol) at ca6ee3b: cleared, pending device evidence

We each checked it independently. Neither of us has a blocking finding.

  • Placement. The bar mounts in J5ComposerControls, so there's no new upstream seam, and it sits above a J5 agent's composer, which the agent keeps. Upstream's ProviderSubagentBar takes a provider subagent's composer's place. Navigation is upstream's useOpenLinkedThread: inspector, pop when the parent is the previous screen, otherwise push.
  • Gating.
    • j5LedgerSupported(...) !== false and !isNarrow match web's Lineage. Unknown support or access stays permissive, and the server is authoritative.
    • A null query returns empty immediately, not stale data.
    • The fleet family refreshes on rereadOn("crew", "fleet"), so a newly spawned child gets its bar.
  • Parent row. deriveJ5LineageRows moved to client-runtime verbatim, apart from .sort on the fresh array .filter returns (Hermes). The moved tests change only their import, and reviewer-sol ran them: 6/6 pass. The server sets crew only for seats, so a Captain's own thread gets no self row.
  • Dock room. The measured height of the rows above the dock (roster strip + bar) is added to composerHeight, which is already in the animated style's deps. OTHER_ROW_HEIGHT now effectively covers only the playbook bar. FORK cases 114/116 match.

Non-blocking:

  • The bar hides while a pending approval or question is open, because J5ComposerControls only mounts without one. The dock behaves the same way.
  • Perf note: this is the shared fleet atom family keyed by environment and input, not a separate fetch per mounted thread. It does keep that server-wide roster read live, re-read on each crew/fleet revision, even while an ordinary non-agent thread is open. Web holds the same roster globally, so no change asked.

@github-actions github-actions Bot added size:L 100-499 effective changed lines (test files excluded in mixed PRs). and removed size:M 30-99 effective changed lines (test files excluded in mixed PRs). labels Nov 15, 2026

@Jacksondr5 Jacksondr5 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Combined re-clear (reviewer-opus + reviewer-sol) at 461e8f3: cleared

The only change since ca6ee3b is the title fallback in J5OpenParentBar, and neither of us has a finding.

  • useQuietThreadShell runs before the early return. With no parent it gets a null ref, which resolves to the empty atom, so the hook order is stable. The ref stays scoped to the parent's environment.
  • shell?.title ?? displayName ?? role matches web's J5LineageRows exactly.

The visible names changed, so updated captures are still required.

@Jacksondr5
Jacksondr5 merged commit 30b247a into j5/main Nov 15, 2026
35 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/mobile-open-parent branch November 15, 2026 22:56

This branch was successfully deployed

1 active deployment
Preview — 461e8f35 Deployed Nov 15, 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: a Crew member or Peer Agent has an Open parent button

1 participant