feat(assistant): keep reading position with jump-to-latest - #314
Conversation
Replace the status-list hands-free screen with a GPT Voice-style layout: chat bubbles above a voiceprint orb, and keep the current call readable while scrolling up.
Keep the live transcript still during a scroll gesture, then snap back to the latest message when the user stops interacting.
Leave follow-latest / jump-to-latest scroll behavior for a separate change so this PR only ships the bubble layout.
Leave the transcript still while scrolling up, and show a jump-to-latest chip so new turns stay reachable.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Native drag and momentum handlers already debounce follow-latest; the extra web onScroll timer is out of scope for the mobile change.
There was a problem hiding this comment.
Reviewed the fixed range from 612955df0cd65f54006952918c98159a609a4799 to 05423188b7eaa99521c0826a692280c9a7a186bf, covering the continuous conversation message flow, mobile transcript pinning, jump-to-latest behavior, and the new voice-call UI. The message/rendering contracts are coherent overall, but the scroll state has a race that can leave users without the promised latest-message entry.
Verification: git diff --check passes. The requested Jest suites could not run because frontend/node_modules is absent and the configured jest-expo preset is unavailable in the mounted workspace.
| const atBottom = isPinnedToBottom({ | ||
| contentHeight: contentSize.height, | ||
| offsetY: contentOffset.y, | ||
| viewportHeight: layoutMeasurement.height, |
There was a problem hiding this comment.
[P2] Mark latest content unseen during an active drag
When a user begins dragging while still at the bottom, interactingRef.current becomes true but followingRef.current remains true until the first scroll event moves past the threshold. If a new transcript message arrives during that drag, this branch returns without setting hasUnseenLatest; after the user then scrolls upward, no later content-size event may occur, so the promised “查看最新” chip never appears even though newer content is now off-screen. Treat an active drag that subsequently leaves the bottom as unread content, or defer/re-evaluate the content update when the drag’s scroll position is known.
Summary
Closes #313
Test plan
Verification
cd frontend npx jest --runInBand tests/unit/features/assistant/presentation/usePinnedTranscriptScroll.test.ts tests/unit/features/assistant/presentation/VoiceCallScreen.test.tsx本地结果:
Test Suites: 2 passed,Tests: 42 passed。覆盖要点:
contentFitsViewport/isPinnedToBottom:未测量视口、刚好一屏、越过 80px 阈值scrollToEnd,并标记未读最新;jumpToLatest后贴回底部设计对照
对比图待用户提供。请发改前/改后各一张(上滑看历史时出现「查看最新」、以及点了之后回到最新),再挂到本 PR 附件。