Skip to content

fix: keep question dock submit anchored#469

Merged
Astro-Han merged 3 commits into
devfrom
codex/fix-i467-question-scroll
May 6, 2026
Merged

fix: keep question dock submit anchored#469
Astro-Han merged 3 commits into
devfrom
codex/fix-i467-question-scroll

Conversation

@Astro-Han

Copy link
Copy Markdown
Owner

Summary

  • Prevent question dock programmatic focus from scrolling the session timeline away from the latest turn.
  • Add a deterministic submit-to-question-dock E2E guard that keeps the timeline near bottom.
  • Extend renderer diagnostics so the [Bug] Session jumps to top after submit enters question dock #467 scroll-jump shape is reported even when browser focus marks the sample as user-scrolled.

Why

Long sessions could jump from the latest turn to near the top after the user submitted a message and the assistant entered a pending question tool state. The user then lost the question dock position and had to manually scroll back down to answer.

Root cause boundary: this is a frontend session scroll/focus contract issue. The fix stays in the question dock focus behavior, session renderer diagnostics, and focused regression coverage. It does not touch backend question tools, blocker ledger, SSE replay, persistence, or protocol/schema layers.

Related Issue

Closes #467

Human Review Status

Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.

Review Focus

  • Confirm the question dock focus change uses preventScroll without breaking keyboard focus or option navigation.
  • Confirm diagnostics only broadens detection for recent-submit + previous-near-bottom + near-top samples, not ordinary user-initiated scrolling.
  • Confirm the E2E covers the real visible submit path for the final prompt instead of seeding the question dock directly.

Risk Notes

Low frontend risk. preventScroll changes only programmatic focus inside SessionQuestionDock; keyboard focus is still assigned and covered by the existing keyboard E2E. Diagnostics detection remains gated by recent submit and previous near-bottom state to avoid broad false positives.

How To Verify

Focused unit tests: 914 passed
Command: bun --cwd packages/app test:unit src/pages/session/use-session-scroll-dock.test.ts src/pages/session/composer/session-question-dock.test.ts src/context/renderer-diagnostics.test.ts

Focused E2E: 2 passed
Command: bun --cwd packages/app test:e2e --grep "submit to question dock keeps latest turn visible|blocked question flow supports keyboard shortcuts"

Typecheck: passed
Command: bun --cwd packages/app typecheck

Diff check: passed
Command: git diff --check

Screenshots or Recordings

Not included. This bug is hard to reproduce manually in the desktop shell, so the behavior is locked with a deterministic Playwright path: long visible history, real visible prompt submit, pending question dock, timeline remains near bottom. Existing and new E2E also verify keyboard focus still works.

Checklist

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, primary area, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

@Astro-Han Astro-Han added bug Something isn't working P1 High priority app Application behavior and product flows ui Design system and user interface labels May 6, 2026
@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Astro-Han has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 9 minutes and 3 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d578738f-e67a-46cc-8e2b-8b094b151b17

📥 Commits

Reviewing files that changed from the base of the PR and between 2837fab and 91b87dd.

📒 Files selected for processing (4)
  • packages/app/e2e/session/session-composer-dock.spec.ts
  • packages/app/src/context/renderer-diagnostics.test.ts
  • packages/app/src/context/renderer-diagnostics.ts
  • packages/app/src/pages/session/composer/session-question-dock.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-i467-question-scroll

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 and usage tips.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses issues with unexpected scroll jumps in the session question dock. Key changes include the introduction of a focusWithoutScrolling utility to prevent the browser from scrolling when focusing elements and enhancements to the renderer diagnostics to more accurately detect scroll incidents following a submission. Additionally, new E2E and unit tests were added to verify the scrolling behavior and diagnostic logic. I have no feedback to provide.

@Astro-Han Astro-Han merged commit 734483c into dev May 6, 2026
20 checks passed
@Astro-Han Astro-Han deleted the codex/fix-i467-question-scroll branch May 6, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app Application behavior and product flows bug Something isn't working P1 High priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Session jumps to top after submit enters question dock

1 participant