fix: reflect PR state in channel task card badge#3254
Conversation
|
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 |
|
Reviews (1): Last reviewed commit: "fix: reflect PR state in channel task ca..." | Re-trigger Greptile |
| if (typeof arg === "object" && arg !== null) { | ||
| const seen = new WeakSet<object>(); | ||
| try { | ||
| return ( | ||
| JSON.stringify(arg, (_key, value: unknown) => { | ||
| if (typeof value === "object" && value !== null) { | ||
| if (seen.has(value)) return "[circular]"; | ||
| seen.add(value); | ||
| } | ||
| if (typeof value === "bigint" || typeof value === "function") { | ||
| return String(value); | ||
| } | ||
| return value; | ||
| }) ?? String(arg) | ||
| ); | ||
| } catch { | ||
| return String(arg); | ||
| } | ||
| } |
There was a problem hiding this comment.
Circular-reference detection here is nearly identical to the logic inside
serializeError in errorDetails.ts — both maintain a WeakSet<object> and return "[circular]" for revisited nodes. Per the team's OnceAndOnlyOnce rule, a small shared helper (e.g. makeCircularSafeReplacer) could serve both call sites and keep the two serializers in sync when edge cases are discovered in one of them.
| if (typeof arg === "object" && arg !== null) { | |
| const seen = new WeakSet<object>(); | |
| try { | |
| return ( | |
| JSON.stringify(arg, (_key, value: unknown) => { | |
| if (typeof value === "object" && value !== null) { | |
| if (seen.has(value)) return "[circular]"; | |
| seen.add(value); | |
| } | |
| if (typeof value === "bigint" || typeof value === "function") { | |
| return String(value); | |
| } | |
| return value; | |
| }) ?? String(arg) | |
| ); | |
| } catch { | |
| return String(arg); | |
| } | |
| } | |
| if (typeof arg === "object" && arg !== null) { | |
| const seen = new WeakSet<object>(); | |
| const replacer = (_key: string, value: unknown): unknown => { | |
| if (typeof value === "object" && value !== null) { | |
| if (seen.has(value)) return "[circular]"; | |
| seen.add(value); | |
| } | |
| if (typeof value === "bigint" || typeof value === "function") { | |
| return String(value); | |
| } | |
| return value; | |
| }; | |
| try { | |
| return JSON.stringify(arg, replacer) ?? String(arg); | |
| } catch { | |
| return String(arg); | |
| } | |
| } |
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!
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Rework the task card status row in the channel feed:
- Once a PR exists, its state (Merged / PR ready / Draft / Closed) is the
sole top-line status, replacing the run badge — so a shipped task never
reads "Ready + Merged" or a stale "In progress + PR ready".
- Merged PRs show a purple badge and lift the card to a purple border +
tint, matching the sidebar's merge accent.
- Fall back to the neutral "PR ready" when a PR URL exists but its GitHub
state hasn't resolved yet, so the badge and the "PR" link never disagree.
- "Ready" instead of "Completed" for finished runs — the work is ready to
look at, not necessarily shipped.
- Drop the redundant "Local" pill; environment shows in the meta row
("· Local" / "· Cloud").
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
a4c8624 to
3336776
Compare
…roll
- Rebuild feed rows on quill's ThreadItem primitives (gutter avatar, header,
body, hover action bar) instead of hand-rolled ChatMessage markup.
- Group rows by day with a ChatMarker separator: "Today" / "Yesterday", then a
weekday + ordinal ("Monday 5th"), adding month/year further back.
- Cut scroll jank: memoize rows so task-list polls don't re-render the whole
feed, gate each row's 15s reply-teaser poll behind an in-view observer, and
tune contain-intrinsic-size to the real ~13rem row height.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Problem
A channel task card always showed "In progress" even after the task was done and a PR was created.
The status badge (
TaskStatusBadgeinChannelFeedView.tsx) read only the run status (taskRunStatus/latest_run.status). Cloud run rows routinely linger onin_progressafter the agent opens the PR, so the badge got stuck. The PR's real GitHub state was already fetched and rendered by the sidebarTaskIcon(viauseTaskPrStatus), but the card badge ignored it.Fix
The badge now pulls PR state the same way the icon does, and a PR outranks the run status:
Precedence:
Needs input→ liveIn progress→ PR state → run status (Completed/Failed/Local/Draft).A
failed/cancelledrun still wins over an open PR — that's a deliberate end state we shouldn't hide.Card badge and sidebar icon now agree. One file touched, typecheck green.
Created with PostHog Code