mirror of
https://github.com/anomalyco/opentui.git
synced 2026-04-25 04:55:58 +03:00
[GH-ISSUE #709] ScrollBox: content size changes reset _hasManualScroll, causing auto-scroll during streaming #191
Labels
No labels
bug
core
documentation
feature
good first issue
help wanted
pull-request
question
react
solid
tmux
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/opentui#191
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mocksoul on GitHub (Feb 19, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/709
When a user scrolls up while content is being streamed (e.g. in opencode TUI), the viewport jumps back toward the bottom. This happens because
recalculateBarProps(triggered bycontent.onSizeChange) updatesscrollBar.scrollSize, which can triggerupdateStickyState→ reset_hasManualScroll = false— even though the user never scrolled back to the sticky edge.Root cause: PR #531 added
_hasManualScrollresets inupdateStickyState, but didn't guard them with_isApplyingStickyScroll. So programmatic size recalculations can falsely reset the flag.Related opencode issues: https://github.com/anomalyco/opencode/issues/7648, https://github.com/anomalyco/opencode/issues/7659
@mocksoul commented on GitHub (Feb 22, 2026):
Verified — #722 fixes this correctly. The
!this._isApplyingStickyScrollguard inupdateStickyStateplus try/finally inapplyStickyStartandrecalculateBarPropsis exactly the right approach. Tested in opencode with streaming, manual scroll is preserved as expected. Thanks @simonklee for the clean fix!