Repository navigation
Description
Describe the bug
The right-side "Chat context navigation" rail (chat minimap) shows a preview tooltip when hovering a tick. While the rail has few entries the tooltip is aligned with the hovered tick. Once the rail has enough entries for its rows to be compressed by flexbox (loading "earlier history" is enough), the tooltip is positioned progressively further below the hovered tick; past ~29 entries it is rendered outside the rail box and gets clipped/invisible, so it looks like the tooltip is "occluded" or missing.
To reproduce
Steps to reproduce the behavior:
- Open a session whose rail has few entries (e.g. 2) and hover a tick → the tooltip is correctly aligned with the tick.
- Click "View earlier history" at the top of the transcript to load the full history. The rail now holds many entries (86 in my case; the rail box stays 520 px tall).
- Hover a tick toward the bottom of the rail.
→ The tooltip appears far below the cursor; for the later ticks it lands outside the rail and is not visible at all.
Expected behavior
The tooltip stays vertically aligned with the hovered tick for any number of entries.
Screenshots
Not attached; the drift is expressed numerically instead:
- Hovering tick index 20 — tooltip drawn ~235 px below the hovered row (row center y≈232, tooltip y≈467).
- Hovering tick index 60 — tooltip lands at y≈1187 px, outside the 900 px viewport, so nothing is visible.
Environment
- OS: Linux 6.8.0-138-generic x86_64 (Ubuntu)
- Node.js version: v22.22.2
- omp version: omp/18.10.0
- Browser: Chromium 1400×900 (managed headless); reproducible in a regular Chromium window as well
- omp-web version: 0.5.1 (bug still present on main / 0.5.2)
Additional context
Root cause: the tooltip's vertical position assumes every rail row is exactly ROW_HEIGHT (18 px) tall, but the rail is a flex column with max-height: min(75vh, 520px) and its rows are allowed to shrink, so their real height becomes ~520 / N once the list is long. The tooltip is deliberately rendered in the unclipped outer container (so it is not cut by the rail's own overflow) and positioned purely from the index — that is where the 18 px assumption comes from (introduced/refined in #26).
components/ChatMinimap.tsx (main):
- L86
const ROW_HEIGHT = 18; - L316
const tooltipTopPx = displayTooltipIndex !== null ? 6 + displayTooltipIndex * ROW_HEIGHT + ROW_HEIGHT / 2 : 0; - L340
top: tooltipTopPx, - L382
maxHeight: "min(75vh, 520px)", - L383
overflowY: nodes.length > 25 ? "auto" : "visible", - L433 row style
height: ROW_HEIGHT,(noflexShrink: 0/minHeight, so rows compress instead of the rail scrolling)
Measured on 0.5.1 with 86 entries (rail box 520 px, rows compressed to ~6 px, offsetTop stride ≈ 5.9 px) while the tooltip keeps the 18 px stride:
| tick index | real row top (px) | tooltip top (px) |
error |
|---|---|---|---|
| 0 | 6 | 15 | +6 |
| 1 | 12 | 33 | +18 |
| 20 | 123 | 375 | +249 |
| 40 | 239 | 789 | +547 |
| 70 | 415 | 1329 | +911 |
| 85 | 502 | 1545 | +1040 (outside the 520 px rail → clipped) |
Rows keep their 18 px height only while 18 * N <= 520, i.e. N <= 28; beyond that the formula diverges linearly, which is why the bug only shows up after loading the earlier history.
Suggested fix (either):
- Derive the tooltip position from the real row geometry — look the row up by
data-indexand use itsoffsetTop + offsetHeight / 2(correct both when rows are compressed and when the rail scrolls); or - Keep the row height fixed (
flexShrink: 0/minHeight: ROW_HEIGHT) so the rail really scrolls at >25 entries — then the tooltip must also account for the rail'sscrollTop.
Activity
fix(chat): map minimap drag to the scrolled row and always allow rail…
fix(chat): scroll active minimap row into view on actual overflow (#251)
fix(chat): keep minimap tooltip aligned when the rail scrolls (#251) (#…