Skip to content

fix(terminal): accept late scroll reports - #692

Merged
oneo-me merged 2 commits into
nsgo-dev:mainfrom
houko:fix/terminal-follow-late-scroll
Nov 18, 2026
Merged

oneo-me merged 2 commits into
nsgo-dev:mainfrom
houko:fix/terminal-follow-late-scroll

Conversation

@houko

@houko houko commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #686 for base/terminal.

  • Tracks all pending programmatic scroll offsets so late platform reports are recognized in order.
  • Prevents a stale report from being mistaken for user scrolling and taking the terminal off the output end.
  • Adds View.HideIndicator for applications that want no terminal scroll bar.
  • Adds a regression test for late reports and preserves the existing follow behavior test.

Verification

  • go tool nsgo test -run '^TestView(AcceptsLateProgrammaticScrollReports|KeepsAScrollGoing)$' ./base/terminal — passed.
  • go tool nsgo check -target macos_arm64 — passed.
  • git diff --check — passed.

Closes #686

@github-actions github-actions Bot added bug Something isn't working base size/S labels Nov 18, 2026
@oneo-me
oneo-me force-pushed the fix/terminal-follow-late-scroll branch from dd528a2 to e0eac04 Compare November 18, 2026 13:10
@oneo-me

oneo-me commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks! Rebased onto main and added a commit that supersedes the pending-offset list:

  • Output faster than frames was the main cause: the layer was sized from the frame's scrollbar while the row was read later, so the platform clamped the offset to the old end and the clamped report was taken for the user's scroll. follow now sizes and scrolls from one read.
  • core.ScrollEvent.Stale (and TSX's stale) marks reports from before the platform applied a scroll from code, from the applied count every backend sends, so late reports are recognized without matching offsets.
  • A report at the content's end follows the output again.
  • HideIndicator is kept; tests cover fast output, stale reports and re-following at the end.

@github-actions github-actions Bot added documentation Improvements or additions to documentation core tsx size/M and removed size/S labels Nov 18, 2026
@oneo-me
oneo-me merged commit bc5c62d into nsgo-dev:main Nov 18, 2026
8 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

base bug Something isn't working core documentation Improvements or additions to documentation size/M tsx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal view stops following output when scroll reports arrive late

2 participants