Repository navigation
feat(apollo-wind): close the chat primitive gaps found by the Wind chat - #1402
Draft
BenGSchulz wants to merge 1 commit into
Draft
BenGSchulz wants to merge 1 commit into
BenGSchulz wants to merge 1 commit into
Conversation
The Wind chat renderers worked around several apollo-wind gaps. This adds the smallest options that let them drop those workarounds: - CodeBlock: a body slot that replaces the highlighted source (an inline HTML preview toggled from the header actions); false, null and undefined keep the source. Markdown gains renderCodeBlock, which gets each block and the CodeBlock props it would use, so a host can keep per-block state such as that toggle. - Markdown: katexOptions for strict and macros. Output stays MathML and trust stays off. Each render gets its own copy of macros, since KaTeX writes \gdef into the object it is given. rehype-katex re-renders a formula that fails strict mode leniently, so strict only reports (Material behaves the same way). Display math no longer overflows vertically by a pixel, which made it an unfocusable scroll region. - Dialog and Sheet: strings for their built-in button labels. - DisclosureTree: a new read-only ARIA tree for traces and nested results (no toolbar, defaultExpanded or controlled open rows, lazy children, leading icon, trailing info, description as tooltip and accessible description, roving tabindex with arrow keys, Home/End, Enter/Space). Each treeitem contains its group and is named by its label. TreeView stays the file manager; switching its search, selection and menus off would not give it tree keyboard navigation. Its rows share ToolCall's row style. - DropzoneOverlay: typesHint, sizeHint and countHint lines under the hint, empty by default. A paste with files is kept from the field unless nothing was accepted and it carries text, so that text lands. - AttachmentTitle: a tooltip with the full name while it is cut off. - Search and SearchWithSuggestions: strings for the clear button label. - EmptyState: a compact size for panels, with no heading element. - Animations: the animate-in/out, fade, zoom and slide utilities that the shadcn overlays use generated no CSS. They are now defined in the package's utilities (not tw-animate-css, which would redefine delay-* for consumers and clash with the collapsible keyframes), and an unlayered rule turns them off for prefers-reduced-motion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Dependency License Review
License distribution
Excluded packages
|
This branch was successfully deployed
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.
Summary
MST-16880, part of the Wind chat epic MST-16172. Stacked on #1400 (math fences); the next PR adds compact density.
The Wind chat renderers (R-3 to R-8) worked around gaps in apollo-wind primitives. This adds the smallest options that let them drop those workarounds, plus the overlay animations that generated no CSS.
Ticket correction: KaTeX
strictThe ticket says input Material rejects renders in Wind because Material uses
strict: true. It does not: Material also renders math through rehype-katex, and when a formula fails strict mode rehype-katex renders it again withstrict: 'ignore'.strict: trueand'ignore'produce identical HTML (checked). Material's directkatex.renderToStringpath incode.tsxnever runs for math fences, because rehype-katex replaces them first.katexOptions.strictis still exposed, documented as reporting only.Changes per item
bodyreplaces the highlighted source; header, actions and copy stay.false,null,undefinedkeep the source.renderCodeBlock(block, props)renders each fenced block with the props Markdown would passCodeBlock, so a host component can keep per-block state (a preview toggle).renderCodeActionsstays.katexOptions: { strict, macros }. Output stays MathML andtruststays off, applied after the options. Each render gets its own copy ofmacros.\gdefinto the object it is given: a shared one would let one message redefine a host macro for later messages, and a frozen one would throw.overflow-y-hiddennext to its horizontal scroll.scrollable-region-focusable(1 to 2px of vertical overflow) on main's Math story and #1400's MathFences story.DialogStrings/DEFAULT_DIALOG_STRINGS:close,closeTakeover,expand,collapse.SheetStrings/DEFAULT_SHEET_STRINGS:close.defaultExpandedor controlledexpanded/onExpandedChange, lazy children (built once per item object), leadingicon,trailinginfo,descriptionas tooltip and accessible description, roving tabindex with Up/Down, Home/End, Right/Left, Enter/Space. Each treeitem contains its group and is named by its label. Rows shareToolCall's row style through an internal module.TreeView: TreeView is a file manager (search, drag selection, context menus, a HoverCard per row, inline English copy, every row tabbable), and switching that off would still not give it tree keyboard navigation.typesHint,sizeHint,countHintstrings, shown under the hint when not empty.truncationTooltip={false}.TooltipProvider(a context, no DOM).SearchStrings/DEFAULT_SEARCH_STRINGSwithclear;SearchWithSuggestionspassesstringsthrough.size="compact"for panels: smaller type and spacing,smbuttons, no heading element.animate-in/animate-outwithfade-*,zoom-*andslide-*modifiers (numbers, fractions, bare, arbitrary values) intailwind.utilities.css, plus an unlayered reduced-motion rule.delay-*for every consumer, its collapsible keyframes clash with ours, and it has no reduced-motion handling. The unlayered rule also wins over tw-animate-css if a host loads it.Host-visible changes and release notes
prefers-reduced-motion. Radix Presence keeps a closing overlay mounted until its exit animation ends, so downstream e2e tests that assert immediate removal may need to wait. Consumers ofdist/styles.cssand of@uipath/apollo-wind/tailwind.css(as apollo-react'stailwind.chat.cssandtailwind.canvas.cssimport it) both get the utilities; checked by compiling a sheet of that shape.DropzoneOverlayStringsgains requiredtypesHint,sizeHintandcountHint. A host that builds the full object (not aPartial) gets a type error until it adds them.enablePasteno longer blocks text pasted along with refused files.TreeView.data-state) by default.What the Wind chat can drop in its follow-up
CodeBlockActionsopening the HTML preview in a Dialog: an inline code and preview toggle throughrenderCodeBlockandbody, as Material does.showCloseButton={false}plus its own close):DialogContentstrings.DisclosureTreeandopenState: apollo-windDisclosureTreewithexpanded/onExpandedChangefor the tree message and the Traces section.typesHint,sizeHint,countHint.titleTruncatedChip(nativetitleon pointer over): the built-in tooltip.showClearButton={false}on the history Search:strings.clear.EmptyMessagein the history panel:EmptyState size="compact".WindChatDropzone, ifenablePastewith the remaining count covers it.strict: Wind already matches Material.Out of scope, noted
disabledDropzoneOverlay still lets a dropped file open in the tab; the chat keeps its panel-scoped guard.MarkdownCodeBlockhas no per-block streaming flag; the host passes its message-level flag.AttachmentGroupthat overflows with chips that have no buttons (the chat's message attachments) is a scroll region keyboard users cannot reach.Tests
falseandnull), renderCodeBlock props, KaTeX macros (passed through, host object unchanged after\gdef, frozen object still renders) andtruststaying off, display math overflow classes, Dialog, Sheet and Search strings, SearchWithSuggestions strings, DropzoneOverlay limit lines and paste (accepted with text, refused with text, image only), AttachmentTitle tooltip (cut off, fits, re-measured, axe with the tooltip open), EmptyState compact (with axe), DisclosureTree (structure, ownership, naming, click, controlled, lazy, keyboard including Right on an open row with no children, zero-valued slots, description, axe).tailwind.animations.test.tscompiles the utilities with Tailwind: keyframes, the unlayered reduced-motion rule, and ten value forms.apollo-enterand closing withapollo-exit. The HTML preview stories usesandbox="allow-scripts"with a no-referrer and CSP prefix, shared from.storybook/html-preview.ts.tsc --noEmit, the full apollo-wind suite andpnpm --filter @uipath/apollo-wind build.🤖 Generated with Claude Code