Repository navigation
fix(mobile): offer the question list from the tail, spin only on a pull - #840
Merged
Merged
Conversation
A conversation opens at its tail, and ↑ was withheld until the reader had dragged away from it — so the jump a reader wants first, back to the question that started the turn on screen, cost a scroll to unlock. ↑ now reads the viewport rows alone; ↓ still waits for the tail to leave the screen, because at the tail every newer question is already visible and there is nothing below to go to. A jump also hands the viewport over to the reader now, which is what stops the next streaming commit from pinning it back to the bottom. The pull-to-refresh spinner is bound to the pull instead of to the sync lane: an automatic sync already says so in the notice above the transcript, and the native indicator sits at the visual bottom of the inverted list, so the same wait was reported twice. The spinner still clears when the lane the pull restarted settles, so a pull offline cannot leave it up.
huichen
enabled auto-merge (squash)
September 25, 2026 14:26
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.
两处“同一个等待/同一件事说了两遍”,都改成跟着读者走
1. 提问导航:一进来就能按 ↑(截图里那对上下按钮)
原来
useQuestionNav只有在“离开最新”(!atLatest || offset > 32)时才算得出方向,于是刚打开会话时两个按钮都不出现,必须先滑一下才能翻回上一条 —— 而“回到本轮提问”恰好是打开一段长回答后第一个想按的东西。onTakeOver→useChatScroll.onScrollBeginDrag)。这一步是必需的:只要列表还在 follow 最新,下一次流式提交就会把它钉回底部,跳转会被悄悄撤销 —— 原来跳转只发生在已经离开最新的状态,所以没暴露;「加载更早」按钮早就在做同样的接管。2. 下拉刷新的转圈:只属于“拉”这个动作
RefreshControl.refreshing原来绑timelineSyncStatus,而自动同步也走同一个 lane 状态 ⇒ 截图里那个大白圈会在任何自动同步/重试时转起来,转的位置还是倒置列表的视觉底部(原注释写成“视觉顶部”,一并改正)。现在:laneAtWork由同一个 lane 信号给出),所以离线下拉不会留下一个空的转圈。验证
previous改回旧逻辑后offers ↑ from the tail…、↓ retracts…、a jump hands the viewport over…失败;把refreshing改回绑 lane 后the pull spinner belongs to the pull失败。mobile:npx tsc --noEmit、npx eslint src、npx jest全绿(128 suites / 2038 tests)。?multiTurn=1,自己起 8098 + headless Chrome 9223)在不滚动的初始状态下断言到{"up":"enabled","down":"disabled","scrollTop":0},按 ↑ 后{"scrollTop":211,"landed":1,"earlier":0}:视口离开最新、正在读的那一轮提问进入视野且没有跳过头。把改动退回旧逻辑重跑,同一步报up is not offered before any scroll(按钮根本不存在)。注:harness 里跳转落点(RNW 的 inverted +scrollToIndex语义)与真机不同,已提交的qn-align-check在这台机器上本来也量到 50px 而不是 12px,所以只断言“目标对不对”,不断言像素落点。