Skip to content

feat(inbox): add session problem signal card with moment preview#1753

Open
Twixes wants to merge 1 commit intomainfrom
twixes/session-problem-signal-card
Open

feat(inbox): add session problem signal card with moment preview#1753
Twixes wants to merge 1 commit intomainfrom
twixes/session-problem-signal-card

Conversation

@Twixes
Copy link
Copy Markdown
Member

@Twixes Twixes commented Apr 21, 2026

Problem

Session problem signals from the video summarization pipeline have no dedicated card in PostHog Code. They fall through to the generic card and don't display the rasterized moment preview GIF.

Changes

  • Added SessionProblemSignalCard component with inline GIF preview, loading/error states, time range overlay, problem type badge (color-coded), segment title, and session context
  • Added isSessionProblemExtra type guard and SessionProblemExtra interface
  • Added "Session replay · Session problem" source line label
  • Routes session_replay/session_problem signals to the new card

How did you test this code?

TypeScript compiles cleanly. Manual visual verification pending once backend PR (PostHog/posthog#55463) lands and local data is available.

🤖 LLM context

Co-authored with Claude Code. Depends on PostHog/posthog#55463 for the backend moment_preview_url enrichment.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 21, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/detail/SignalCard.tsx
Line: 527-536

Comment:
**Invalid CSS: can't append hex-alpha to `var()` references**

`problemMeta.color` is a string like `"var(--red-9)"`. Appending `15` or `40` produces `"var(--red-9)15"` and `"var(--red-9)40"`, which are not valid CSS values. Browsers will silently ignore those declarations, so the badge background and border will always be transparent/invisible, leaving only the text color (which uses `color: var(--red-9)` directly and does work).

Either switch the `PROBLEM_TYPE_LABELS` color values to static hex strings (matching the pattern used in `GitHubIssueSignalCard` with `#${label.color}20`), or use `color-mix()` with CSS variables:

```tsx
const PROBLEM_TYPE_LABELS: Record<string, { label: string; color: string }> = {
  blocking_exception: { label: "Blocking exception", color: "#e5484d" },
  abandonment: { label: "Abandonment", color: "#f76b15" },
  non_blocking_exception: { label: "Non-blocking exception", color: "#ffc53d" },
  confusion: { label: "Confusion", color: "#ffe629" },
  failure: { label: "Failure", color: "#e5484d" },
};
```

Then the existing template literals `${problemMeta.color}15` / `${problemMeta.color}40` would produce valid hex-with-alpha values.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(inbox): add session problem signal ..." | Re-trigger Greptile

Comment on lines +527 to +536
const PROBLEM_TYPE_LABELS: Record<string, { label: string; color: string }> = {
blocking_exception: { label: "Blocking exception", color: "var(--red-9)" },
abandonment: { label: "Abandonment", color: "var(--orange-9)" },
non_blocking_exception: {
label: "Non-blocking exception",
color: "var(--amber-9)",
},
confusion: { label: "Confusion", color: "var(--yellow-9)" },
failure: { label: "Failure", color: "var(--red-8)" },
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Invalid CSS: can't append hex-alpha to var() references

problemMeta.color is a string like "var(--red-9)". Appending 15 or 40 produces "var(--red-9)15" and "var(--red-9)40", which are not valid CSS values. Browsers will silently ignore those declarations, so the badge background and border will always be transparent/invisible, leaving only the text color (which uses color: var(--red-9) directly and does work).

Either switch the PROBLEM_TYPE_LABELS color values to static hex strings (matching the pattern used in GitHubIssueSignalCard with #${label.color}20), or use color-mix() with CSS variables:

const PROBLEM_TYPE_LABELS: Record<string, { label: string; color: string }> = {
  blocking_exception: { label: "Blocking exception", color: "#e5484d" },
  abandonment: { label: "Abandonment", color: "#f76b15" },
  non_blocking_exception: { label: "Non-blocking exception", color: "#ffc53d" },
  confusion: { label: "Confusion", color: "#ffe629" },
  failure: { label: "Failure", color: "#e5484d" },
};

Then the existing template literals ${problemMeta.color}15 / ${problemMeta.color}40 would produce valid hex-with-alpha values.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/detail/SignalCard.tsx
Line: 527-536

Comment:
**Invalid CSS: can't append hex-alpha to `var()` references**

`problemMeta.color` is a string like `"var(--red-9)"`. Appending `15` or `40` produces `"var(--red-9)15"` and `"var(--red-9)40"`, which are not valid CSS values. Browsers will silently ignore those declarations, so the badge background and border will always be transparent/invisible, leaving only the text color (which uses `color: var(--red-9)` directly and does work).

Either switch the `PROBLEM_TYPE_LABELS` color values to static hex strings (matching the pattern used in `GitHubIssueSignalCard` with `#${label.color}20`), or use `color-mix()` with CSS variables:

```tsx
const PROBLEM_TYPE_LABELS: Record<string, { label: string; color: string }> = {
  blocking_exception: { label: "Blocking exception", color: "#e5484d" },
  abandonment: { label: "Abandonment", color: "#f76b15" },
  non_blocking_exception: { label: "Non-blocking exception", color: "#ffc53d" },
  confusion: { label: "Confusion", color: "#ffe629" },
  failure: { label: "Failure", color: "#e5484d" },
};
```

Then the existing template literals `${problemMeta.color}15` / `${problemMeta.color}40` would produce valid hex-with-alpha values.

How can I resolve this? If you propose a fix, please make it concise.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Claude speaking: Addressed — the entire SessionProblemSignalCard component and PROBLEM_TYPE_LABELS constant were removed in the follow-up commit (0765488), so the invalid CSS template literals (${problemMeta.color}15 / ${problemMeta.color}40) no longer exist in the branch.

@Twixes Twixes changed the base branch from main to inbox-session-problems April 21, 2026 10:16
@Twixes Twixes force-pushed the twixes/session-problem-signal-card branch 2 times, most recently from 03c7621 to db5a1eb Compare April 21, 2026 10:21
@Twixes Twixes force-pushed the inbox-session-problems branch from 80807bf to 884e93b Compare April 21, 2026 10:21
Copy link
Copy Markdown
Member Author

Twixes commented Apr 21, 2026

@Twixes Twixes force-pushed the twixes/session-problem-signal-card branch 2 times, most recently from 87668b0 to 32831d8 Compare April 21, 2026 15:55
@Twixes Twixes force-pushed the inbox-session-problems branch from 884e93b to 68c55b9 Compare April 21, 2026 16:05
@Twixes Twixes force-pushed the twixes/session-problem-signal-card branch from 32831d8 to 7347aa9 Compare April 21, 2026 16:05
@Twixes Twixes changed the base branch from inbox-session-problems to graphite-base/1753 April 21, 2026 16:39
@Twixes Twixes force-pushed the graphite-base/1753 branch from 68c55b9 to 0df0d85 Compare April 21, 2026 16:39
@Twixes Twixes force-pushed the twixes/session-problem-signal-card branch from 7347aa9 to f5d3edd Compare April 21, 2026 16:39
@graphite-app graphite-app Bot changed the base branch from graphite-base/1753 to main April 21, 2026 16:40
Adds a SessionProblemSignalCard that displays:
- Inline GIF preview of the problematic moment (from moment_preview_url)
- Problem type badge (color-coded by severity)
- Segment title, time range, user context
- Source line label "Session replay · Session problem"

Depends on PostHog/posthog#55463 for the backend moment preview rasterization.
@Twixes Twixes force-pushed the twixes/session-problem-signal-card branch from f5d3edd to bb4abd8 Compare April 21, 2026 16:40
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.

2 participants