Skip to content

fix(tui): reserve stable top row for copy icon to prevent layout shift#2374

Merged
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/fix-copy-button-causing-message-layout-s-b4787271
Apr 10, 2026
Merged

fix(tui): reserve stable top row for copy icon to prevent layout shift#2374
dgageot merged 1 commit intodocker:mainfrom
dgageot:board/fix-copy-button-causing-message-layout-s-b4787271

Conversation

@dgageot
Copy link
Copy Markdown
Member

@dgageot dgageot commented Apr 10, 2026

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

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
@dgageot dgageot requested a review from a team as a code owner April 10, 2026 14:03
@dgageot dgageot merged commit d773763 into docker:main Apr 10, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants