Skip to content

Commit fc5bdd9

Browse files
fix(timeline): position tooltip above cursor to prevent overlap (#758)
The timeline tooltip was positioned at/below the cursor, overlapping and obscuring the timeline bars underneath. Two changes: 1. CSS: Added transform: translateY(-100%) on .vis-tooltip to shift the tooltip above the cursor instead of below it 2. Changed overflowMethod from 'cap' to 'flip' so the tooltip flips to the other side when it would overflow the timeline boundary, rather than being clipped Fixes ActivityWatch/activitywatch#1181
1 parent 8d32ea9 commit fc5bdd9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/visualizations/VisTimeline.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@ div#visualization {
1919
overflow: visible;
2020
}
2121
22+
.vis-tooltip {
23+
// Position tooltip above the cursor instead of overlapping the timeline bars
24+
transform: translateY(-100%);
25+
margin-top: -15px;
26+
// Ensure tooltip is readable
27+
max-width: 400px;
28+
pointer-events: none;
29+
}
30+
2231
.timeline-timeline {
2332
font-family: sans-serif !important;
2433
@@ -83,7 +92,7 @@ export default {
8392
stack: false,
8493
tooltip: {
8594
followMouse: true,
86-
overflowMethod: 'cap',
95+
overflowMethod: 'flip',
8796
delay: 0,
8897
},
8998
},

0 commit comments

Comments
 (0)