fix: move call buttons under info panel to fix header overflow#64
Conversation
📝 WalkthroughWalkthroughChatHeader.jsx refactors the chat header layout to move action buttons into a collapsible info panel, addressing UI overflow. The component adds icon imports, creates a reusable button helper, manages panel state with click-outside and keyboard handling, implements an animated info panel with call and member controls, and updates menu wiring. ChangesChat Header Info Panel UI Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
frontend/src/components/ChatHeader.jsx (1)
254-255: ⚡ Quick winExpose info panel expanded state to assistive tech.
Add
aria-expanded+aria-controlson the toggle, and anidon the panel for better accessibility semantics.Suggested refactor
- <IconBtn onClick={() => setShowInfoPanel(v => !v)} aria-label="Open chat info"> + <IconBtn + onClick={() => setShowInfoPanel(v => !v)} + aria-label="Open chat info" + aria-expanded={showInfoPanel} + aria-controls="chat-info-panel" + > <Info size={18} /> </IconBtn> ... - <motion.div + <motion.div + id="chat-info-panel"Also applies to: 265-274
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@frontend/src/components/ChatHeader.jsx` around lines 254 - 255, The toggle button IconBtn (onClick={() => setShowInfoPanel(v => !v)}) does not expose state to assistive tech; add aria-expanded={showInfoPanel} and aria-controls="chat-info-panel" to the IconBtn and give the info panel element (the block rendered around lines 265-274) an id="chat-info-panel" so screen readers can associate the control with the panel and announce its expanded/collapsed state; ensure the aria-expanded value uses the same showInfoPanel state and the id is unique in the component.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@frontend/src/components/ChatHeader.jsx`:
- Around line 285-288: The img in the ChatHeader info panel is missing an alt
attribute; update the <img> element (inside ChatHeader.jsx / ChatHeader
component) to include a descriptive alt value using available data (e.g., use
selectedUser?.name to produce something like "<name> avatar" with a fallback
like "User avatar" or "Default avatar") so screen readers receive meaningful
text; ensure the prop is added to the same <img> that currently uses
src={selectedUser?.profilePic || "/avatar.png"}.
---
Nitpick comments:
In `@frontend/src/components/ChatHeader.jsx`:
- Around line 254-255: The toggle button IconBtn (onClick={() =>
setShowInfoPanel(v => !v)}) does not expose state to assistive tech; add
aria-expanded={showInfoPanel} and aria-controls="chat-info-panel" to the IconBtn
and give the info panel element (the block rendered around lines 265-274) an
id="chat-info-panel" so screen readers can associate the control with the panel
and announce its expanded/collapsed state; ensure the aria-expanded value uses
the same showInfoPanel state and the id is unique in the component.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: da8c5475-fa29-488f-865e-ef0ff1e94985
📒 Files selected for processing (1)
frontend/src/components/ChatHeader.jsx
|
Thanks for the contribution! I have added some follow-up responsiveness and positioning fixes on top of this, and everything is working properly now. |
Fixes #59
Problem
On small/mobile screens, the chat header pill containing Info + Phone + Video buttons overflows outside the screen, making buttons inaccessible.
Solution
Removed the overflowing pill from the header
Added a single ⓘ Info button that opens a dropdown panel
Dropdown now shows:
Groups also show a Members button inside the dropdown
Added a mobile backdrop overlay when the panel is open
Added responsive width using
min(90vw, 16rem)to prevent overflowAdded outside-click close behavior
Added Escape key support for accessibility
Added
aria-labelsupport toIconBtnBefore
After
Files Changed
frontend/src/components/ChatHeader.jsxSummary by CodeRabbit
Release Notes