Truncate long host location with a tooltip - #52604
Conversation
A long city name overflowed the Vitals card on host details and truncated with no tooltip on My device. Render the location label through TooltipTruncatedText so both paths ellipsize and expose the full name on hover; the location modal still shows it in full. The text sits several boxes deep inside a link button on host details, and each one defaults to `min-width: auto`, so the chain needs `min-width: 0` for the text to shrink rather than widen the card. TooltipWrapper also hardcodes `cursor: default` on its element, which would otherwise beat the link button's pointer.
There was a problem hiding this comment.
🟢 Approval recommended
The UI change is localized, aligns with the linked issue’s expected behavior, and includes focused automated tests for the new tooltip behavior.
Warning
- Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.
Pull request overview
This PR addresses display issues for the Location vital on the Host details and My Device pages by ensuring long location strings truncate cleanly and expose the full value via tooltip, matching the expected behavior in issue #48910.
Changes:
- Wrapped the Location vital’s display value with
TooltipTruncatedTextso truncated locations show the full value on hover. - Added targeted layout/CSS constraints for the Location vital to allow ellipsis truncation instead of expanding the card width.
- Added RTL tests covering tooltip presence/absence based on truncation state (mocked via
useCheckTruncatedElement).
File summaries
| File | Description |
|---|---|
| frontend/pages/hosts/details/cards/Vitals/Vitals.tsx | Uses TooltipTruncatedText for the Location vital (link and non-link variants). |
| frontend/pages/hosts/details/cards/Vitals/Vitals.tests.tsx | Adds tests asserting tooltip behavior for long vs fitting location values. |
| frontend/pages/hosts/details/cards/Vitals/_styles.scss | Adds min-width: 0 and cursor inheritance fixes to enable truncation and preserve link pointer cursor. |
| changes/48910-location-truncation-tooltip | Changes entry (content excluded from this review by policy). |
Review details
Files excluded by content exclusion policy (1)
- changes/48910-location-truncation-tooltip
- Files reviewed: 3/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe Vitals location value now uses Merge Risk: ⚪ Minimal · up to Vitals location values now truncate cleanly while preserving the full value in a tooltip, with the location modal remaining available for the full location. No current merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #52604 +/- ##
==========================================
+ Coverage 75.79% 75.80% +0.01%
==========================================
Files 4097 4097
Lines 247480 247481 +1
Branches 14105 14105
==========================================
+ Hits 187578 187611 +33
+ Misses 59725 59693 -32
Partials 177 177
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Related issue: Resolves #48910
Truncates the Location vital and shows a tooltip if it doesn't fit the grid cell's width.
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/,orbit/changes/oree/fleetd-chrome/changes.See Changes files for more information.
Testing
Frontend
Summary by CodeRabbit