fix: project nav width in different language - #1641
Conversation
PR Summary by QodoFix project dropdown width for localized project names
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe project dropdown content changes from fixed width ChangesProject navigation dropdown
Estimated code review effort: 1 (Trivial) | ~2 minutes Merge Risk: ⚪ Minimal · up to This localized change adjusts the project dropdown width for different languages and introduces no actionable merge-blocking risk beyond normal checks and review. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Code Review by Qodo
1. Min-width unintentionally removed
|
| className="w-auto rounded-lg" | ||
| side={isMobile ? "bottom" : "right"} | ||
| align={isMobile ? "end" : "start"} |
There was a problem hiding this comment.
1. Min-width unintentionally removed 🐞 Bug ≡ Correctness
NavProjects sets DropdownMenuContent to "w-auto", which matches MenuPopup’s "[class*='w-']" check and disables the component’s built-in "min-w-32" fallback. This can make the menu shrink narrower than before and increases the chance of wrapped labels being visually clipped given the fixed "h-7" menu item heights in this dropdown.
Agent Prompt
### Issue description
`NavProjects` changed the project context dropdown width from a fixed `w-44` to `w-auto`. In `MenuPopup` (aliased as `DropdownMenuContent`), a default `min-w-32` is applied **only** when the consumer does *not* provide any class containing `w-`. Because `w-auto` contains `w-`, the default minimum width is now disabled, which can cause overly narrow popups and wrapping/clipping regressions.
### Issue Context
- `MenuPopup` has a conditional Tailwind rule: `not-[class*='w-']:min-w-32`.
- Adding `w-auto` is effectively redundant (divs are `width: auto` by default), but it changes behavior by suppressing the default min width.
### Fix Focus Areas
- apps/web/src/components/nav-projects.tsx[280-284]
- apps/web/src/components/ui/menu.tsx[55-74]
### Suggested fix
Use one of these approaches:
1) Remove the explicit width class entirely and rely on the shared default min width:
- change `className="w-auto rounded-lg"` -> `className="rounded-lg"`
2) If you want to preserve the old minimum while allowing growth for longer translations, set a min-width explicitly:
- e.g. `className="min-w-44 rounded-lg"` (and do **not** use a fixed `w-*`).
Option (2) most closely keeps the previous baseline width while still fixing long-language truncation/wrapping.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
@MonsPropre thank you for the contribution. Can you take a look at this comment and decide if you want to implement it? If you do not, please provide your reasoning. Thanks!
Description
Fix width for project dropdown menu
Related Issue(s)
N/A
Type of Change
How Has This Been Tested?
Screenshots (if applicable)
Checklist
Additional Notes
N/A
Summary by CodeRabbit