Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/preview-above-icons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@karnstack/kino": patch
---

When the track has icon markers, every hover preview now sits above the icon row, so it never covers the icons.
4 changes: 3 additions & 1 deletion src/styles/kino.css
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,10 @@
pointer-events: none;
z-index: 2;
}
/* With icon markers on the track, every preview sits above the icon row,
so a preview never covers the icons. */
.kino .kino-preview.kino-preview-above-icon {
bottom: calc(100% + 11px);
bottom: calc(100% + 20px);
}
/* A marker's own preview content: full size, left-aligned, wraps at 300px
(or the scrubber width, if that is smaller). */
Expand Down
14 changes: 14 additions & 0 deletions src/ui/scrubber.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,20 @@ test("the preview rises above an icon marker but not a dot marker", () => {
).toBe(false)
})

test("with any icon marker on the track, a dot marker's preview also rises", () => {
withMarkers([
{ id: "r", time: 20, icon: "🔥" },
{ id: "a", time: 50 },
])
stubRect(screen.getByTestId("kino-track"))
hoverMarker(screen.getAllByTestId("kino-marker")[1]!)
expect(
document
.querySelector(".kino-preview")!
.classList.contains("kino-preview-above-icon"),
).toBe(true)
})

test("hovering a marker shows the marker's own time", () => {
withMarkers([{ id: "a", time: 50, label: "x" }])
stubRect(screen.getByTestId("kino-track"))
Expand Down
2 changes: 1 addition & 1 deletion src/ui/scrubber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function Scrubber() {
const previewClass = [
"kino-preview kino-glass",
rich != null && "kino-preview-rich",
hoverMarker?.icon && "kino-preview-above-icon",
shown.some((m) => m.icon) && "kino-preview-above-icon",
]
.filter(Boolean)
.join(" ")
Expand Down
Loading