Skip to content

Client: bound history memory for visited threads #525

Description

@Tryanks

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceRuntime performance, latency, resource footprint

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions