Repository navigation
fix(ui): let ScrollTo leave the end of a following List - #74
Closed
xiaoyumuxi wants to merge 1 commit into
Closed
xiaoyumuxi wants to merge 1 commit into
xiaoyumuxi wants to merge 1 commit into
Conversation
ListArea declares the scroll area before the rows, and ScrollArea forgets whether the area follows until the Box the List returns says Follow again. A ScrollTo applied there settled against a state that did not follow, so it never detached, and the Follow(true) after the rows pulled the list back to its end. The request now settles against the follow the paint before declared, and the pinned flag is read after the request is applied.
This was referenced Nov 28, 2026
Author
|
已被上游 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue:无;上游 PR:vivaui#503
改了什么
把上游 PR vivaui#503 的修复(
372a77f9)cherry-pick 到 forkmain(8af03952):List上,ScrollTo跳到远离末尾的行会脱离末尾,之后新增的行不再把列表拉回末尾;ScrollToEnd重新跟随末尾。各层的改动
base/list.go(ListArea):follow来结算,所以能标记为已脱离;pinned改为在请求处理之后读取。ui/list_follow_test.go:新增TestListScrollToLeavesTheEndOfAFollowingList。为什么
ScrollArea每帧声明时会先把follow清零,要等行之后的Follow(true)才恢复。滚动请求恰好在这两次声明之间处理,所以ScrollTo永远标不成已脱离,跟随又会把列表拉回末尾。根因的完整说明见上游 PR。Lithe 的 Agent 对话页(Lithe-IDEA/Lithe-IDEA#2492)里,点提问导航跳到较早的提问时就会碰到这个问题,目前在应用层先关掉跟随再跳转来绕过。这个 PR 合入后升级固定版本,就能删掉那段绕过。
怎么验证的
macOS(Apple Silicon)上运行:
go vet ./base/ ./ui/go test ./ui/ -run 'Follow|ScrollTo|List' -count=1通过go test ./... -count=1和平台 vet(windows、linux、wasm、vivahead)。全量里有两组失败与本改动无关,在不含本改动的上游 main 上同样失败:打包测试的部署目标环境问题,以及 input-number 的热绘制分配。边界在哪
框架能力修正:
ScrollTo和Follow组合时应与用户滚动的行为一致。