Skip to content

fix(renderer): debounce renders, refactor scroll logic, track scrollintent#280

Open
jensenojs wants to merge 1 commit intosudo-tee:mainfrom
jensenojs:pr/renderer-scroll-intent
Open

fix(renderer): debounce renders, refactor scroll logic, track scrollintent#280
jensenojs wants to merge 1 commit intosudo-tee:mainfrom
jensenojs:pr/renderer-scroll-intent

Conversation

@jensenojs
Copy link
Contributor

@jensenojs jensenojs commented Feb 14, 2026

  • Debounce renders: Fix edge case from persist_state benchmarking where rapid session switches trigger redundant renders (harmless in daily use, but a bug nonetheless)
  • Refactor scroll_to_bottom: nested if-else → condition table, just for code cleanliness
  • Add WinScrolled tracking: Capture scroll intent from mouse/trackpad scroll (not just keyboard navigation)

…intent

Three related improvements to output rendering:

1. Debounce concurrent render_full_session calls

   Problem: Rapid session switches trigger multiple redundant renders.
   Solution: Coalesce into one in-flight render + trailing render with
   latest options.

2. Refactor scroll_to_bottom conditions
   Convert nested if-else chain to declarative condition table for
   better readability and maintainability.

3. Add WinScrolled autocmd
   Track user scroll position to accurately detect scroll intent
   (whether user is at bottom or has scrolled up).
@jensenojs
Copy link
Contributor Author

These accumulated organically while building persist_state—fixing bugs, cleaning up code, adding small enhancements to get the experience right. Even with LLM assistance, splitting them now would be a headache. My apologies for the bundled review. @sudo-tee

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