feat(gastown): redesign Merge Queue page with Needs Attention + Refinery Activity Log#1369
feat(gastown): redesign Merge Queue page with Needs Attention + Refinery Activity Log#1369
Conversation
Add a dedicated tRPC query that returns structured merge queue data: - needsAttention section with openPRs, failedReviews, and stalePRs - activityLog with enriched review-related bead events - Full JOINs to review_metadata, source beads, convoy_metadata, agents, rigs - Input params: townId (required), rigId, limit, since for filtering/polling - Zod schemas with rpcSafe wrappers and type declarations for frontend
…age (#1365) * feat(gastown): configurable terminal orientation with drag-to-resize (#1299) * feat(gastown): configurable terminal orientation and drag-to-resize (#1237) Terminal bar can be positioned at bottom/top/left/right with drag-to-resize. Position and size persisted to localStorage. Collapsed state only reserves the tab bar strip. Dynamic page padding replaces static pb-[340px]. DrawerStack offsets when terminal is on the right. * fix(gastown): clamp size on orientation switch, add vertical close button Re-clamp persisted size when switching position so horizontal minimum (100px) doesn't persist as a too-small vertical width (min 200px). Show close button on agent tabs in vertical mode via absolute positioning on hover. * fix(gastown): fix terminal resize handle and position picker for left/right orientations - Make resize handle a flex child instead of absolute positioned to avoid z-index conflicts with framer-motion stacking contexts - Add visible hover indicator pill on resize handle for discoverability - Remove width/height from CSS transition so drag resize is immediate - Use fixed positioning with viewport clamping for position picker popup to prevent overflow on left/right orientations * chore: cherry-pick getMergeQueueData types from bead 0 * feat(gastown): build 'Needs Your Attention' section for Merge Queue page Add NeedsAttention component with: - Three attention categories: open PRs, failed reviews, stale PRs - Convoy grouping with header cards showing progress, branch, merge mode - Action buttons: Open PR, Retry Review, Fail Bead, View Bead - DrawerStack integration for bead and convoy drawer opening - Confirmation dialogs for destructive actions - Empty state when no items need attention Rewrite MergesPageClient to use getMergeQueueData tRPC procedure with 5s polling interval.
…ue page (#1366) * feat(gastown): add convoy grouping and per-rig filtering to Merge Queue page - Add RefineryActivityLog with convoy grouping: entries grouped by convoy with header cards showing title, branch, progress, clickable to open convoy drawer - Add per-rig filter dropdown using listRigs query and shadcn Select, passes rigId to getMergeQueueData for server-side filtering - Include status_changed ActionType with type guard (no unsafe 'as' cast) - Polish layout: page title, rig filter, Needs Attention, Activity Log sections with consistent headers and empty states * fix(gastown): move hooks above early returns and paginate by convoy groups - Move all useMemo hooks above isLoading/empty early returns to prevent React crash when entries transition from 0 to non-zero (hooks must be called in the same order on every render) - Replace flat-entry pagination with group-based pagination: convoy groups (sorted by most recent activity) are kept whole, and standalone entries fill remaining page budget. This ensures recently active convoys appear on page 1 regardless of other convoys' sizes.
| if (!confirmAction) return; | ||
| if (confirmAction.action === 'retry') { | ||
| retryMutation.mutate({ | ||
| rigId, |
There was a problem hiding this comment.
WARNING: Retry action can fail for entries without a rig id
This mutation sends rigId through updateBead, but that procedure requires a UUID and verifies the bead belongs to that rig. Here rigId falls back to an empty string when mrBead.rig_id is missing, so retrying those cards will fail validation or come back FORBIDDEN instead of recovering the review. Consider hiding or disabling retry when the MR has no rig id, or using a town-scoped recovery mutation for this path.
| ON rig.id = b.${beads.columns.rig_id} | ||
| WHERE ${bead_events.event_type} IN ( | ||
| 'review_submitted', 'review_completed', 'pr_created', | ||
| 'pr_creation_failed', 'rework_requested', 'status_changed' |
There was a problem hiding this comment.
WARNING: This will pull unrelated bead transitions into the refinery log
updateBeadStatus() records status_changed for every bead type, so including that event here means ordinary issue, convoy, and escalation transitions will show up in a page that is supposed to represent refinery activity. Once a town has normal bead traffic, the review history becomes noisy and much harder to follow.
| </AnimatePresence> | ||
|
|
||
| {/* Standalone entries */} | ||
| {visibleStandalone.length > 0 && ( |
There was a problem hiding this comment.
WARNING: Standalone events are no longer rendered in chronological order
This component sorts convoy groups by latest activity, but then renders every convoy group before every standalone entry. A newer standalone event will therefore appear below older convoy groups, which breaks the activity log ordering. The grouped and standalone rows need to be merged into one time-ordered list before rendering.
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)N/A Files Reviewed (14 files)
Reviewed by gpt-5.4-20260305 · 2,747,754 tokens |
Summary
getMergeQueueDatatRPC procedure backed by a new SQL query inreview-queue.tsthat returns MR beads needing attention (open PRs, failed reviews, stale PRs) and a chronological refinery activity log — both enriched with convoy, agent, rig, and source bead context via JOINs.NeedsAttention.tsx) with convoy-grouped cards, category badges (open PR / failed / stale), inline retry/fail actions with confirmation dialogs, and a per-rig filter dropdown.RefineryActivityLog.tsx) showing review-lifecycle events (submitted, completed, PR created, rework requested) in a timeline view grouped by convoy, with paginated "show more" that keeps convoy groups intact.TerminalBarto use a sharedTerminalBarPaddingwrapper for consistent bottom padding across layouts.Verification
pnpm typecheck— passes across all packages (tsgo --noEmit)pnpm run lint:oxlint— 0 warnings, 0 errors on 1844 filespnpm run format:check— no formatting issuesVisual Changes
N/A (no screenshots available from this environment — the changes add new UI sections to the Merge Queue page)
Reviewer Notes
NeedsAttention.tsx:293: Retry mutation sendsrigId: ''whenrig_idis null — will hit Zod UUID validation and show a confusing toast. Consider disabling retry when rig_id is absent.NeedsAttention.tsx:367-377: Clickable buttons that silently do nothing whensourceBeadis null — consider disabling or rendering as<span>in that case.RefineryActivityLog.tsx:344-346: "Show more" remaining count can show 0 or negative when a convoy group overshoots the page budget — useMath.max(0, ...).MergesPageClient.tsx:129:isLoading={false}is hardcoded, making the skeleton inRefineryActivityLogdead code.router.ts:908:sinceparameter accepts any string — considerz.string().datetime()for validation.