fix(tui): reserve stable top row for copy icon to prevent layout shift#2374
Merged
dgageot merged 1 commit intodocker:mainfrom Apr 10, 2026
Conversation
Always render the top row in assistant messages so that hovering to reveal the copy icon does not cause a 1-line layout shift. When not hovered, the row is filled with spaces (invisible); on hover, the copy icon appears in the same reserved space. This fixes the layout shift introduced by 80bccc8 without reintroducing the spurious blank-line artifact it originally fixed. Assisted-By: docker-agent
gtardif
approved these changes
Apr 10, 2026
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.
Problem
Hovering over an assistant message to reveal the copy button causes a 1-line layout shift, making the message list jump.
Root Cause
Commit 80bccc8 fixed a spurious blank-line artifact on assistant messages by only rendering the copy-icon top row when hovered. However, this meant the row appeared/disappeared on hover, causing a layout shift.
Fix
Always reserve a top row in assistant messages. When not hovered, the row is filled with spaces (invisible but space-occupying). When hovered, the copy icon appears in that same reserved space. This prevents both the layout shift and the blank-line artifact.
Assisted-By: docker-agent