Skip to content

feat(message): add the Message family - #9

Closed
pratikbuilds wants to merge 1 commit into
conversation/03-agent-stepsfrom
conversation/04-message
Closed

pratikbuilds wants to merge 1 commit into
conversation/03-agent-stepsfrom
conversation/04-message

Conversation

@pratikbuilds

Copy link
Copy Markdown
Owner

Message renders an agent, person or own message with an avatar, header, content, footer and send status; own messages sit in a bubble, and markdown comes only through MessageContent's render prop. MessageFold folds a long answer and keeps the reader's place when folding from inside it. MessageActions puts extras in an overflow menu without an optional peer, and MessageReactions, MessageReplies and useCopy cover reactions, reply summaries and copy feedback. A failed message offers a retry.

Stacked on #8: review only this commit. Part of corbitsdev#94.

Notes for review

  • Message renders its own send status line (sending; failed with error and Retry) unless a MessageSendStatus is placed among its children; a failure that happens after mount is announced once (polite), never for messages that mount failed, and not inside a role=log (the log announces it). The article is named by MessageHeader's author unless the host labels it.
  • MessageFold takes a length (threshold 6000), never folds while streaming, starts open if it mounted while streaming, unfolds when focus moves inside; it starts folded by default, so pass defaultOpen to keep the newest answer open. Place-keeping uses the nearest scroll container, not useConversation.
  • Avatar initials come from a local helper (the old chat-message helper is removed at the cutover).
  • MessageSendStatus and MessageHeader register through Message's context, so they work at any depth (e.g. inside MessageFooter) and Message never doubles the status line. The live region belongs to Message and reads the current error (or "Not sent."). Server-rendered HTML shows the default line until hydration registers a placed one.

Verification

  • This commit passes bun run typecheck and bun run lint on its own (the stack is checked commit by commit).
  • At the top of the stack: bun run check, bun run build, bun run dep-guard, bun run contrast-test and bun run test:e2e (Playwright specs and the Storybook axe sweep in light and dark) pass.

Closes corbitsdev#98

Message renders an agent, person or own message with an avatar, header,
content, footer and send status; own messages sit in a bubble, and
markdown comes only through MessageContent's render prop. MessageFold
folds a long answer and keeps the reader's place when folding from
inside it. MessageActions puts extras in an overflow menu without an
optional peer, and MessageReactions, MessageReplies and useCopy cover
reactions, reply summaries and copy feedback. A failed message offers a
retry.
@pratikbuilds

Copy link
Copy Markdown
Owner Author

Moved upstream: corbitsdev#121

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.

1 participant