fix(mobile): wrap long tooltip data and example pattern so the page doesn't widen - #991
Conversation
…oesn't widen vis-timeline sets white-space: nowrap on .vis-tooltip, so the existing max-width: 400px never wrapped anything: long unbroken event data (JSON, URLs) overflowed the tooltip and made the whole page wider than the viewport on mobile, which in turn pushed the event editor modal off screen. Wrap the tooltip text, and cap its width to the viewport. The 'Always count as active pattern' example expression on /settings/categorization was wrapped in text-nowrap and had the same effect. Measured in headless Chrome at a 375px viewport with a 180-char unbroken title: document scroll width 2379px before, 375px after. Git-Session-Id: a074
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #991 +/- ##
=======================================
Coverage 57.62% 57.62%
=======================================
Files 51 51
Lines 3219 3219
Branches 751 751
=======================================
Hits 1855 1855
Misses 1348 1348
Partials 16 16 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
🤖 AI code reviewThis PR adjusts CSS in two Vue components to prevent long unbroken text from widening the page on mobile. In VisTimeline.vue, the .vis-tooltip rule gains max-width: min(400px, calc(100vw - 20px)), box-sizing: border-box, white-space: normal, and overflow-wrap: anywhere. In ActivePatternSettings.vue, the example expression span loses its text-nowrap class so it can wrap. Safe to merge — no P0/P1 findingsConfidence 5/5 ✅ No thread-worthy findings. Advisory notes follow; they are retained without opening review threads. 2 advisory findings (summary-only, not scored)These P2 guard, heuristic, trade-off, or documentation claims are retained for judgment without opening review threads.
This is a How this was verified: static preflight: fix-commit + touched-files scan (rule 7)
The new max-width: min(400px, calc(100vw - 20px)) uses 100vw, which on mobile browsers includes the vertical scrollbar width (or the layout viewport width) and can be larger than the actual visible viewport width when a scrollbar is present. On desktop, 100vw includes the scrollbar width, so the tooltip can be up to ~15px wider than the visible area, potentially causing a horizontal scrollbar or slight overflow. On mobile, 100vw typically equals the layout viewport width, but the 20px margin may not account for all browser UI overlays. The observable consequence is that the tooltip may still slightly exceed the visible viewport on some devices, though the PR's main goal of preventing page widening is mostly achieved. This is a minor edge case; the fix is to use 100dvw or a percentage-based width, but the current approach is a reasonable heuristic. How this was verified: Checked the CSS rule in the file and the PR description's verification table. The use of 100vw is a known issue on mobile where it includes scrollbar width. The PR's own verification used a 375px-wide frame without a scrollbar, so it wouldn't catch this. Files changed (2) — the diff as I read it
Reviewed Maintainer commands
|
|
CI-green and mergeable (Greptile 5/5) — waiting only on a maintainer click. This PR is ready to merge, but the bot has pull-only access to this repo and can't self-merge — surfacing it here so it isn't lost. The monitoring loop will stop re-flagging it now that this note is posted. |
Partial fix for #984 (the layout part; see "Not covered" below).
Problem
On mobile, tapping a timeline event opens a tooltip whose data line (usually a long JSON string or URL) has no break opportunities. vis-timeline ships
div.vis-tooltip { white-space: nowrap }, so the existingmax-width: 400pxon the tooltip never wrapped anything: the text overflowed the box and made the whole page wider than the viewport. The event editor modal then sizes itself to the widened page and ends up off screen.The second symptom in the issue, the "Always count as active pattern" example expression on
/#/settings/categorizationstretching the page, comes from the example sitting in atext-nowrapspan.Change
VisTimeline.vue: tooltip getswhite-space: normal,overflow-wrap: anywhere,box-sizing: border-box, andmax-width: min(400px, calc(100vw - 20px))so it can't exceed the viewport on phones.ActivePatternSettings.vue: droptext-nowrapfrom the example span so it wraps.Verification
Reproduced in headless Chrome with the real vis-timeline CSS and a tooltip holding a 180-char unbroken title plus a 120-char URL, in a 375px-wide frame:
vue-cli-service lintis clean on both files andjest --selectProjects jsdompasses (18 suites, 99 tests). There's no unit coverage for this CSS; the check above is the evidence.Not covered
The issue also reports that editing an event through the modal opened from the timeline doesn't refresh the timeline, unlike the "Edit" button path. That's a separate data-flow bug and isn't touched here, so #984 should stay open for it.