Skip to content

Read the visible row nearest the middle in the chat scroll test - #1784

Merged
realtonyyoung merged 1 commit into
mainfrom
tonyyoung/fix-chat-scroll-reserve
Oct 21, 2026
Merged

realtonyyoung merged 1 commit into
mainfrom
tonyyoung/fix-chat-scroll-reserve

Conversation

@realtonyyoung

@realtonyyoung realtonyyoung commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #1783 — AI-4150

What & why

Main's Build and test is red on every OS: Scrolling_uneven_history_does_not_reverse_the_scrollbar(False, False) fails because the tail reserve leaves the viewport's middle blank at the scroll end, so the test finds no reading row. It now tracks the visible row nearest the middle, keeping the same jump and recycle assertion.

Verification

--treenode-filter "/*/*/ChatTabViewSmokeTests/*" on macOS: 64 total, 0 failed (it failed with 4 content jumps before this change).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated uneven-history scrolling coverage to handle blank space near the end of the scrollable content.
    • Improved row selection near the viewport midpoint for more reliable test results.

The tail reserve can leave the viewport's middle blank at the scroll end.

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

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c5aed16f-42ce-4963-b47c-3d8aaaf50621
📥 Commits

Reviewing files that changed from the base of the PR and between 1253c9f and 71c4104.

📒 Files selected for processing: 1
  • test/Capacitor.App.Tests.Unit/ChatTabViewSmokeTests.cs

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

📝 Walkthrough

The uneven-history scrolling test now selects the visible realized row nearest the viewport midpoint. This allows the test to retain a reading target when the midpoint is blank near the scroll end.

Changes: Chat scroll test

Layer / File(s) Summary
Select a visible reading row
test/Capacitor.App.Tests.Unit/ChatTabViewSmokeTests.cs
The test selects the realized row nearest the viewport midpoint from visible rows that overlap the viewport.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: High

Possibly related issues

Suggested reviewers: nortonandreev

Merge Risk: ⚪ Minimal · up to 71c41

No actionable merge-blocking risk remains in this test adjustment.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: selecting the visible row nearest the viewport midpoint in the chat scroll test.
Linked Issues check Passed Issue #1783 requires the uneven-history scroll test to handle blank space from the tail reserve. The change in ChatTabViewSmokeTests.cs selects the visible realized row nearest the viewport midpoint…
Out of Scope Changes check Passed The pull request changes only the linked chat scroll smoke test. The row-selection change directly addresses issue #1783. No unrelated production or test changes are present in the reviewed diff.
Full details: Linked Issues check

Explanation

Issue #1783 requires the uneven-history scroll test to handle blank space from the tail reserve. The change in ChatTabViewSmokeTests.cs selects the visible realized row nearest the viewport midpoint instead of requiring a row to cover the exact midpoint. It preserves the existing reading-row movement and recycle assertions. The reported macOS run completed 64 tests with 0 failures.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Select the nearest visible row in the chat scroll test

🐞 Bug fix 🧪 Tests 🕐 Less than 10 minutes

Grey Divider

AI Description

• Select the visible row nearest the viewport middle when the tail reserve leaves it blank.
• Preserve the scroll reversal, content jump, and container recycling assertions.
Diagram

graph TD
  A["Realized rows"] --> B{"Visible in viewport?"} --> C["Nearest midpoint"] --> D["Reading row"] --> E["Jump and recycle checks"]
  F["Scroll offset"] --> G["Reversal check"]
Loading
High-Level Assessment

Selecting the nearest visible row addresses the blank-midpoint case without weakening the existing jump and recycling checks. Skipping those checks when the midpoint is blank would reduce test coverage.

Files changed (1) +7 / -2

Tests (1) +7 / -2
ChatTabViewSmokeTests.csTrack the nearest visible row during uneven-history scrolling +7/-2

Track the nearest visible row during uneven-history scrolling

• The scroll test now filters realized containers to those intersecting the viewport and tracks the one nearest its midpoint. This keeps a reading row available when the tail reserve leaves the midpoint blank; the subsequent assertions are unchanged.

test/Capacitor.App.Tests.Unit/ChatTabViewSmokeTests.cs

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can start a comment with 'qodo' or '@qodo' to chat about any finding

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@realtonyyoung
realtonyyoung merged commit 9e1aa88 into main Oct 21, 2026
13 checks passed
@realtonyyoung
realtonyyoung deleted the tonyyoung/fix-chat-scroll-reserve branch October 21, 2026 14:37
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.

Chat scroll smoke test fails on main since the tail reserve

1 participant