Remove dead mobile components and validation errors
Four things in apps/mobile have no callers. Each was checked with git grep -w across apps, packages, scripts, infra and docs, and every reference found is the definition itself.
ThreadAgentSpawnCard at apps/mobile/src/features/threads/thread-work-log.tsx:1270 is a memo component of about 55 lines with one reference, its own definition.
The StatusPill component function in apps/mobile/src/components/StatusPill.tsx is never rendered. Two files import the StatusTone type from that module, at features/connection/connectionTone.ts:1 and features/threads/ThreadDetailScreen.tsx:87, so keep the type and drop the 22-line component.
apps/mobile/src/features/threads/projectThreadCreationValidation.ts exports validateProjectThreadCreation, three error classes and a union type. The validate function's only reference is its own definition at line 55, and every error class is referenced only inside that same file. resolveProjectThreadCreationBranch in the same module is live, called from NewTaskDraftScreen.tsx:125,1011 and new-task-flow-provider.tsx:119,1133. Cutting the rest saves about 45 of the file's 71 lines.
apps/mobile/src/components/MaterialSegmentedControl.tsx is a 6-line return null stub that cannot run. SegmentedControl.tsx:14 gates on Platform.OS === "android", and Metro resolves MaterialSegmentedControl.android.tsx for Android, which holds the real Jetpack Compose control. Move the iOS control into the unsuffixed file, let the .android sibling keep overriding it, and reduce SegmentedControl.tsx to a re-export. That matches the shim pattern MaterialSwitch.tsx, MaterialNewThreadButton.tsx and CustomSnoozeSheet.tsx already follow.
isNativeReviewDiffHighlighterAvailable in apps/mobile/src/features/diffs/nativeReviewDiffHighlighter.ts has zero references repo wide.
About 135 lines.
[!NOTE] Grok responding on behalf of Julius.
Triage
Thanks for the careful cleanup audit, @amnesiaof! Most of what you listed is unused, but a couple of items turned out to still matter, and one isn't in the tree.
What I found
ThreadAgentSpawnCardinapps/mobile/src/features/threads/thread-work-log.tsxhas no callers, since subagent batches render throughThreadSubagentGroup.AgentSpawnSummaryinapps/mobile/src/lib/threadActivity.tsis only referenced by that card.SubagentStatusDotis still used bySubagentRow.StatusPillis never rendered.StatusTonehas no other readers either.connectionToneonly feeds ascreenToneprop onThreadDetailScreenthat nothing reads, because connection status already goes throughconnectionFloatingStatus.validateProjectThreadCreationand theProjectThreadTaskRequiredError,ProjectThreadBaseBranchRequiredError, andProjectThreadCreationValidationErrorerrors are unused.NewTaskDraftScreenalready blocks an empty task and a worktree with no branch before submit.resolveProjectThreadCreationBranchis still called fromNewTaskDraftScreenandnew-task-flow-provider.tsx.isNativeReviewDiffHighlighterAvailableisn't in the current tree.apps/mobile/src/features/diffs/nativeReviewDiffHighlighter.tsis live, becauseuseNativeReviewDiffHighlighting.tscallshighlightNativeReviewDiffVisibleRows.MaterialSegmentedControl.tsxreturningnullis the non-Android module that Metro resolves.SegmentedControlonly renders it on Android, whereMaterialSegmentedControl.android.tsxis used instead. The stub body never runs, but the file has to exist for the import to resolve.
Likely fix area
- One option is a cleanup that removes the unused card plus
AgentSpawnSummary, theStatusPill/StatusTone/connectionTone/screenTonechain, and the unused validation function and errors. - The segmented control stub and the diff highlighter module look like they should stay. Reshaping the segmented control into platform modules would be a separate change.
A maintainer will decide on the fix direction.