Skip to content

ref(scraps): Add MessageRow chat primitive#119709

Closed
priscilawebdev wants to merge 15 commits into
masterfrom
seer/chat-scraps-message-row
Closed

ref(scraps): Add MessageRow chat primitive#119709
priscilawebdev wants to merge 15 commits into
masterfrom
seer/chat-scraps-message-row

Conversation

@priscilawebdev

@priscilawebdev priscilawebdev commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

Adds MessageRow to the core/chat primitives — the full-width row that aligns a single message turn (user on the right, agent on the left) with a consistent gutter. It's the placement counterpart to UserBubble.

Adopts it in the Seer Explorer chat surface (user.tsx, shared.tsx), replacing the hand-rolled alignment Flex. Each consumer keeps its exact look via prop overrides, so there's no visual change.

Targets seer/chat-scraps-primitives-layer-a; rebase onto master once that merges.

priscilawebdev and others added 14 commits July 13, 2026 10:44
…llStatusIcon)

First step of extracting Seer Explorer's chat block components into reusable
building blocks so Dashboards AI, Autofix, and other agent surfaces can share
them instead of importing straight from seerExplorer.

This adds the presentational, dependency-free primitives under
@sentry/scraps/chat:

- Spinner: small inline activity spinner (distinct from the full-width
  IndeterminateLoader) with a size prop and reduced-motion handling.
- ChatMessageBubble: a single message bubble for the sender's own messages,
  presentation only (caller handles alignment).
- ToolCallStatusIcon: status -> icon/spinner + tooltip for a group of tool
  calls, with default labels and an override.

These carry no analytics, feature flags, markdown renderer, or seerExplorer
utils/types; that behavior is injected by the composite layer in a follow-up.
Each primitive ships an MDX story. The action-bar shell is intentionally left
out of scraps since it composes from the existing RevealOnHover + ButtonBar.

Co-Authored-By: Claude <noreply@anthropic.com>
Prefer the Container layout primitive over a hand-rolled styled div, per the
design-system convention. Background, border, radius, padding, max-width,
min-width, and white-space now come from Container props; only overflow-wrap
and the text color token remain in a minimal css escape hatch since Container
does not expose them.

Co-Authored-By: Claude <noreply@anthropic.com>
Add a dedicated "Chat" story category so ChatMessageBubble, Spinner, and
ToolCallStatusIcon group together instead of scattering across Display and
Status, mirroring how MUI/Chakra give the chat kit its own section.

Also strip the (Seer Explorer, Dashboards AI, Autofix, …) product enumeration
from the primitives' docs and JSDoc. The primitives are product-agnostic and
should not name the surfaces that consume them; the enumeration was also
copy-pasted across files and would drift.

Co-Authored-By: Claude <noreply@anthropic.com>
Stop exporting Spinner and drop its story. It stays as ToolCallStatusIcon's
running-state helper, but is no longer a public primitive.

The general small-spinner vs LoadingIndicator consolidation is a separate,
already-designed effort (Loading States patterns doc); shipping a public
Spinner here would front-run it and risk the exact "which one?" ambiguity we
want that work to resolve.

Co-Authored-By: Claude <noreply@anthropic.com>
…cator

Drop the redundant "Chat" prefix (the components are already namespaced under
@sentry/scraps/chat) and use an *Indicator suffix instead of *Icon, since the
component renders a spinner or an icon depending on state. Mirrors MUI X Chat's
naming. No behavior change; the ToolCallStatus type name is unchanged.

Co-Authored-By: Claude <noreply@anthropic.com>
Pass variant directly to the status icons instead of wrapping them in Text.
The warning icon now uses the icon system's brighter graphics.warning.vibrant
token (which the Text path skipped in favor of the darker content.warning that
design engineering flagged as too dark for icons). Also drops three Text
wrappers and the now-unused import.

Co-Authored-By: Claude <noreply@anthropic.com>
…ble story

Co-Authored-By: Claude <noreply@anthropic.com>
The ToolCallStatus type has no consumers yet (stories use string literals),
so knip flagged its re-export. Tag the entry-point exports @public—the repo's
convention for intentional API surface—matching how other core components
export their prop types.

Co-Authored-By: Claude <noreply@anthropic.com>
Wire the new primitives into the code they were extracted from so they have
real production consumers (previously story-only, which failed knip:prod under
--production):

- seerExplorer UserBlock renders UserBubble instead of a local styled div
- seerExplorer tool-call rows render ToolCallIndicator instead of the local
  BlockStatusIndicator (identical tooltips/labels; warning icon now uses the
  icon system's brighter token)

Also rename MessageBubble -> UserBubble: the component only carries the
user's own-message styling, so the generic name over-promised. The now
internal-only seerExplorer Spinner is de-exported. No behavior change.

Co-Authored-By: Claude <noreply@anthropic.com>
Delete the duplicate BlockStatus type in seerExplorer; getBlockStatus and the
tool-call rows now use the exported ToolCallStatus. That gives the type a real
consumer, so the @public knip tags on the chat barrel are no longer needed and
are removed.

Also inline UserBubble's wrapStyles css block into the css prop. No behavior
change.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 15, 2026
@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Story previews

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

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

Base automatically changed from seer/chat-scraps-primitives-layer-a to master July 16, 2026 09:50
…ssage-row

# Conflicts:
#	static/app/components/core/chat/index.tsx
#	static/app/components/core/chat/spinner.tsx
#	static/app/components/core/chat/toolCallIndicator.mdx
#	static/app/components/core/chat/toolCallIndicator.tsx
#	static/app/views/seerExplorer/components/chat/shared.tsx
#	static/app/views/seerExplorer/components/chat/user.tsx
@priscilawebdev

Copy link
Copy Markdown
Member Author

closing in favour of #120052

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.

1 participant