Skip to content

ref(scraps): Add chat primitives (MessageRow, AssistantMessage, MessageActions)#120052

Merged
priscilawebdev merged 6 commits into
masterfrom
seer/chat-scraps-primitives
Jul 22, 2026
Merged

ref(scraps): Add chat primitives (MessageRow, AssistantMessage, MessageActions)#120052
priscilawebdev merged 6 commits into
masterfrom
seer/chat-scraps-primitives

Conversation

@priscilawebdev

@priscilawebdev priscilawebdev commented Jul 20, 2026

Copy link
Copy Markdown
Member

Adds a few small chat primitives to @sentry/scraps/chat and uses them in Seer Explorer, so agent chat UIs share the same building blocks.

The primitives are MessageRow, AssistantMessage and AssistantActions (thumbs up/down plus copy).

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Story previews

Preview the stories changed in this PR on the Vercel deployment:

Preview deployment: https://sentry-q3dqpayjb.sentry.dev

Add presentation-only chat primitives to @sentry/scraps/chat (MessageRow,
UserBubble, AssistantMessage, AssistantActions, ToolCallIndicator, Spinner) and
adopt them in Seer Explorer. MessageRow positions a turn by role via a from prop;
AssistantActions renders thumbs up/down and a copy button driven by flat
copyText/onCopy. App-specific logic (markdown, analytics, feedback persistence)
stays in the view. Each primitive ships with a story.
@priscilawebdev
priscilawebdev force-pushed the seer/chat-scraps-primitives branch from f0bc7fc to 63d50fe Compare July 21, 2026 06:04
@priscilawebdev
priscilawebdev marked this pull request as ready for review July 21, 2026 06:21
@priscilawebdev
priscilawebdev requested review from a team as code owners July 21, 2026 06:21
Comment thread static/app/components/core/chat/assistantMessage.tsx
AssistantMessage also applied padding=xl, so wrapping it in MessageRow
double-padded the turn — which is why Seer Explorer omitted the row around
assistant responses. Drop padding from AssistantMessage (like UserBubble, it now
styles only its content) and wrap it in MessageRow in the view, so user and
assistant turns share one consistent gutter.
Comment thread static/app/components/core/chat/assistantMessage.tsx
As a flex item inside MessageRow, AssistantMessage shrink-wrapped to its content
instead of filling the row, so min-width:100% content (markdown tables, code
blocks) measured against the shrunk width. Add width=100% so it fills the turn
as documented.
@priscilawebdev

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 1de4c35. Configure here.

@natemoo-re natemoo-re left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Really nice abstractions and solid refactor, thanks for jumping on this! One small comment on aria-label but not blocking

const isPositive = feedback === 'positive';
return (
<Button
aria-label={isPositive ? t('Feedback Thumbs Up') : t('Feedback Thumbs Down')}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would prefer if we either match the tooltipProps.title text or drop the explicit aria-label and rely on the aria-labelledby (does tooltip do this automatically, I can't recall)

@priscilawebdev priscilawebdev Jul 22, 2026

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.

the tooltip auto-wires a description, not a label, so it can't serve as the button's name.

'aria-describedby': shouldInteract ? describeById : undefined,

Comment thread src/sentry/api/serializers/models/groupactionlogentry.py
Comment thread src/sentry/seer/autofix/pr_iteration/check_suites.py
Comment thread src/sentry/receivers/releases.py Outdated
The feedback and copy buttons in the shared AssistantActions primitive
had aria-labels that disagreed with their visible tooltips, and the copy
button carried Seer Explorer-specific wording ("Copy block content")
that is misleading on other chat surfaces.

Derive each feedback button's aria-label from the same string as its
tooltip title, and match the copy button's aria-label to its "Copy to
clipboard" tooltip. Update the seerExplorer chat specs that queried by
the old accessible names.
@priscilawebdev
priscilawebdev force-pushed the seer/chat-scraps-primitives branch from 3123cbb to 8e9555c Compare July 22, 2026 06:55
@priscilawebdev
priscilawebdev removed request for a team July 22, 2026 06:56
@priscilawebdev priscilawebdev removed the Scope: Backend Automatically applied to PRs that change backend components label Jul 22, 2026
@priscilawebdev

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9f645ad. Configure here.

aria-label={label}
icon={<IconThumb direction={isPositive ? 'up' : 'down'} />}
disabled={disabled}
tooltipProps={{title: label}}

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.

Duplicate disabled feedback labels

Low Severity

When feedbackDisabled is set, both thumb buttons share the same aria-label and tooltip text (Feedback submitted). Previously each control kept a distinct accessible name while only the tooltip switched to the submitted state, so assistive tech could still tell the two buttons apart after a vote.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 9f645ad. Configure here.

@priscilawebdev
priscilawebdev merged commit c9ef7e1 into master Jul 22, 2026
78 checks passed
@priscilawebdev
priscilawebdev deleted the seer/chat-scraps-primitives branch July 22, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants