Repository navigation
Description
Problem
A conversation's stored transcript only ever grows: messages are appended (appendStoredConversationMessages, ui-packages/web/src/data/conversation-store.ts:84-108) and nothing trims them — compaction bounds the model's context, not the record a reader reopens. An idle conversation leaves memory on switch (letGo/releaseSession, ui-packages/web/src/features/conversation/use-conversation/navigation.ts:53-56), so every switch back re-reads the whole history — getStoredConversation does getAll on the message index and sorts it in memory (conversation-store.ts:61-76) — and attachAgent plus displayMessages then feed every message to the panel, which renders them all with no windowing (ui-packages/web/src/features/conversation/conversation-messages.tsx:177-189; memoization at :141-142 protects typing in the composer, not the size of the list).
The product's own framing is "weeks of questions and answers" living in one conversation (#50), and background answering (#198) makes switching between several long-lived conversations a routine move. Yet the assistant panel is the one large list in the app with no window: the Files tree got that diagnosis as #166, the sheet grid virtualizes its rows (useVirtualizer, xlsx-reader/sheet-grid.tsx:34-39) and clamps its columns — a 2,000-message transcript renders 2,000 message components and re-reads them all from IndexedDB on every visit, so the older a conversation gets, the slower it opens and the heavier it is to scroll.
Proposal
- Render a window of the transcript: the last screenfuls of messages, with older ones read and mounted as the reader scrolls up — the same treatment the sheet grid already gives its rows.
- The full transcript stays in storage untouched; compaction continues to bound the model's context only.
Goal
After this, opening or switching back to a conversation takes the same time and memory whether it holds 20 messages or 2,000: the panel renders the messages on screen, and older messages appear as the reader scrolls up rather than being mounted up front.
Verification
grep -rEq "useVirtualizer|visibleMessages|windowed" ui-packages/web/src/features/conversation/conversation-messages.tsx
pnpm --filter @gamma-reader/web test --silent
pnpm checkRefs
- ui-packages/web/src/data/conversation-store.ts:61-76,84-108 — whole-history read on open; append-only storage, no trim
- ui-packages/web/src/features/conversation/use-conversation/navigation.ts:53-56,133-158 — an idle conversation leaves memory, so every switch back re-reads it
- ui-packages/web/src/features/conversation/use-conversation/agent-session.ts:93-99 — reopening attaches all stored messages
- ui-packages/web/src/features/conversation/conversation-messages.tsx:141-198 — the list renders every message, unwindowed
- ui-packages/web/src/features/reader/xlsx-reader/sheet-grid.tsx:34-39 — the windowing pattern the sheet already uses
- Keep the Files panel fluent at the 5000-file import cap — every row renders today, unwindowed #166 — the same unwindowed-list diagnosis on the Files panel
- Cap what open tabs hold in memory — every visited tab stays mounted today, and each open PDF keeps its loaded document until the tab closes #175 — the same everything-stays-mounted family on tabs
- Long conversations hit the context wall silently — every follow-up then fails, with no warning and no repair path #70 — the context wall compaction solved; this is the transcript's side, which compaction does not bound
- Give conversations an export path — weeks of questions and answers live and die with the browser profile #50 — "weeks of questions and answers": long-lived conversations are the product's stated use
- PR feat: conversations keep answering in the background, with a list to switch between them #198 — background conversations make switching between long-lived conversations routine
Activity
bencode commentedon Oct 23, 2026
Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session.
Evidence audit (HEAD
da3dfad): confirmed, every anchor exact.getStoredConversationdoesgetAll+ in-memory sort (conversation-store.ts:61-76); storage is append-only — the sole message deletion is whole-conversation removal (:134-143), no trim path exists;letGo/releaseSession(navigation.ts:53-56) means every switch back re-reads (switchTo:133-158);attachAgenttakes all stored messages (agent-session.ts:93-99); the panel maps every message unwindowed (conversation-messages.tsx:177, memo at:141-142protects composer typing only); the sheet grid'suseVirtualizerprecedent is atsheet-grid.tsx:34-39. Referenced issues check out: #166/#175 open, #70/#50 closed, PR #198 merged inda3dfad.Duplicate check: none across open + closed titles (#166/#175 are cross-referenced family, different surfaces).
Sensor: lint ✓ · verify ✗ (expected — no windowing in the panel yet).
Sharpening:
readConversation→getAllstill scales with history on every switch, andattachAgent'srawMessagesneeds the full (or compacted) transcript for context. Say explicitly whether the first cut windows only the render and accepts the re-read, or windows the read too.Valid; stays open.
bencode commentedon Oct 25, 2026
Independent re-review — posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audited at HEAD
90b046f. Commits since the last review (93563a2, merge #203) touch onlyui-packages/web/src/styles.css(resource-row hover overlay) — none of the surfaces this proposal cites.Evidence audit: all anchors still exact —
conversation-store.ts:61-76(getStoredConversation=getAll+ in-memory sort),:84-108append-only (sole deletion remains whole-conversation removal at:134-143),navigation.ts:53-56+switchTo:133-158,agent-session.ts:93-99,conversation-messages.tsx:141-142/177-189(full unwindowedmessages.map),sheet-grid.tsx:34-39precedent.Sensor: lint ✓ · verify ✗ (still unimplemented, as expected).
Duplicate check: clean (open + closed); #166 remains a different surface.
Verdict unchanged: valid, stays open. Sharpening from the prior review (read-path scope note; outcome-based Verification anchor over the presence grep) still applies.
bencode commentedon Oct 27, 2026
Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. Against
main@dbf9cb6d(~35 commits since the last review at90b046f; two land in this issue's own files —a38c02dtab-death persistence,aacecc0failure notices — neither windows or trims anything).Evidence audit: premises hold; anchor drift throughout the Refs.
conversation-store.ts:61-73—getStoredConversationstillgetAllon the message index + in-memory sort;appendStoredConversationMessagesstill:84; storage still append-only, no trim.navigation.ts:61-63—letGo(cited:53-56, +8). Note the premise survives the background-reply work precisely:letGoreleases only non-busy sessions, and this issue's claim is about idle conversations — those still leave memory and re-read on switch back.switchTonow:153(cited:133-158, +20).agent-session.ts:99-103—attachAgent(cited:93-99, +6);runtime.rawMessages = [...storedMessages]at:103.conversation-messages.tsx— unwindowedmessages.mapnow at:214(cited:177-189); memo now:179.CompactionDividerat:216confirms compaction stays model-side: every message still renders.useVirtualizernow atreader/xlsx-reader/sheet-grid.tsx:94(cited:34-39, path gainedxlsx-reader/).Verification block still discriminates:
useVirtualizer|visibleMessages|windowedhas zero matches inconversation-messages.tsxat HEAD.Duplicate check: clean (open + closed); #166/#175/#233 remain different surfaces.
Sensor: lint ✓; verify ✗ → not implemented on main.
Verdict: valid, keep open. Prior sharpening unchanged: decide whether the first cut windows only the render (accepting the re-read) or the read too, and prefer the outcome anchor (seed ~500 messages, assert mounted components stay at window size, grow on scroll-up) over the presence grep.
bencode commentedon Nov 2, 2026
Re-audit — posted by the scheduled issue-reviewer loop, independent of the authoring session. Against
main@d05b6b6(4 commits since the last review atdbf9cb6; two land in this issue's own files — the plugins featurede9243bgrowsnavigation.tsbut only to load/refresh plugins on startup and visibility; it windows and trims nothing).Evidence audit: premises hold; one line drift.
conversation-store.ts:62-76—getStoredConversationstillgetAllon the message index + in-memory sort; storage still append-only (the onlymessagesdelete,:140, is inside whole-conversation removal).navigation.ts:62-63—letGoreleases only non-busy sessions; the idle-conversation premise survives the new visibility work.switchTonow:170(cited:153, +17 from the plugin refresh additions).agent-session.ts:99-103—attachAgenttakes all stored messages (runtime.rawMessages = [...storedMessages]at:103), exact.conversation-messages.tsx:214— unwindowedmessages.map, exact; precedentuseVirtualizerstill atreader/xlsx-reader/sheet-grid.tsx:94.Verification block still discriminates:
useVirtualizer|visibleMessages|windowedhas zero matches inconversation-messages.tsxat HEAD.Duplicate check: clean (open + closed); #166/#175/#233 remain different surfaces.
Sensor: lint ✓; verify ✗ → not implemented on main.
Verdict: valid, keep open. Prior sharpening unchanged: decide whether the first cut windows only the render (accepting the re-read) or the read too, and prefer the outcome anchor (seed ~500 messages, assert mounted components stay at window size, grow on scroll-up) over the presence grep.
bencode commentedon Nov 14, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit @ `d05b6b6` — fourth pass, quiet window (0 commits since the last re-audit at the same HEAD on 2026-11-02; newest filings #294/#295 touch other surfaces). Still valid; stays open; no edits.