Skip to content

feat(gastown): add Refinery Activity Log timeline to Merge Queue page#1473

Closed
jrf0110 wants to merge 5 commits intoconvoy/redesign-merge-queue-needs-attention-ref/e0d20455/headfrom
convoy/redesign-merge-queue-needs-attention-ref/e0d20455/gt/maple/f4ac6ea2
Closed

feat(gastown): add Refinery Activity Log timeline to Merge Queue page#1473
jrf0110 wants to merge 5 commits intoconvoy/redesign-merge-queue-needs-attention-ref/e0d20455/headfrom
convoy/redesign-merge-queue-needs-attention-ref/e0d20455/gt/maple/f4ac6ea2

Conversation

@jrf0110
Copy link
Copy Markdown
Contributor

@jrf0110 jrf0110 commented Mar 24, 2026

Summary

Adds a new getMergeQueueData tRPC procedure and backend query that powers both the "Needs Your Attention" and "Refinery Activity Log" sections of the Merge Queue page. The backend query in review-queue.ts fetches enriched MR bead data with full joins to source beads, convoy metadata, agent metadata, review metadata, and rig names. The frontend RefineryActivityLog.tsx component renders a vertical timeline with color-coded dot/line indicators per action type (merged, failed, pr_created, pr_creation_failed, rework_requested, review_submitted, status_changed), natural language descriptions, convoy grouping with progress bars, clickable bead titles that open drawers, metadata lines with commit SHA and PR links, and client-side pagination. Also includes the configurable terminal orientation refactor (#1299) as a dependency.

Verification

  • pnpm typecheck — passes clean across all packages
  • pnpm lint — passes (oxlint + eslint across all packages)
  • pnpm format:check — passes
  • Code review: no as casts or ! assertions introduced, parameterized SQL queries, Zod validation on all IO boundaries

Visual Changes

N/A (new page section — no before state exists)

Reviewer Notes

  • The diff includes the terminal orientation refactor (commit 2b4bd684, PR feat(gastown): configurable terminal orientation with drag-to-resize #1299) which is a dependency cherry-picked onto this branch. Those changes to TerminalBar.tsx, TerminalBarContext.tsx, TerminalBarPadding.tsx, DrawerStack.tsx, and layout files are from that merged PR and not new work in this bead.
  • The core bead work is in: review-queue.ts (backend query, +531 lines), schemas.ts (+108), router.ts (+21), Town.do.ts (+8), RefineryActivityLog.tsx (+351), and MergesPageClient.tsx (refactored to use new endpoint).
  • The getMergeQueueData query uses raw SQL with the query() utility rather than Drizzle's query builder — this is consistent with the existing pattern in review-queue.ts for complex multi-join queries.
  • Pagination uses a budget system where each convoy group costs its entry count, keeping whole convoys together on a page.

jrf0110 added 5 commits March 20, 2026 23:32
…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
Add a vertical timeline section showing refinery activity in natural
language. Each entry renders the action type (merged, failed, PR created,
rework requested, review submitted) with color-coded timeline dots,
clickable bead titles that open the drawer stack, and metadata like
commit SHAs and PR links. Events are filtered from getTownEvents and
sorted newest-first with pagination.
…ed data

Switch from raw getTownEvents to the new getMergeQueueData tRPC
procedure. The enriched activityLog entries provide pre-resolved agent
names, source bead titles, convoy context, review metadata (PR URLs,
target branches, merge commits), and rig names — eliminating the need
to dig through untyped event metadata.
@jrf0110 jrf0110 closed this Mar 24, 2026
@jrf0110 jrf0110 deleted the convoy/redesign-merge-queue-needs-attention-ref/e0d20455/gt/maple/f4ac6ea2 branch March 24, 2026 16:45
if (eventType === 'review_completed') {
return entry.event.new_value === 'merged' ? 'merged' : 'failed';
}
return eventType as ActionType;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: status_changed entries will crash this timeline

getMergeQueueData() now includes status_changed events, but resolveActionType() force-casts every non-review_completed event into ActionType even though the union/config omit status_changed. When one of those rows reaches TimelineEntry, ACTION_CONFIG[action] is undefined and the render throws on config.icon. Add a status_changed branch/config here, or filter that event type out before rendering.

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Mar 24, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
src/app/(app)/gastown/[townId]/merges/RefineryActivityLog.tsx 34 status_changed events are returned by the new query but are not handled by resolveActionType/ACTION_CONFIG, so the timeline can throw at render time.

Fix these issues in Kilo Cloud

Other Observations (not in diff)

None.

Files Reviewed (13 files)
  • cloudflare-gastown/src/dos/Town.do.ts - 0 issues
  • cloudflare-gastown/src/dos/town/review-queue.ts - 0 issues
  • cloudflare-gastown/src/trpc/router.ts - 0 issues
  • cloudflare-gastown/src/trpc/schemas.ts - 0 issues
  • src/app/(app)/gastown/[townId]/layout.tsx - 0 issues
  • src/app/(app)/gastown/[townId]/merges/MergesPageClient.tsx - 0 issues
  • src/app/(app)/gastown/[townId]/merges/RefineryActivityLog.tsx - 1 issue
  • src/app/(app)/organizations/[id]/gastown/[townId]/layout.tsx - 0 issues
  • src/components/gastown/DrawerStack.tsx - 0 issues
  • src/components/gastown/TerminalBar.tsx - 0 issues
  • src/components/gastown/TerminalBarContext.tsx - 0 issues
  • src/components/gastown/TerminalBarPadding.tsx - 0 issues
  • src/lib/gastown/types/router.d.ts - 0 issues

Reviewed by gpt-5.4-20260305 · 962,136 tokens

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