refactor(checks): extract prop-driven ChecksPanelInner from active-worktree wrapper - #4
Merged
zaridan merged 3 commits intoJun 23, 2026
Conversation
…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
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>
This was referenced Jun 24, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pure, behavior-preserving refactor that splits the ~3.6k-line
ChecksPanel.tsxinto: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.worktreeis optional, so a caller can drive it from a branch/PR identity without a live worktree.Also extracts
ChecksPanelReviewHeader,checks-panel-gitlab-review-rpc, andchecks-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-linesdisable 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