fix(chat): action buttons hidden under next turn sticky header#10
fix(chat): action buttons hidden under next turn sticky header#10bashrusakh wants to merge 1 commit into
Conversation
…hamber#2095) The assistant block used 'relative z-0' which created a stacking context at z-index 0. The next turn's sticky user header used 'sticky top-0 z-20' creating a stacking context at z-index 20. Both were in the same parent stacking context (ChatContainer's 'relative z-0'), so z-20 painted on top of z-0, hiding the action buttons at the bottom of assistant messages. Fix: - Remove redundant 'relative' from the sticky header (sticky is already positioned, so 'relative' was redundant and confusing) - Remove 'z-0' from TurnAssistantBlock so its children are not isolated at z-index 0 - Add 'relative z-30' to action button containers in MessageBody so they paint above the sticky header's z-20
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing — created in wrong repo (fork instead of upstream). Will reopen against openchamber/openchamber. |
Summary
Fixes openchamber#2095 — action buttons (copy, edit, etc.) at the bottom of assistant messages were hidden/overlapped by the next turn's sticky user header due to a CSS stacking context conflict.
Root cause
The assistant block used
relative z-0which created a stacking context at z-index 0. The next turn's sticky user header usedsticky top-0 z-20creating a stacking context at z-index 20. Both were in the same parent stacking context (ChatContainer'srelative z-0), so z-20 painted on top of z-0 — the next turn's sticky header covered the previous turn's action buttons.Fix
Three minimal CSS-class changes across 3 files — no logic/behavior change:
TurnItem.tsx— removed redundantrelativefrom the sticky header (stickyis already a positioned element, sorelativewas redundant and confusing per issue report)TurnAssistantBlock.tsx— removedz-0so the assistant block's children are no longer isolated at z-index 0 and can participate in the parent stacking contextMessageBody.tsx— addedrelative z-30to all 3 action button containers (inline actions ~L1743, standalone actions ~L2064, turn footer ~L2072) so they paint above the sticky header's z-20Files changed
packages/ui/src/components/chat/components/TurnItem.tsxrelativefrom sticky headerpackages/ui/src/components/chat/components/TurnAssistantBlock.tsxz-0from wrapper divpackages/ui/src/components/chat/message/MessageBody.tsxrelative z-30to 3 action button containersValidation
bun run --cwd packages/ui type-checkbun run --cwd packages/ui lintLooks good to meNotes
transform: translateY(...)in MessageList.tsx as part of the root cause. Verified that MessageList.tsx actually usespaddingTop(nottransform) — the code explicitly avoidstransformto prevent breaking sticky behavior. The stacking conflict is real, but the cause is the z-0/z-20 interaction in the parent context, not a transform.