Skip to content

Fix auto scroll not re-enabling at certain window heights - #240

Merged
todi1856 merged 2 commits into
masterfrom
debug-autoscroll-window-size
Nov 18, 2026
Merged

todi1856 merged 2 commits into
masterfrom
debug-autoscroll-window-size

Conversation

@todi1856

@todi1856 todi1856 commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Purpose of PR

Type of change:

  • Bug fix
  • Description of the fix

See this video of the bug

BEFORE
https://github.com/user-attachments/assets/f6fb9b49-fedf-4397-b9c4-314a1051ccdf

AFTER
https://github.com/user-attachments/assets/35ede4ca-6459-45ae-97f3-71f198fecb66

With Scroll set to Auto, scrolling back to the last message sometimes didn't turn auto scrolling back on. It depended on the window height, e.g. it reproduced at 1467x900

The check compared rounded item counts, using the full height of the messages area. The always visible horizontal scrollbar makes the real viewport shorter, so at some heights the check came out one short even when scrolled all the way down. It now compares pixels: scrollY + visibleHeight >= rowHeight * entryCount.

Also shows the window size in the developer mode debug toolbar.

  • Links to Jira/Fogbugz cases

UUM-162014

  • Halo effect

    Only Auto scroll mode is affected.

Checklist for PR maker

  • Have you updated the Changelog?

Testing status

  • Automation: new AndroidLogcatAutoScrollTests sweeps messages area heights, row heights and scrollbar heights, and checks that the last entry counts as visible when scrolled to the bottom.
  • Manual: reproduced at 1467x900, then confirmed the fix on Windows, Unity 6000.0.

🤖 Generated with Claude Code

The check for "scrolled to the last message" compared rounded item
counts, with the visible item count taken from the full messages area
height. The horizontal scrollbar is always shown, so the real viewport
is shorter, and whenever the fractional part of visible rows exceeded
the scrollbar's share of a row the check failed even at the maximum
scroll position. Compare in pixels instead.

Also show the window size in the developer mode debug toolbar.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@todi1856
todi1856 requested a review from BorisShir November 17, 2026 08:08

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Harness Review

Ship it

The change replaces the rounded row-count check with a pixel-based check for re-enabling auto-scroll. I examined the surrounding scroll handling, row-height and test-assembly contracts, added tests, developer toolbar, and changelog; no actionable issues were found.

Reviewed commit 13cdea3

🤖 Helpful? 👍/👎

@todi1856
todi1856 requested a review from a team November 17, 2026 08:08
@JacobSimpson-unity
JacobSimpson-unity requested review from JacobSimpson-unity and removed request for a team November 17, 2026 11:04
…ndow-size

# Conflicts:
#	com.unity.mobile.android-logcat/CHANGELOG.md
@todi1856
todi1856 enabled auto-merge November 18, 2026 09:10

@JacobSimpson-unity JacobSimpson-unity 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.

Tested this logcat branch on trunk, with different Scroll behaviors (whilst the PR was targeting auto scroll, I also took a look at disabled, scroll-to-end). All behave as described in the tooltip.

Checked the exact repro size (1467x900) and other random resizes, with Auto in different use cases (disconnect/reconnect/clear/reload/closing and reopening the window).

@todi1856
todi1856 disabled auto-merge November 18, 2026 11:32
@todi1856
todi1856 merged commit 87646e3 into master Nov 18, 2026
21 of 24 checks passed
@todi1856
todi1856 deleted the debug-autoscroll-window-size branch November 18, 2026 12: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.

3 participants