Skip to content

Fetch only new rows in live views; fix select mode - #87

Merged
sbrants merged 2 commits into
mainfrom
fix/live-refresh-and-select-mode
Nov 2, 2026
Merged

sbrants merged 2 commits into
mainfrom
fix/live-refresh-and-select-mode

Conversation

@sbrants

@sbrants sbrants commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Summary

Live views refetched every row of a live run on each refresh, and select mode on the run chart was broken. Both are in v0.4.24.

Live refresh

  • The selected run in History, Dashboard and Compare now fetch only rows added since the last refresh, through a shared RunRowsReader. A refresh with 3 new rows on a 4,728-row run went from about 24 ms and 620 KB to about 0.05 ms and 400 bytes (query time and row data, measured against a real database).
  • History's coin/min, GC and wave skip tables render 100 rows per page.
  • run_rows replaces run_snapshots, run_wave_skips, run_dashboard_data and current_run_dashboard.

Select mode

  • Clicking a coin/min point did nothing, because the hover highlight took the click.
  • Turning select mode on froze the UI for about 10 s on a 4,728-row run; now about 0.3 s, thanks to paging.
  • Drags selected the wrong points on runs whose coin/min stays above zero (0 of 60 in the rectangle; now all 60).
  • Clicking a point scrolled the chart off screen.

Testing

  • npm run lint, tsc, Vitest and the Rust tests pass, with new tests for the reader's races and for run_rows_after.
  • Drove the built UI in Edge with the backend mocked, comparing against a v0.4.24 build: select mode clicks and drags, live rows, deletes staying deleted, Dashboard and Compare.
  • Not tested: the real Tauri/WebView2 app, restoring a backup, and "Follow new run".

This may help a tester's report of stutter while WaveTrace has focus, but that isn't confirmed.

🤖 Generated with Claude Code

sbrants and others added 2 commits November 2, 2026 09:45
The selected run in History, Dashboard and Compare each refetched every row
of a live run on each refresh, and History also redrew all of them, even
while its tab was hidden. A 5-hour run reached tens of thousands of DOM
elements, and the cost grew for as long as the run lasted.

- RunRowsReader keeps a rowid cursor per run and fetches only what's been
  added. The scanner only appends; edits and deletes are user actions, which
  reload in full. Rowids, because recorded_at strings have a variable number
  of fractional digits and don't compare in time order.
- History's coin/min, GC and wave skip tables render 100 rows per page.
- Revealing a row scrolls the table's own box, not the page, so selecting a
  point on the chart no longer takes the chart off screen.
- Dashboard takes the wave from the scanner event rather than a ref the
  render hasn't updated yet, which reacted one tick late.
- Replace run_snapshots, run_wave_skips, run_dashboard_data and
  current_run_dashboard with run_rows, and drop the server-side sampling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The hover highlight was drawn over the point under the mouse and took the
  click, so clicking a coin/min point did nothing.
- Map a drag through the axes' scales. It used the run's coin range, but the
  axis starts at 0 and rounds up, so the selection didn't match the rectangle
  on a run whose coin/min stays well above zero.
- Let a drag start on a point: hit circles covered most of a dense chart.
- Count a press as a drag only after 4px, not any movement.
- Shrink hit circles so GC and jump dots take fewer clicks meant for coin/min.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sbrants
sbrants merged commit b80e3fa into main Nov 2, 2026
8 checks passed
@sbrants
sbrants deleted the fix/live-refresh-and-select-mode branch November 2, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant