mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 12:42:38 +00:00
fix(web): TruncatedLabel expands to full text, not just two lines
The expanded state used line-clamp-2, which re-truncated long values with an ellipsis after two lines — unreadable on touch where the hover tooltip is unavailable. Expand now wraps the entire string over as many lines as needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -21,8 +21,9 @@ interface TruncatedLabelProps {
|
||||
* - Hovering always shows the full text in a native browser tooltip (standard
|
||||
* tooltip, no special cursor).
|
||||
* - When `interactive` (the default), clicking — or pressing Enter/Space when
|
||||
* focused — toggles a two-line expanded view. This keeps long values readable
|
||||
* on touch devices where hover is unavailable.
|
||||
* focused — toggles a fully expanded view that wraps the entire text over as
|
||||
* many lines as needed. This keeps long values readable on touch devices
|
||||
* where hover is unavailable.
|
||||
* - When `interactive={false}`, it is a plain truncated span with only the
|
||||
* tooltip, safe to nest inside a clickable row or link.
|
||||
*/
|
||||
@@ -57,7 +58,7 @@ export default function TruncatedLabel({
|
||||
}
|
||||
}}
|
||||
className={`${className} min-w-0 cursor-pointer ${
|
||||
expanded ? "line-clamp-2 break-words" : "truncate"
|
||||
expanded ? "whitespace-normal break-words" : "truncate"
|
||||
}`}
|
||||
>
|
||||
{text}
|
||||
|
||||
Reference in New Issue
Block a user