fix(queued-messages): clamp long queued messages to 3 lines#3163
Open
harshjainnn wants to merge 2 commits into
Open
fix(queued-messages): clamp long queued messages to 3 lines#3163harshjainnn wants to merge 2 commits into
harshjainnn wants to merge 2 commits into
Conversation
Long queued messages (e.g. a pasted code block) previously rendered at full height, and this compounded with multiple queued messages, pushing the composer off-screen. Clamp to 3 lines with a fade mask and a 'Show more/less' toggle, mirroring the clamp pattern already used for sent messages in ChatThread's UserBubble. Fixes PostHog#3150
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
Author
|
/trunk merge |
|
An error occurred while submitting your PR to the queue: |
Contributor
|
Reviews (1): Last reviewed commit: "fix(queued-messages): clamp long queued ..." | Re-trigger Greptile |
Screen readers need aria-expanded on disclosure widgets to announce collapsed/expanded state. Addresses review feedback on the queued message clamp added for PostHog#3150.
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.
Long queued messages (e.g. a pasted code block) previously rendered at full height, and this compounded with multiple queued messages, pushing the composer off-screen. Clamp to 3 lines with a fade mask and a 'Show more/less' toggle, mirroring the clamp pattern already used for sent messages in ChatThread's UserBubble.
Fixes #3150
Problem
Queued follow-up messages render at full height with no clamp. A long queued message (e.g. a pasted code block) can grow the dock to hundreds of pixels tall, and this compounds when multiple long messages are queued at once — pushing the composer off-screen.
Changes
Clamped
QueuedMessageViewcontent to 3 lines by default, with a bottom fade mask and a "Show more/less" toggle that only appears when the content actually overflows the clamp. This mirrors the existing clamp-by-measured-height pattern used inChatThread.tsx'sUserBubblefor sent messages — aResizeObservercomparesscrollHeightagainst the clampedclientHeight, since overflow can't be determined from character count alone (it depends on wrap width).Also changed the outer row's alignment from
align="center"toalign="start"so the icon and action buttons (Steer/Edit/Discard) stay pinned to the top when content spans multiple lines, instead of being vertically centered against a tall block.How did you test this?
Automatic notifications