Skip to content
This repository was archived by the owner on Sep 2, 2026. It is now read-only.

[Spec #71] Mobile board & stage surface - #103

Merged
64ix merged 31 commits into
mainfrom
64ix/issue-71-spec-mobile-board-stage-surface
Aug 27, 2026
Merged

64ix merged 31 commits into
mainfrom
64ix/issue-71-spec-mobile-board-stage-surface

Conversation

@64ix

@64ix 64ix commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

Makes the phone a stage-aware client of a paired host — not a sync peer. The workspace list
gains stage badges and a "By stage" grouping mode; a per-host feature board shows the stage columns
with the host's workspaces as cards, plus ghost cards for inbound GitHub issues; the workspace
screen gains a stage row and a PR row. Effective stage is computed on the phone with the shared
pure derivation engine, from facts the host already publishes plus two new optional wire fields.

Writes ride the existing agent-grade RPC path: the phone declares the six working stages and clear
through worktree.set; shipped stays desktop-only and surfaces the standard steering message,
while still appearing on the board via the merged-PR fact.

Spec & Tickets

Closes #71
Closes #96
Closes #97
Closes #98
Closes #99
Closes #100

Acceptance criteria

#96 — Mobile effective stage: shared derivation + catalog fact fields

Criterion Verdict Evidence
Catalog payload gains the two facts as optional fields (Rule 1) met linkedIssueState?: WorkflowIssueState, consumedMergedPRNumbers?: number[] on RuntimeWorktreePsSummary (src/shared/runtime-types.ts); optional-spread in both getWorktreePs branches — no opcode, no negotiation
Derives via the shared engine — no reimplementation, no host-computed stage met mobile/src/worktree/mobile-stage-facts.ts delegates to deriveWorkflowStage from src/shared/stage-derivation/; host runs no derivation
Results match desktop: open PR → review, unconsumed merged → shipped, closed → triage, open issue promotes only pre-work stages, consumed merges drive nothing met mobile-stage-facts.test.ts — one test per rule, incl. the negative case (implementing + open issue stays implementing)
Old-host payload (fields absent) ⇒ declared stage only met explicit test asserting toEqual({ stage:'triage', reason:'declared-stage', factId:null })
Folder workspaces follow declarations only met workspaceKind: 'folder' test → reason: 'folder-manual-regime'

#97 — Workspace list: stage badges & "By stage" grouping

Criterion Verdict Evidence
Stage badge on staged rows in all existing grouping modes met badge in the shared WorktreeListRow.tsx renderer, so it is mode-independent; WorktreeListRow.test.ts
New "By stage" mode; sections in fixed stage order, unstaged first met 'stage' in MobileGroupMode; workspace-list-sections.stage-grouping.test.ts
Section membership uses the effective stage, not the raw declaration met buckets via deriveMobileWorktreeStage, tested
Lineage children stay nested under their root inside its section met getMobileWorkspaceLineageRoot mirrors desktop's root-ancestor rule (#28); mobile-workspace-lineage.test.ts
Old host ⇒ declared stage, no fact overrides, no error met explicit old-host badge test

#98 — Feature board screen: columns, cards, stage action sheet

Criterion Verdict Evidence
Board screen per host, all stage columns, cards by effective stage met mobile/app/h/[hostId]/board.tsx + MobileStageBoardPanel.tsx; all 7 WORKFLOW_STAGE_IDS pre-seeded so empty columns persist (mobile-stage-board-columns.test.ts)
Card content: name, repo, branch, PR state met mobile-stage-board-card.test.ts; PR state via the existing pr-state-token.ts vocabulary
Tap opens the workspace; long-press opens the stage action sheet met existing worktree.activate + session route; ActionSheetContent with delayLongPress={400}
Stage declaration round-trips through the existing RPC met mobile-stage-declaration.test.ts asserts worktree.set params { worktree:'id:…', workflowStage }
Selecting shipped surfaces the steering message; no write occurs met expect(declare).not.toHaveBeenCalled(); message imported as SHIPPED_STAGE_STEERING_MESSAGE, never retyped
Fact-governed workspace shows in the fact-derived column regardless of declaration met column tests drive membership off effectiveStage only
Usable one-handed met horizontal snap-paging + a tappable stage chip strip; both coarse gestures, no drag & drop
Old-host degradation met explicit test: fields absent ⇒ declared-stage column

#99 — Workspace screen: stage row & PR row

Criterion Verdict Evidence
Stage row shows effective stage and why it may differ from the declaration met mobile-stage-row-model.ts builds copy from DerivedWorkflowStage.reason, mirroring desktop's explainWorkflowStageDerivation wording; includes shipped-source ("set by merged PR #N" / "set by you")
Tapping opens the stage action sheet; declarations round-trip; shipped refused met reuses #98's buildMobileStageActionOptions / runMobileStageAction — holds by construction, not by re-derivation
PR row shows number + state and navigates to the existing PR surface met mobile-session-pr-row-route.ts routes to the source-control hub with tab=pr; no new PR screen
Rows degrade honestly against an old host met explicit declared-stage test — no fact annotation rendered

#100 — Ghost cards: render, adopt from issue, synced dismissals

Criterion Verdict Evidence
Ghost cards render, visually distinct, in derivation-assigned columns met MobileGhostCardRow.tsx (dashed border + Ghost icon, theme tokens only); rows pass through #98's generic column builder
Tap shows the issue (title, body, state) with adopt and dismiss met mobile-ghost-detail-sheet-model.ts + BottomDrawer/ActionSheetContent; body via the same github.workItemDetails RPC the PR sidebar uses
Adopt enters the existing create-workspace-from-issue flow prefilled; workspace replaces the ghost met additive optional initialGitHubWorkItem prop on NewWorktreeModal reusing handleSmartGitHubItemSelect; declares idea post-create, matching desktop's grab
Dismiss persists via the host; ghost disappears; reaches other machines through existing sync met ui.set on featureBoardGhostDismissals, which #29 already syncs
Host-side dismissals hide the ghost on the phone met fetchMobileGhostDismissals via ui.get, tested
Dismissal never fails silently against a host that doesn't persist it met read-back verification against the server-echoed merged ui (never the optimistic value) ⇒ {kind:'unsupported'}; tested with a client that strips the key

Changes by theme

Wire (Rule 1 only). Two new optional fields on the worktree catalog payload, folded into
both the git-worktree and folder-workspace branches of getWorktreePs. No new opcode, no capability
negotiation. The linked-issue state is read from the host's existing githubCache.issue;
consumed-merge ids come from persisted worktree meta.

Derivation on the phone. mobile/src/worktree/mobile-stage-facts.ts is the single entry point
(deriveMobileWorktreeStage) every mobile surface reads through; it adapts one catalog row into the
shared engine's input. No host-computed effectiveStage field, no reimplementation.

Workspace list. 'stage' group mode, root-ancestor lane membership, and a neutral label-only
stage badge on the shared row renderer.

Board. A per-host screen with horizontally snap-paged stage columns and a stage chip strip, over
pure column/card/action-sheet models. Ghost cards ride the same generic column builder.

Workspace screen. A stage row (effective stage + fact-governed explanation) and a PR row routing
to the existing source-control PR tab.

Shared code move. The ghost-candidate derivation moved from the renderer into src/shared/ so
the phone and desktop genuinely share it.

Tests changed rather than added

  • src/shared/feature-board/ghost-candidates.test.ts — relocated from
    src/renderer/src/components/feature-board/feature-board-ghost-candidates.test.ts. Verified
    byte-identical apart from its one import line; the implementation file likewise differs only in
    its WorkflowStage import path. Desktop behaviour unchanged.
  • mobile/src/worktree/workspace-view-settings.test.ts — an existing group-mode round-trip loop
    gained 'stage', plus a new mapping test. A strict expansion; no existing expected value changed.
  • mobile/src/worktree/workspace-list-sections.test.ts — untouched. The new "By stage" tests
    went into a separate workspace-list-sections.stage-grouping.test.ts because appending them would
    have breached the file's max-lines budget, and bumping that ratchet is forbidden.

Decisions taken while building (Problem → Resolution)

  • The authority guard was left alone. worktree.set hard-codes callerKind: 'agent', and the
    guard's own comment says mobile human surfaces "stay fail-closed until the board specs land",
    which reads as an invitation to lift it here. The spec explicitly says the opposite — writes ride
    the existing agent-grade path — so stage-write-authority.ts, worktree.set, folder-workspace.ts
    and mcp-stage-tools.ts are untouched, and the phone refuses shipped client-side and handles a
    server refusal defensively.
  • No new dismissal RPC. The spec called for one, but ui.get/ui.set already carry
    featureBoardGhostDismissals in their schema, so a new method would have been a wire change for
    nothing. The real hazard is subtler: an old host's zod .strip() drops the unknown key and still
    returns ok. Hence read-back verification.
  • Ghost derivation moved to src/shared/. The spec says "the same shared derivation as desktop",
    but the module was renderer-local. Moved (10 call sites updated) rather than duplicated.
  • Board layout. A desktop side-by-side kanban does not fit a phone, and a stacked list would
    duplicate Mobile workspace list: stage badges & "By stage" grouping #97's "By stage" list. Resolved as one full-width stage per swipe-paged column plus a
    chip strip — coarse gestures only, all seven stages always present.
  • Absence is unknown, never a negative. Following the agentWait precedent: the host's
    'unknown' PR state maps to no fact; absent consumed-merge ids pass undefined, not []; a
    failed ui.get returns null rather than an empty dismissal set.
  • Unstaged workspaces get no board card (mirroring desktop's staged-only gate), so they surface
    in the list's unstaged section rather than as a phantom column.

Known gaps (deliberate, not defects)

  • Ghost referenced-issue exclusion is only partly covered on mobile. After merging main, the
    host derives specShape and parentIssueNumber from the issue body server-side (Classify spec / ticket / idea ghosts from the issue body so Idea stops mixing spec sub-tickets in #94/[Spec #94] Classify spec / ticket / idea ghosts from the issue body #102) on the
    same github.listWorkItems path mobile uses, so the phone now inherits sub-ticket exclusion and
    spec/idea classification for free. What remains uncovered is the older mechanism: mobile still
    passes an empty referencedIssueNumbers, so an issue referenced only as a bare #N inside a spec
    body — with no ## Parent heading — can still surface as a ghost on the phone. Documented in the
    module.
  • Ghost repo scope comes from the board's catalog, not a repo list: a repo with zero workspaces
    on the host shows no ghosts on mobile yet, where desktop's project scope could include it.
  • Container components are untested at the render level (MobileStageBoardPanel,
    MobileSessionWorkspaceRows, ghost wiring), matching this repo's existing convention for screen
    containers. All decision logic sits in tested pure models.
  • The mobile typecheck needs two gitignored codegen files that postinstall normally produces
    (terminal-webview-engine.generated.ts, mermaid-webview-engine.generated.ts). In a fresh
    worktree without an install, run node scripts/build-terminal-webview-engine.mjs and
    node scripts/build-mermaid-webview-engine.mjs first.

The mobile suite's pre-existing red, now fixed here

mobile/ pnpm test had 5 tests failing on a clean checkout of main, and this branch now fixes
them, so the mobile suite is fully green (480 files / 3798 tests, 0 failures).

Cause: #88 made the shared getWorkspaceSourceName carry the linked issue/PR number into the
derived name. #92 updated the desktop expectations to the new shape ('Issue 42 Restore checkout polish', 'PR 91 …') but missed the mobile ones. Mobile's resolveWorkItemAutoName is a thin
delegate to that same shared function, so its behaviour was already correct and only these five
assertions were stale:

  • composer-linked-work-item.test.ts — 'fix-the-login-bug' → 'issue-3-fix-the-login-bug'
  • source-workspace-create.test.ts — 'Bug' → 'Issue 7 Bug'
  • workspace-create-params.test.ts — 'Fix mobile tasks' → 'PR 123 Fix mobile tasks'
  • workspace-create-params.test.ts — 'Investigate login' → 'Issue 88 Investigate login'
  • workspace-create-params.test.ts — 'Port drawer' → 'MR 7 Port drawer'

These are expectation updates to match intended product behaviour, mirroring #92 for the surface it
missed — no assertion was weakened and no behaviour changed.

Other CI notes

src/main/skills/skill-install-lock.test.ts > publishes a complete candidate atomically when acquisitions overlap and one tests node 24 shard (orca-runtime.test.ts, a 30s timeout) each
failed once during this run and passed on rerun. Both are timing flakes: the first was red on this
PR's empty baseline commit, and the second is in a terminal-worker-resume test this branch does
not touch.

Merged main (conflict resolution worth reviewing)

main landed #94 (spec/ticket/idea ghost classification) directly into the ghost-candidates module
this PR moved to src/shared/ — a move-vs-edit conflict. Resolved by taking main's newer
content at the new shared location and re-fixing its import paths, so every part of #94 is preserved:
specShape, parentIssueNumber, childTicketCount, isSpecShapedIssue, the unconditional
sub-ticket exclusion, and parseReferencedIssueNumbers delegating to spec-ticket-shape. Nothing was
resolved toward this branch's side.

Also fixed: FeatureBoardGhostCard.test.tsx — added on main after this branch's move — still
imported the old renderer path, which git could not flag as a conflict.

Verified on the merge result: root and mobile typechecks clean; mobile/ 480 files / 3798 tests, 0
failures; src/shared/feature-board + src/renderer/.../feature-board + src/main/runtime 414 files
/ 4969 tests, 0 failures; changed-code quality 0 new findings across 99 files; root lint exit 0.

Three feature-board files report as unformatted; they are already unformatted on main, so they
were left untouched rather than swept into this PR.

QA plan

  • Pair the phone to a host on this build. Open a host → the workspace list shows a stage badge
    on every staged row; switching Group to Stage sections the list with No stage first,
    then Idea → Exploring → Spec → Implementing → Review → Shipped → Triage.
  • A lineage child renders nested under its root, inside the root's stage section — not in its own.
  • Open the Board from the host. Seven columns are reachable by swiping and by tapping the
    chip strip; counts in the strip match the cards; an empty stage still shows its column.
  • Tap a card → the workspace's session screen opens. Long-press a card → the stage sheet opens;
    pick Implementing → the card moves to that column and desktop reflects the same stage.
  • Long-press a card → pick Shipped → the message "shipped is set by a merged PR or by you in
    the board UI."
    appears and the card does not move.
  • Merge a PR linked to a workspace → that workspace appears in Shipped on the phone with no
    manual move.
  • A workspace with an open PR sits in Review even though its declared stage is something
    else; its stage row explains "Open pull request #N keeps the stage at Review."
  • On the session screen, the PR row shows the linked PR number and state and opens the existing
    PR view; a workspace with no linked PR shows no PR claim.
  • A ghost card (open, unlinked GitHub issue) renders dashed on the board. Tap it → title, body
    and state show with Adopt and Dismiss.
  • Adopt → the create-workspace flow opens prefilled with that issue; completing it produces a
    workspace and the ghost is gone.
  • Dismiss → the ghost disappears; it is still gone after a pull-to-refresh, and it is also
    dismissed on desktop and on a second machine.
  • Dismiss a ghost on desktop → it is gone from the phone's board after a refresh.
  • Old-host skew: pair to a host built before this change. Badges, sections, columns and the
    stage row all show the declared stage, nothing claims a fact governs it, and nothing crashes.
  • Folder workspace: its stage changes only when set by hand; an open PR does not move it.

64ix added 29 commits August 27, 2026 17:55
Red-first for #96: exercises deriveMobileWorktreeStage/
buildWorktreeStageDerivationInput against desktop's fixed precedence
(open PR -> review, unconsumed merged PR -> shipped, closed PR ->
triage, open issue promotes only pre-work bases), the old-host
absent-fields case (declared stage only, no fact annotation), and
folder-workspace manual regime. Module does not exist yet; fails on
import.
…dd mobile stage seam

#96 — wire (Rule 1, optional-only): RuntimeWorktreePsSummary gains
linkedIssueState (from the GitHub issue cache, keyed the same
repoId::issueNumber/repoPath::issueNumber shape as the existing PR
lookup) and consumedMergedPRNumbers, folded into both the git-worktree
and folder-workspace branches of OrcaRuntime.getWorktreePs(). Absence
stays absent (optional-spread idiom, no ?? null/[]).

Mobile: extends Worktree (workspace-list-types.ts) with the same three
optional facts, and adds mobile-stage-facts.ts — the wire-to-fact
adapter plus deriveMobileWorktreeStage(), the single entry point later
board/badge/action-sheet units read the effective stage through.
Delegates to the shared deriveWorkflowStage engine; no reimplementation,
no host-computed effective stage. Folder workspaces pass workspaceKind:
'folder' so the engine's existing manual-regime short-circuit applies
untouched (D7).
…PC models

Red-first commit for ticket #98 (mobile feature board screen). All five
test files fail on module resolution — the implementation modules under
mobile/src/worktree/ don't exist yet.

Refs #98, #71
…dels

Pure models for ticket #98's mobile feature board screen:
- mobile-stage-labels.ts: Record<WorkflowStage,string> label map (D9)
- mobile-stage-board-card.ts: card essentials (name/repo/branch/PR state),
  gated through deriveMobileWorktreeStage (#96 seam)
- mobile-stage-board-columns.ts: generic seven-stage column pre-seed,
  mirrors desktop buildFeatureBoardColumns; generic seam for #100 ghosts
- mobile-stage-action-sheet-model.ts: offered stage actions incl. refused
  shipped, decided by the shared decideStageWrite guard (no rule copied)
- mobile-stage-declaration.ts: worktree.set RPC wrapper with defensive
  stage_authority_refused handling (D2)

Refs #98, #71
Red-first checkpoint: mobile-stage-labels.ts does not exist yet,
getMobileWorkspaceLineageRoot/getGroupModeToolbarLabel are not exported yet,
MobileGroupMode/WorkspaceViewSettings lack the 'stage' mode, and
WorktreeListRow renders no stage badge yet. All new/extended assertions in
this commit fail for those reasons (see command output in the unit summary).

Refs #97
- mobile-stage-labels.ts: plain-English label map keyed off WorkflowStage
  (compiler-enforced exhaustiveness), plus the mobile 'No stage' label (D9/D8).
- mobile-stage-facts.ts: narrow deriveMobileWorktreeStage's parameter to the
  minimal WorktreeStageFactsSource shape so any structural subset of Worktree
  (e.g. a list row item) can call the single entry point directly.
- mobile-workspace-lineage.ts: add getMobileWorkspaceLineageRoot, mirroring
  desktop's getWorkflowStageLaneRoot (#28) — children never carry their own
  stage for section-membership purposes.
- workspace-view-settings.ts: MobileGroupMode gains 'stage', mapped onto
  desktop's existing PersistedUIState groupBy value 'workflow-stage' (#45).
- workspace-list-picker-options.ts: 'Stage' picker option + toolbar label.
- workspace-list-sections.ts: 'stage' groupMode buckets by each worktree's
  ROOT ancestor's effective stage, in WORKFLOW_STAGE_IDS order with an
  unstaged 'No stage' section first; lineage nesting is unchanged.
- WorktreeListRow.tsx: neutral, label-only stage badge (no per-stage color,
  per STYLEGUIDE) on every staged row, in every existing grouping mode,
  using the row's own effective stage (never the root's).

Refs #97
Ticket #98 — mobile feature board screen:
- app/h/[hostId]/board.tsx: thin route, registered in app/h/_layout.tsx's
  HostStack (title 'Board')
- MobileStageBoardPanel.tsx: renders the seven-stage chip strip + swiped,
  snap-paged full-width columns (D5) over the pure column/card models;
  tap opens the session (worktree.activate + navigate, matching the
  existing pattern), long-press opens the stage action sheet
  (BottomDrawer + ActionSheetContent, delayLongPress 400 + medium haptic —
  no new sheet primitive)
- MobileStageBoardCardRow.tsx: name/repo/branch/PR-state card, PR color via
  the existing prStateToken() vocabulary
- BoardToolbarButton.tsx: shared toolbar entry point (embedded + phone
  toolbars) into the board — kept as its own component so index.tsx stays
  under its max-lines ratchet
- mobile-stage-board-styles.ts: theme-token styles, no new colors

Refs #98, #71
#97)

- index.tsx: replace both inline groupMode-label ternary chains (only 4 modes
  handled, would have mislabeled 'stage' as 'PR') with getGroupModeToolbarLabel;
  net line count drops, staying under the app/h/*/index.tsx max-lines ratchet.
- Split the new 'By stage' buildSections tests into a co-located
  workspace-list-sections.stage-grouping.test.ts: appending them to
  workspace-list-sections.test.ts pushed it 21 lines past the default 800-line
  max-lines budget, and AGENTS.md forbids bumping or disabling that ratchet.
  oxfmt reformatted the touched import block in workspace-list-sections.ts.

Refs #97
A phone loses its paired host mid-write; without this the rejection escapes
runMobileStageAction and the action sheet's caller gets no outcome. Mirrors
mobile-pr-link.ts's existing normalization.

Refs #98, #71
# Conflicts:
#	mobile/src/worktree/mobile-stage-labels.test.ts
#	mobile/src/worktree/mobile-stage-labels.ts
D4: the pure ghost-candidate derivation (#35) was renderer-local at
src/renderer/src/components/feature-board/feature-board-ghost-candidates.ts
despite having no renderer imports. Move it to
src/shared/feature-board/ghost-candidates.ts (git mv, test moved alongside)
so mobile's #100 ghost cards can import the same derivation desktop uses,
with no reimplementation and no re-export shim. Desktop behaviour is
unchanged; the moved test's assertions are untouched apart from its own
import path.

Refs #71, #100
…sheet models

Red-first tests for #99 (mobile workspace screen: stage row & PR row):
- mobile-stage-row-model: stage label + fact-derivation explanation + shipped
  source annotation, mirroring desktop's explainWorkflowStageDerivation wording
  and the old-host (declared-stage, no fact claim) degrade case.
- mobile-pr-row-model: PR number/state/token from a catalog linkedPR, null when
  absent.
- mobile-session-stage-sheet: session stage row's action sheet built from #98's
  buildMobileStageActionOptions/runMobileStageAction, proving the round-trip and
  that selecting shipped performs no write.
- mobile-session-pr-row-route: routes the PR row to the existing source-control
  hub (tab=pr), never a new screen.
- mobile-session-workspace-row-fetch: cache-first + single-flight catalog lookup
  for the session screen's worktree row.
- MobileSessionStageRow / MobileSessionPrRow: presentational row components.

All new test files fail on missing modules (no implementation yet).

Refs #99
…nd rows

Implements the failing tests: stage-row explanation copy mirroring desktop's
explainWorkflowStageDerivation, PR-row number/state model reusing
prStateToken, the session stage sheet built from #98's
buildMobileStageActionOptions/runMobileStageAction (no rule re-derived), the
PR-row route via panelRouteDescriptor('pr'), a cache-first/single-flight
worktree-row fetch, and the two presentational row components.

Refs #99
…ack and detail fetch models

Red-first for #100: these pure/RPC-wrapper models don't exist yet — the tests
fail on module resolution because the behavior described in ticket #100 has
not been implemented. mobile-ghost-dismissals.test.ts pins the D3 skew
hazard: an old host's UiUpdate schema silently strips
featureBoardGhostDismissals via zod .strip(), and dismissMobileGhost must
verify by read-back rather than trust the request's own optimistic value.

Refs #71, #100
… session screen

Adds MobileSessionWorkspaceRows (container) + use-mobile-session-workspace-row
(cache-first/single-flight fetch hook) and renders it from the session screen
right below the top bar, gated off for synthetic (folder:/floating) routes
that have no catalog entry. Renders nothing until the catalog row is known —
no guessed stage, no fake PR claim (D6).

Also: oxfmt formatting fixes on the two test files touched by an earlier
formatting pass (mobile-session-stage-sheet.test.ts, mobile-stage-row-model.test.ts).

Refs #99
… issue fetch models

Implements the pure/RPC-wrapper models pinned by the previous red commit:

- mobile-ghost-board-cards.ts: reuses the shared buildFeatureBoardGhostCandidates
  (moved to src/shared by the D4 refactor) to place ghost rows in the same
  {id, effectiveStage} shape buildMobileStageBoardColumns already accepts (#98).
- mobile-ghost-dismissals.ts: ui.get/ui.set (D3) with mandatory read-back
  verification — an old host silently strips featureBoardGhostDismissals via
  zod .strip(), so dismissMobileGhost never reports success unless the field
  actually round-trips.
- mobile-ghost-issue-fetch.ts / mobile-ghost-issue-detail-fetch.ts: reuse the
  existing github.listWorkItems (smart-source search) and github.workItemDetails
  (PR sidebar) RPCs mobile already speaks — no new RPC method.
- mobile-ghost-detail-sheet-model.ts / mobile-ghost-labels.ts: plain-English
  (D8) content builders for the tap-to-view sheet.

Refs #71, #100
#97 and #98 both introduced mobile-stage-labels.ts; the unstaged constant was
canonicalized to MOBILE_NO_STAGE_LABEL at the #97 merge, after #99 branched.

Refs #99, #71
#100)

Wires the ghost-card model into the board screen:

- use-mobile-ghost-board-state.ts orchestrates fetching each on-board repo's
  open issues + the host's persisted dismissals, derives ghost rows, and
  exposes the tap-to-view/dismiss/adopt actions — kept out of
  MobileStageBoardPanel.tsx so the screen stays a thin renderer (D10).
- MobileGhostCardRow.tsx: a dashed-border, ghost-icon card visually distinct
  from a workspace card (STYLEGUIDE: no new color values), placed in the
  derivation-assigned column via the same buildMobileStageBoardColumns seam
  #98 built for this (mobile-stage-board-columns.ts).
- MobileStageBoardPanel.tsx: tap opens a BottomDrawer/ActionSheetContent
  detail sheet (title, body, state) with Adopt/Dismiss; dismiss surfaces a
  D3 read-back failure honestly via Alert instead of silently succeeding;
  the poll refreshes dismissals each cycle so a desktop-side dismissal hides
  the ghost here too.
- NewWorktreeModal.tsx: new optional initialGitHubWorkItem prop enters
  Adopt through the existing create-workspace-from-issue flow (selects the
  ghost's repo via the resolver's existing initialRepoId param, then seeds
  the composer through the same handleSmartGitHubItemSelect a Smart-source
  pick would use) instead of a parallel creation path. Once the workspace is
  created, the board declares it 'idea' (MOBILE_GHOST_ADOPTION_DECLARED_STAGE),
  mirroring desktop's buildFeatureBoardGhostGrabInput: creation always
  declares idea and lets facts govern the effective column.

Refs #71, #100
The static-analysis job installs only root dependencies, so in that job
react-test-renderer's types are unresolvable and `ReactTestRenderer | null`
collapses to an error type, tripping type-aware no-redundant-type-constituents
on our added lines. The union is idiomatic in this repo's older mobile tests,
but the changed-code gate only scores added lines, so only new files are hit.

Refs #71
…ailure

Red-first for issue #71 review finding 1: loadMobileSessionWorkspaceRow's
null return conflated an RPC failure with a confirmed catalog absence, and
useMobileSessionWorkspaceRow's refresh() discarded the previously known row
either way. These tests assert refresh() keeps the last-known row on failure
and only clears it once the host confirms the worktree is gone.
…ails

loadMobileSessionWorkspaceRow returned null both when worktree.ps failed and
when the worktree was genuinely absent from the catalog. useMobileSessionWorkspaceRow's
refresh() then discarded a good cached/optimistic row on a transient RPC
failure, wiping the session screen's stage/PR rows.

loadMobileSessionWorkspaceRow now returns a discriminated result — { ok: true,
worktree } for a confirmed catalog read (worktree may be null, meaning
confirmed absent) versus { ok: false, message } for an RPC failure. refresh()
keeps the previously known row on ok: false and only replaces/clears it on
ok: true, per issue #71's D6 (absence caused by an error is unknown, never a
confirmed negative).

Refs #71.
…declare

Red-first for issue #71 review finding 2: handleAdoptionCreated fires
declareMobileWorktreeStage with no error handling. When it fails, the newly
adopted workspace ends up with no declared stage and no governing fact, so
buildMobileStageBoardCards silently drops it from the board. These tests
assert the failure (and a defensive server-side refusal) surfaces an Alert
the same way every other stage-write path in this PR does, and that a
successful declare stays silent.
handleAdoptionCreated fired declareMobileWorktreeStage with no error
handling. When that RPC failed, the newly adopted workspace ended up with no
declared stage and no fact to govern it — buildMobileStageBoardCards skips
any worktree whose effectiveStage is null, so the workspace silently
disappeared from the board.

handleAdoptionCreated now awaits the declare and surfaces a failure (or a
defensive server-side refusal) with an Alert, matching every other
stage-write path in this PR (mobile-stage-declaration.ts,
MobileStageBoardPanel.tsx's handleSelectStageOption). Also fixes the test's
own refusal-message expectation to assert the shared
SHIPPED_STAGE_STEERING_MESSAGE constant rather than a stray hardcoded string.

Refs #71.
@64ix

64ix commented Aug 27, 2026

Copy link
Copy Markdown
Owner Author

Readiness: one question for a human

All of spec #71's work is delivered and every ticket's acceptance criteria are met (see the PR
body's criteria tables). CI is 45 green, 2 skipped, 1 red, and the single red check is not
this branch's doing:

Mobile Checks / verify fails on 5 tests that are already red on a clean checkout of main:

  • src/tasks/composer-linked-work-item.test.ts > resolveWorkItemAutoName > slugifies the title subject
  • src/tasks/source-workspace-create.test.ts > createWorkspaceFromComposerSource > creates a GitHub issue workspace linking the issue to its own repo
  • src/tasks/workspace-create-params.test.ts > … passes a GitHub PR URL as an agent draft and links the PR
  • src/tasks/workspace-create-params.test.ts > … omits startup draft and agent when blank terminal is selected
  • src/tasks/workspace-create-params.test.ts > … links GitLab merge requests and carries explicit base branch overrides

They are the derived-workspace-name assertions left behind by #88/#92 (displayName now carries the
linked issue/PR number, e.g. "MR 7 Port drawer"). I captured this baseline on main @ db02db4639
before writing any code, and used "exactly these 5 fail, nothing else" as this run's gate — it
held at every merge. main has since advanced to 2602e40384 without touching them, so merging
main in does not clear it. A separate branch, 64ix/fix-folder-workspace-linked-name-assertions,
owns that fix.

So: this PR cannot make that check green, and I did not edit those tests to force it.

I have left the PR in draft rather than marking it ready over a red check. Your call:

  1. Land 64ix/fix-folder-workspace-linked-name-assertions first, then this goes ready with a fully
    green board; or
  2. Mark this ready now, accepting the documented pre-existing verify red.

One other thing worth a decision, noted in the PR body: the static analysis job type-aware-lints
changed files under mobile/** but installs only root dependencies, so react-test-renderer's
types are unresolvable there. This branch sidesteps it in its own new tests; the durable fix belongs
to whoever owns that workflow.

#88 made getWorkspaceSourceName carry the linked issue/PR number into the
derived name, and #92 updated the desktop expectations but missed mobile — these
five assertions have been red on main ever since. Mobile's resolveWorkItemAutoName
is a thin delegate to that same shared function, and desktop now expects exactly
this shape ('Issue 42 …', 'PR 91 …'), so the behaviour is intended and only the
expectations were stale.

Refs #71
@64ix

64ix commented Aug 27, 2026

Copy link
Copy Markdown
Owner Author

Correction: the mobile red is fixed here, and no other branch was blocking it

My previous comment said 64ix/fix-folder-workspace-linked-name-assertions owned the fix for the
5 red Mobile Checks / verify tests. That was wrong — that branch's diff touches no mobile/ files.
#92 (already on main) fixed the desktop expectations after #88 changed derived names, and the
mobile expectations were simply never updated by anyone.

So there was nothing to wait for. Fixed on this branch in 9d657725e9: the five stale assertions now
expect the intended names ('Issue 7 Bug', 'PR 123 Fix mobile tasks', 'Issue 88 Investigate login', 'MR 7 Port drawer', 'issue-3-fix-the-login-bug'). Mobile's resolveWorkItemAutoName is a
thin delegate to the same shared getWorkspaceSourceName, so the behaviour was already correct —
only the expectations were stale, exactly as desktop's had been.

mobile/ now runs 480 files / 3798 tests with 0 failures; typecheck, oxlint and format are clean.

Disregard the "land that branch first" option in my earlier comment.

@64ix
64ix marked this pull request as ready for review August 27, 2026 19:26
…bile-board-stage-surface

# Conflicts:
#	src/shared/feature-board/ghost-candidates.test.ts
#	src/shared/feature-board/ghost-candidates.ts
@64ix
64ix merged commit d711e6e into main Aug 27, 2026
48 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

1 participant