Conversation
|
@Dtem4ik is attempting to deploy a commit to the Agentset Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been 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.
Fixes #131
Wide KaTeX display math (and long unbroken strings) rendered inside the citation/source modal overflowed the dialog horizontally and broke its layout.
Root cause: Streamdown wraps tables and code blocks in overflow-x-auto containers, but KaTeX output has no overflow handling — .katex-display > .katex is a white-space: nowrap block. On top of that, DialogContent is a CSS grid, so the chunk wrapper (a grid item with default min-width: auto) stretched past the dialog's max-width.
Fix:
MessageResponse: add wrap-break-word and give .katex-display its own horizontal scroll (overflow-x-auto / overflow-y-hidden). This also fixes the same overflow in the chat and the document chunks drawer, which share the component.
Citation modal: add min-w-0 to the per-chunk wrapper so it can shrink inside the dialog grid.
Before/after screenshots attached (isolated reproduction using the exact component classes and real KaTeX rendering).
Greptile Summary
This PR fixes horizontal overflow of wide KaTeX display-math (and long unbroken strings) in the citation modal, the chat view, and the document-chunks drawer that all share
MessageResponse.packages/ui/src/components/ai-elements/message.tsx: addswrap-break-word(Tailwind v4'soverflow-wrap: break-word) and a scoped[&_.katex-display]:overflow-x-autoselector so KaTeX display blocks scroll horizontally instead of bursting past the container.apps/web/src/components/chat/citation-modal.tsx: addsmin-w-0to the per-chunk wrapper div so it can shrink inside the CSS grid created byDialogContent, preventing the grid item from pushing past the dialog'smax-width.Confidence Score: 4/5
The changes are narrowly scoped CSS-class additions; the core logic is unchanged and both fixes are well-understood patterns for grid and overflow layout.
The
overflow-y-hiddencompanion tooverflow-x-autosuppresses the implicit scrollbar but also clips vertical overflow. KaTeX typically sizes its container accurately, yet tall or annotated math expressions can produce ink that exceeds the computed height, andhiddenwould silently cut it off.The
overflow-y-hiddenrule inpackages/ui/src/components/ai-elements/message.tsxdeserves a second look —overflow-y-clipwould be a safer option.Important Files Changed
wrap-break-word(valid Tailwind v4 utility) and a[&_.katex-display]:overflow-x-auto/overflow-y-hiddenselector to fix KaTeX display-math overflow in all contexts that use MessageResponse; theoverflow-y-hiddencarries a small risk of clipping unusually tall math elements.min-w-0to the per-chunk wrapper so it can shrink inside the CSS grid created by DialogContent — a standard and correct fix for the gridmin-width: autoissue.Reviews (1): Last reviewed commit: "Fix horizontal overflow of wide math con..." | Re-trigger Greptile