Skip to content

Stop following the answer while the user scrolls - #4

Merged
saaguero merged 1 commit into
mainfrom
keep-scroll-while-streaming
Oct 4, 2026
Merged

saaguero merged 1 commit into
mainfrom
keep-scroll-while-streaming

Conversation

@saaguero

@saaguero saaguero commented Oct 4, 2026

Copy link
Copy Markdown
Owner

Every streamed token called scrollTo("bottom"), so scrolling up to reread something mid-answer was yanked back on the next token. Now any scroll the user makes (wheel, trackpad with momentum, scroller drag, the keyboard scroll keys) pauses following, and it resumes only if they settle back at the bottom, send a new question, or open a conversation.

Pinning is judged on user scrolls only, never on the stream's own scrollTo: that one can land a hair short of a document that is still growing, and judging it would unpin the stream by itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: saaguero/quickai/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 43f8c96c-6db3-4895-aed4-22162f6cb1d5
📥 Commits

Reviewing files that changed from the base of the PR and between ef53348 and a5c4522.

📒 Files selected for processing (3)
  • Sources/QuickAI/ChatViewModel.swift
  • Sources/QuickAI/ContentView.swift
  • Sources/QuickAI/PanelController.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The chat now tracks whether it should follow the latest content. Content updates scroll only while following is enabled. Scroll-wheel, live-scroll, and keyboard input pause following. After 0.2 seconds, following resumes when the conversation is within 8 points of the bottom. New submissions and conversation presentation enable following.

Changes

Chat Scroll Following

Layer / File(s) Summary
Follow state and content scrolling
Sources/QuickAI/ChatViewModel.swift, Sources/QuickAI/ContentView.swift
ChatViewModel tracks whether the chat follows the latest content and resets this state for new submissions. ContentView scrolls for content updates only when following is enabled, and enables following when a conversation opens or the scroll view appears.
Scroll input and follow restoration
Sources/QuickAI/PanelController.swift
PanelController monitors vertical scroll-wheel events and live scrolling, and pauses following for user and keyboard scrolling. It checks the distance from the bottom after 0.2 seconds and restores following when the distance is at most 8 points. Vertical offset calculation handles flipped and unflipped document views.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a5c45

No confirmed issue prevents merging. Interactive scrolling during streaming should still receive normal validation.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: pausing answer-following while the user scrolls.
Description check ✅ Passed The description explains the scrolling behavior that the changes implement, including when following pauses and resumes.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@saaguero

saaguero commented Oct 4, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@saaguero
saaguero merged commit 020f9fd into main Oct 4, 2026
2 checks passed
@saaguero
saaguero deleted the keep-scroll-while-streaming branch October 4, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant