Skip to content

Commit 1ad1312

Browse files
committed
timeline: compact the loaded-edge extend affordance to an icon button
The wide text pill floated over the axis and hid the first tick label. The sentence moves to a tooltip; the tick culling is edge-aware so no label renders under the button.
1 parent cc855ad commit 1ad1312

1 file changed

Lines changed: 24 additions & 21 deletions

File tree

packages/k8s-ui/src/components/timeline/TimelineSwimlanes.tsx

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,8 @@ export function TimelineSwimlanes({ events, isLoading, onResourceClick, viewMode
19301930
// window start would bleed over the Resource column
19311931
// header. Also cull the tick whose label would collide
19321932
// with the "Now" label at the live edge.
1933-
if (x < 1.5 || x > 100) return null
1933+
if (x < (atPastEdge ? 3.5 : 1.5)) return null
1934+
if (x > (atFutureEdge ? 96.5 : 100)) return null
19341935
if (nowVisible && Math.abs(x - nowX) < 4) return null
19351936
return (
19361937
<div
@@ -1967,28 +1968,30 @@ export function TimelineSwimlanes({ events, isLoading, onResourceClick, viewMode
19671968
{/* Extend affordances at the loaded-range edges. Stop propagation so
19681969
clicking doesn't also start a pan drag on the container. */}
19691970
{atPastEdge && (
1970-
<button
1971-
type="button"
1972-
onMouseDown={(e) => e.stopPropagation()}
1973-
onClick={(e) => { e.stopPropagation(); onExtendRequest?.('past') }}
1974-
className="absolute left-0 top-1/2 z-30 flex -translate-y-1/2 items-center gap-1 rounded border border-theme-border bg-theme-elevated px-1.5 py-0.5 text-[10px] text-theme-text-secondary shadow-theme-sm transition-colors hover:bg-theme-hover hover:text-theme-text-primary"
1975-
aria-label="Extend the loaded range further into the past"
1976-
>
1977-
<ChevronLeft className="h-3 w-3" />
1978-
Start of loaded range — extend
1979-
</button>
1971+
<Tooltip content="Start of loaded history — load earlier" position="bottom">
1972+
<button
1973+
type="button"
1974+
onMouseDown={(e) => e.stopPropagation()}
1975+
onClick={(e) => { e.stopPropagation(); onExtendRequest?.('past') }}
1976+
className="absolute left-0 top-1/2 z-30 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded border border-theme-border bg-theme-elevated text-theme-text-secondary shadow-theme-sm transition-colors hover:bg-theme-hover hover:text-theme-text-primary"
1977+
aria-label="Extend the loaded range further into the past"
1978+
>
1979+
<ChevronLeft className="h-3 w-3" />
1980+
</button>
1981+
</Tooltip>
19801982
)}
19811983
{atFutureEdge && (
1982-
<button
1983-
type="button"
1984-
onMouseDown={(e) => e.stopPropagation()}
1985-
onClick={(e) => { e.stopPropagation(); onExtendRequest?.('future') }}
1986-
className="absolute right-0 top-1/2 z-30 flex -translate-y-1/2 items-center gap-1 rounded border border-theme-border bg-theme-elevated px-1.5 py-0.5 text-[10px] text-theme-text-secondary shadow-theme-sm transition-colors hover:bg-theme-hover hover:text-theme-text-primary"
1987-
aria-label="Extend the loaded range further toward now"
1988-
>
1989-
End of loaded range — extend
1990-
<ChevronRight className="h-3 w-3" />
1991-
</button>
1984+
<Tooltip content="End of loaded history — load more recent" position="bottom">
1985+
<button
1986+
type="button"
1987+
onMouseDown={(e) => e.stopPropagation()}
1988+
onClick={(e) => { e.stopPropagation(); onExtendRequest?.('future') }}
1989+
className="absolute right-0 top-1/2 z-30 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded border border-theme-border bg-theme-elevated text-theme-text-secondary shadow-theme-sm transition-colors hover:bg-theme-hover hover:text-theme-text-primary"
1990+
aria-label="Extend the loaded range further toward now"
1991+
>
1992+
<ChevronRight className="h-3 w-3" />
1993+
</button>
1994+
</Tooltip>
19921995
)}
19931996
</div>
19941997
</div>

0 commit comments

Comments
 (0)