Skip to content

refactor(checks): extract prop-driven ChecksPanelInner from active-worktree wrapper - #4

Merged
zaridan merged 3 commits into
mainfrom
zaridan/refactor-mission-control-extract-checks-inner
Jun 23, 2026
Merged

refactor(checks): extract prop-driven ChecksPanelInner from active-worktree wrapper#4
zaridan merged 3 commits into
mainfrom
zaridan/refactor-mission-control-extract-checks-inner

Conversation

@zaridan

@zaridan zaridan commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Pure, behavior-preserving refactor that splits the ~3.6k-line ChecksPanel.tsx into:

  • ChecksPanel.tsx — a thin wrapper that reads the active worktree from the store and passes it down as props (unchanged public surface; still mounted as <ChecksPanel />).
  • ChecksPanelInner.tsx — the actual PR/checks/merge/comments UI, now fully prop-driven and reading no active-worktree globals. worktree is optional, so a caller can drive it from a branch/PR identity without a live worktree.

Also extracts ChecksPanelReviewHeader, checks-panel-gitlab-review-rpc, and checks-panel-inner-types.

No user-visible change to the existing Checks tab. An adversarial review verified the no-op: effect bodies are textually identical via prop-aliasing, and cache keys, all dependency arrays, the worktree-gated action paths, and the mount point are byte-identical. Verified green: typecheck, lint, renderer build, and the checks-panel tests.

This is the base of a stack — the Mission Control PR-cards feature (fork PR #3) builds on ChecksPanelInner. Merge this first.

The inherited max-lines disable is carried forward from the original file (which already had a documented one; ~184 renderer files share the pattern); a deeper sub-module split is left as optional future cleanup.

🤖 Generated with Claude Code

zaridan and others added 3 commits June 22, 2026 15:30
…rktree wrapper

Split ChecksPanel into a thin active-worktree wrapper (default export) and a
prop-driven ChecksPanelInner that reads no active-worktree globals. The wrapper
supplies worktree/repo/gitIdentityDisplay/linked-review identity as explicit
props; the inner is agnostic about whether its target is the active worktree, so
a shipped-PR caller (Mission Control, PR2) can drive the same UI from a branch/PR
identity without a live worktree.

Also extracted leaf modules: ChecksPanelReviewHeader, GitLab review RPC helpers,
and the inner prop/types. Behavior-preserving for the existing Checks tab.

(In progress) max-lines split of ChecksPanelInner still pending; temporary
eslint-disable retained until the hook/component extraction lands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…max-lines follow-up

Annotate the spots in ChecksPanelInner that genuinely require a live Worktree
(rename/link-PR modal, push/publish, HostedReviewActions merge) with // PR2: notes
so the Mission Control consumer knows what to supply. Make the inherited max-lines
disable comment reference the focused file-split follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the temporary disable framing on ChecksPanelInner with the original
ChecksPanel.tsx '-- Why:' rationale, noting it is inherited from the pre-split
file and that a deeper sub-module split is out of scope for this behavior-
preserving prop-extraction.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zaridan
zaridan merged commit 2070279 into main Jun 23, 2026
1 of 2 checks passed
zaridan added a commit that referenced this pull request Jun 24, 2026
… slice 2 round 3, #13)

should-fix #4: --worktree-backed without an agent is a worktree-backed bare-shell
mode — workers run in a plain shell that can never emit worker_done, so every
track hangs. The run RPC now refuses --worktree-backed unless --worker-agent is
set, with an actionable error. Enforced at the RPC boundary (authoritative for the
CLI and any other caller).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
zaridan added a commit that referenced this pull request Jun 24, 2026
…er_done on completed rows (#22 round 2)

Addresses the round-2 review must-fixes on the Control Panel DAG sync:

PERF (#1): buildOrchestrationRunDagByPaneKey ran the heavy
listTasksWithDispatch + getAllMessagesForHandle(500) per run on every
16ms-coalesced syncWindowGraph tick. Now a cheap per-run change token
(getRunDagChangeToken: MAX(rowid) of the run's tasks + dispatch_contexts, and
MAX(sequence) of the coordinator handle's messages) is computed each tick; the
heavy work runs only when the token moves, otherwise the cached snapshot is
reused. The cache is pruned to the running set so it can't grow unbounded.

FLAG (#2): the builder is gated on experimentalOrchestrators (read from the
runtime store), so un-opted-in users with a running coordinator no longer pay
the cost for a panel they can't see.

worker_done (#3): listTasksWithDispatch joins only pending/dispatched
dispatches, so a completed task's row has dispatch_id = null and a
dispatch-keyed signal never landed the worker_done summary. Worker signals are
now keyed by task_id (present on both heartbeat and worker_done payloads),
which reaches completed rows. New real-join test (in-memory DB → complete a
task with a worker_done → assert the summary lands) drives the actual join and
fails against the dispatch-keyed code.

stale grace (#4): per-task stale now mirrors getStaleDispatches exactly —
requires dispatched_at past the grace AND a stale/null heartbeat — so a
freshly-dispatched worker no longer flashes amber while the aggregate count
shows 0. listTasksWithDispatch surfaces dispatched_at for this.

Tests (#6) + nits: main-side buildOrchestrationRunDagByPaneKey tests for
cross-pane no-bleed (two runs → distinct panes, task + signal scoping) and the
change-token cache (heavy queries run once while the token is stable, again
when it moves), plus the flag-off omission. Dedup the running-runs +
hung-threshold across the activity and DAG builders; wrap the per-run loop so a
malformed run can't forfeit the whole sync tick; blank title → task id.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant