feat(sidebar): show PR state for cloud runs with a provenance badge#3245
feat(sidebar): show PR state for cloud runs with a provenance badge#3245gantoine wants to merge 9 commits into
Conversation
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
|
Merging to
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 |
|
React Doctor found 1 issue in 1 file · 1 warning. 1 warning
Reviewed by React Doctor for commit |
🖥️ macOS test build (Apple Silicon)A signed macOS build for this PR is ready to download and run. ⬇️ Open this run and download the Unzip it to get the This build is signed but not notarized, so macOS quarantines it on download and Gatekeeper reports "PostHog Code is damaged and can't be opened". That is the missing notarization, not a corrupt file — clear the quarantine flag once and it launches: xattr -dr com.apple.quarantine "/Applications/PostHog Code.app"Then open PostHog Code normally. (Fully notarized, double-click-to-run builds ship only from the tagged release pipeline.) Built from 4c5a82f · rebuilds on each push while the |
Generated-By: PostHog Code Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
…ride quill's `.quill-button svg:not([class*=size-])` rule forces every descendant svg inside a sidebar row (a quill Button) to the button's icon size, overriding phosphor's width/height attributes. The provenance badge therefore rendered at 14px instead of 6px, covering the PR glyph entirely and reading as a full-size cloud. Inline width/height win over the rule and keep the badge at half the icon size. Generated-By: PostHog Code Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
The primary PR glyph was still being inflated to the quill button icon size while the mask geometry assumed the passed size, so the punched hole landed offset and oversized — eating the glyph's bottom-right corner and leaving a wide empty ring around the badge. Pin the glyph's dimensions inline like the badge's, shrink the badge bleed to 1px, and cut the hole at badge radius + 0.5px so the ring reads as a snug outline instead of padding. Generated-By: PostHog Code Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
The stacked composite pinned its glyph to the `size` prop (12px) while plain PR icons on local-run rows get inflated to the quill button icon size (14px), so badged cloud rows looked smaller than their local siblings. Drop the inline pinning on the glyph and express the badge and mask-hole geometry as percentages of the rendered box instead: the glyph now always matches plain PR icons in the same context, and the badge scales with it (7px in the sidebar). Percentage inline dimensions still exempt the badge from quill's svg sizing rule. Generated-By: PostHog Code Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
Generated-By: PostHog Code Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
Generated-By: PostHog Code Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
|
Reviews (1): Last reviewed commit: "chore(sidebar): drop geometry explainer ..." | Re-trigger Greptile |
| provenanceBadge={ | ||
| isCloudTask | ||
| ? (originProductMeta ?? { Icon: CloudIcon, label: "Cloud" }) | ||
| : undefined | ||
| } |
There was a problem hiding this comment.
Inline fallback object creates a new reference on every render
originProductMeta ?? { Icon: CloudIcon, label: "Cloud" } allocates a fresh object each render when originProductMeta is undefined. While PrStatusIcon isn't memoized today, extracting this to a module-level constant (e.g. const CLOUD_BADGE_META: OriginProductMeta = { Icon: CloudIcon, label: "Cloud" }) keeps the intent explicit and pairs naturally with the existing PR_STATE_META and DIFF_META pattern established in this PR.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The inline percentage width/height always override the svg attributes phosphor derives from `size`, so the `Math.round(size * 0.65)` value was never used. Omit the prop and let the inline style be the single source of truth. Generated-By: PostHog Code Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.
The inline `{ Icon: CloudIcon, label: "Cloud" }` fallback allocated a new
object on every TaskIcon render; a module-level CLOUD_BADGE_META matches
the PR_STATE_META / DIFF_META pattern.
Generated-By: PostHog Code
Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
There was a problem hiding this comment.
Pure UI rendering refactor in a sidebar icon component — replaces if-chains with a lookup table and adds a stacked provenance badge for cloud tasks. No business logic, data model, API contract, or security changes. The one unresolved bot comment flags a minor object-allocation pattern that has no functional impact (non-memoized component, cosmetic sidebar item).
New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.
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:
useTaskPrStatusresolves the live GitHub state whenever a cloud run's output carries apr_url, and everyTaskIconconsumer 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:
TaskIconconsumer: sidebar rows, task tabs, command palette, command center.Notes
pr_url; runs that never published keep the plain cloud icon (nothing to show).Generated-By: PostHog Code
Task-Id: 3c36b344-ed49-424a-9218-703049ad89db
Created with PostHog Code