Files
Remote-Terminal-for-MeshCore/frontend
Ryan Gregg fab331e67e Virtualize the message list
A conversation rendered every message it had loaded. Nothing bounded that
work, so cost grew with history: at 2000 messages the list mounted ~20k DOM
nodes, took ~285ms to mount, and ~212ms to re-render on any update. While
that runs, nothing else on the main thread gets a turn, typing included.

Only the visible window is mounted now, measured in Chromium with the real
component tree:

  history    mount            re-render        DOM nodes
    2000     285ms -> 4ms     212ms -> 2.2ms   22038 -> 225

Rendered rows stay at ~17 regardless of how much history is loaded.

Row heights are measured rather than assumed, since messages vary from one line
to a wrapped paragraph with path badges, so the scroll behaviors that used
to do height arithmetic now anchor by index instead, which is exact even
when off-screen rows still carry estimated heights:

- opening a conversation, and following new messages, anchor to the last row
- loading older messages anchors to the message that was on top
- jump-to-message and jump-to-unread scroll by index, since the target row
  may not be mounted yet

Two degenerate cases are handled explicitly: a viewport that measures zero
(before first layout, hidden tab) falls back to a nominal height instead of
collapsing the window to nothing, and a row that measures zero keeps its
estimate instead of ballooning the window.

Most of the diff is re-indentation from the new wrapper element; the real
change is 112 added / 36 removed lines (git diff -w).
2026-07-25 12:32:14 -07:00
..
2026-04-16 21:44:52 -07:00
2026-07-25 12:32:14 -07:00
2026-03-08 12:34:47 -07:00
2026-04-16 21:44:52 -07:00
2026-07-25 12:32:14 -07:00
2026-07-25 12:32:14 -07:00
2026-01-06 20:02:48 -08:00
2026-03-03 20:07:45 -08:00
2026-02-10 16:47:46 -08:00