Skip to content

feat(sidebar): show PR state for cloud runs with a provenance badge#3245

Draft
gantoine wants to merge 1 commit into
mainfrom
posthog-code/cloud-run-pr-state-icon
Draft

feat(sidebar): show PR state for cloud runs with a provenance badge#3245
gantoine wants to merge 1 commit into
mainfrom
posthog-code/cloud-run-pr-state-icon

Conversation

@gantoine

@gantoine gantoine commented Jul 7, 2026

Copy link
Copy Markdown
Member

Problem

Cloud runs never surfaced their branch lifecycle (draft / open / merged / closed PR) in the sidebar the way local runs do — a finished cloud run always showed the green/red cloud icon, so you couldn't tell at a glance which cloud runs had landed and which still had a PR waiting on review.

The PR-state data was already there: useTaskPrStatus resolves the live GitHub state whenever a cloud run's output carries a pr_url, and every TaskIcon consumer already passes it in. The blocker was icon priority — TaskIcon's waterfall checked "terminal cloud run" before "PR state", so the PR branch was unreachable for cloud tasks.

UX

The PR-state glyph becomes the primary icon (identical to local runs: merged purple, open green, draft gray, closed red), with a small provenance badge stacked on the bottom-right corner — a filled cloud, or the origin-product icon (Slack, Signals, …) for branded tasks. Once a run has finished, the branch lifecycle is what you scan for; where it ran is static context, so it takes the badge slot. This also makes the whole sidebar read in one visual language regardless of local vs cloud.

Details:

  • A radial-gradient CSS mask punches a hole in the PR glyph beneath the badge, so both shapes stay legible on any row background (hover, selected, command palette highlight) without hardcoding a cutout ring color.
  • Origin-branded tasks keep their clickable "open thread" behavior on the stacked icon; tooltips combine both facts ("PR merged · Slack").
  • Failed/cancelled cloud runs keep the red cloud — the failure is the actionable signal there. Queued/running runs and completed runs without a PR are unchanged, as are needs-permission / generating / unread priorities.
  • Applies to every TaskIcon consumer: sidebar rows, task tabs, command palette, command center.

Notes

  • Cloud PR state only resolves when the run output has a pr_url; runs that never published keep the plain cloud icon (nothing to show).
  • Badge size/offset constants (0.66× icon size, 2px overflow) may deserve a visual fine-tuning pass in the running app.

Generated-By: PostHog Code
Task-Id: 3c36b344-ed49-424a-9218-703049ad89db


Created with PostHog Code

Cloud runs never surfaced their branch lifecycle (draft/open/merged/closed
PR) in the sidebar: the terminal-cloud branch of TaskIcon's waterfall won
before the PR-state branch, so a completed cloud run always showed the
green cloud icon even when its PR state was already resolved via the run's
pr_url.

Now a cloud run that finished cleanly and has a known PR state renders the
same PR-state glyphs as local runs (merged purple, open green, draft gray,
closed red), with a small filled cloud — or the origin-product icon
(Slack, Signals, …) — stacked on the glyph's bottom-right corner so cloud
provenance stays visible at a glance. A radial-gradient mask punches a
hole in the PR glyph under the badge, keeping both shapes legible on any
row background without hardcoding a cutout ring color. Origin-branded
tasks keep their clickable thread link on the stacked icon.

Failed/cancelled cloud runs keep the red cloud icon: the failure remains
the actionable signal there. Queued/running runs and completed runs
without a PR are unchanged. Applies to every TaskIcon consumer (sidebar,
tabs, command palette, command center).

Generated-By: PostHog Code
Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
@trunk-io

trunk-io Bot commented Jul 7, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

React Doctor found 1 issue in 1 file · 1 warning.

1 warning

src/features/sidebar/components/items/TaskIcon.tsx

Reviewed by React Doctor for commit bfc1d3c.

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