Repository navigation
fix(mobile): let a pull's spinner own the wait it restarts - #843
Merged
Merged
Conversation
A pull restarts the very lane the sync notice above the transcript reports, so the native indicator at the visual bottom and the pill came up together and said the same sentence twice. While the pull spins, the pill now stands down for the plain "syncing" state; "retrying" and "waiting for the connection" stay because the spinner cannot say them.
huichen
enabled auto-merge (squash)
September 25, 2026 16:03
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.
问题:一次下拉,两处报同一个等待
截图里(真机 Android,倒置列表):从底部往上拉之后,视觉底部的原生转圈和列表上方的「正在同步…」胶囊同时亮起。
原因不在 #840——那里只是把转圈从"任何自动同步都转"改成"只有真下拉才转"。而下拉本身就会重启同一条 lane(
reloadTimeline→refreshTimeline→timelineSyncStatus = "syncing"),于是 #840 之后:改法:重叠时让"手指那一处"说话
pullRefreshActive && syncNoticeState === "syncing"时不显示——这次等待已经由下拉的原生转圈在原地报了,而且手指刚离开那里。retrying("最新内容尚未同步完成,正在重试…")和waitingNetwork("…正在等待连接恢复…")照旧显示:这两个状态转圈说不出来(转圈只会一直转),信息不重复;真机弱网里"下拉之后开始重试/断连"正是最需要这句话的时候。useMinimumVisible的输入而不是渲染上:否则胶囊的 750ms 最短可见窗口会在下拉结束之后补一段"正在同步…",成了事后闪现。syncNoticeState,让闸门和文案读同一份判断(原来是三目里一套、闸门再猜一套);JSX 里那串嵌套三目变成SYNC_NOTICE_KEYS[state]。验证
the pull's spinner is the only report of the wait it restarts证伪过:把pullOwnsTheWait改成false(即旧行为),该用例失败在expect(notice("chat.syncingLatest")).toBe(false)→ 收到true。cached messages…750ms用例在改法中途失败过一次,暴露出"胶囊最短可见窗口的尾巴(状态已回 idle、胶囊还挂着 ≤750ms)"不能被闸门吃掉;因此渲染仍由showSyncNotice决定,尾巴沿用平淡文案(与旧三目的兜底一致)。mobile:npx tsc --noEmit、npx eslint src、npx jest全绿 —— 除useSkillRecommendation.test.ts里skips a skill already shown today…一条,在打补丁前的干净工作树上以同样方式失败(该用例用new Date().toISOString().slice(0,10)造数据、hook 按本地日期存,本地时间刚过午夜(本地 09-26 / UTC 09-25)就对不上;CI 跑 UTC 不受影响),与本次改动无关。RefreshControl不渲染原生指示器,那圈转圈只在真机上存在;所以这一处只能靠单测 + 真机复看。