Repository navigation
feat: refresh the default look of the chatbot and fix message alignment - #397
Merged
Merged
Conversation
The chatbot stopped following the conversation in some cases: - content that grows without a DOM change (fonts, images, text wrapping) didn't scroll to the bottom, so the chatbot now also observes the size of the messages - growing content was mistaken for the user scrolling up, because the distance to the bottom grew; now only scrolling up stops following - browsers can stop a smooth scroll early when it is requested many times in a row, so it is checked again when it should have finished
- fix the alignment of the messages: the avatar has a fixed column, and the layout no longer depends on the box-sizing of the page - system font by default instead of monospace, inherited by the input - bubbles: grouped corners, better spacing and line height, long words wrap, subtle entrance animation (off with prefers-reduced-motion) - options: outlined quick replies aligned with the bot messages - custom components: card aligned with the bot messages - typing indicator with animated dots instead of "..." - footer: clean input, round send button in the accent color, crisp send and mic icons (the old send icon was clipped) - header: semibold title with ellipsis, round close button - focus rings for keyboard users, thin scrollbar, larger radius and softer shadows The props, the theme keys and the rsc-* class names are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refreshes the default look of the chatbot and fixes the alignment of the messages. The props, the theme keys and the
rsc-*class names don't change, so apps keep working, and a theme still overrides the colors and the font.Alignment
The avatar column depended on the
box-sizingof the host page, so in pages with a CSS reset (Tailwind, Starlight...) the second message of a group was shifted about 6px from the first. The avatar now has a fixed column, and every element sets its ownbox-sizing.New look
monospace(the input inherits it too), 14px messages with a readable line height.prefers-reduced-motion).....Auto-scroll fix
While testing, WebKit sometimes stopped following the conversation, ending up to ~20px above the last message:
ResizeObserver);scrollbar-gutter: stable), so the messages don't wrap again when it appears.Related issue
None.
Type of change
feat: new featurefix: bug fixdocs: documentationrefactor/perf/testbuild/ci/chore!, and the migration is described below)How has this been tested?
A gallery of every state (grouped messages, user replies, options, custom card, long text, typing indicator, invalid input, custom theme, floating) was compared before and after.
Breaking changes
None in the API. It is a visual change: apps with custom CSS that depends on the old spacing or on the empty avatar container (now not rendered when the avatar is hidden) may need small adjustments. The default
fontFamilyof the theme is now a system font stack instead ofmonospace; passfontFamily: 'monospace'in a theme to keep the old font.Suggested release: 1.1.0.
Checklist
npm run lint,npm run typecheckandnpm testpass