Summary
Bound client-side history memory. A client keeps the records of every thread it has visited for its whole lifetime, and loading older pages re-folds everything already held.
Current behaviour
session_records in crates/ui/src/store/mod.rs is a map by thread id that is never pruned; nothing in crates/ui/src removes entries.
- Each earlier page re-folds all held records (
crates/ui/src/store/history.rs), so scrolling up a long thread costs roughly the square of the pages loaded (inferred).
- Prefetch keeps 6 screens above the viewport (
HISTORY_WINDOW_SCREENS).
Proposal
- Release a thread's records when it has not been viewed for a while (T3 Code uses a 5-minute idle TTL for thread snapshots), keeping the currently open thread and threads with running turns.
- Fold incrementally, or fold per turn segment, so prepending a page does not re-fold the whole held window.
- This matters most on phone clients and remote sessions.
Summary
Bound client-side history memory. A client keeps the records of every thread it has visited for its whole lifetime, and loading older pages re-folds everything already held.
Current behaviour
session_recordsincrates/ui/src/store/mod.rsis a map by thread id that is never pruned; nothing incrates/ui/srcremoves entries.crates/ui/src/store/history.rs), so scrolling up a long thread costs roughly the square of the pages loaded (inferred).HISTORY_WINDOW_SCREENS).Proposal