Skip to content

test: let the horizontal list test pass with scroll bars always shown - #415

Merged
M4n0x merged 1 commit into
mainfrom
test/horizontal-list-scroll-bars
Nov 2, 2026
Merged

M4n0x merged 1 commit into
mainfrom
test/horizontal-list-scroll-bars

Conversation

@M4n0x

@M4n0x M4n0x commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Problem

horizontalPopupListsScrollToTheirLastEntry(fillsHeight: true), added in baa1c7e, fails the Test check on main (ea0b4e4) and on every pull request since, such as #412 and #414. CI's Macs always show scroll bars. A list that fills an 80-point popup gives 17 points to its horizontal scroll bar, so its document is 63 points tall, and the test expected 80:

Expectation failed: (abs(document.bounds.height - height) → 17.0) < 0.5
Expectation failed: (document.visibleRect → (142.0, 0.0, 180.0, 63.0)).contains(lastEntry → (222.0, 0.0, 100.0, 80.0))

With a trackpad, macOS overlays the scroll bars instead, so the test passes locally.

Changes

The test now expects a list that fills the popup's height to leave room for a scroll bar macOS always shows (NSScroller.scrollerWidth(for: .regular, scrollerStyle: .legacy)), and nothing for overlay scroll bars. The non-filling case and the scrolling checks are unchanged. The app doesn't change: a scroll bar that's always shown under a horizontal list is how macOS draws it.

Testing

I ran the test bundle through swiftpm-testing-helper, with and without -AppleShowScrollBars Always, which sets the preference for that process only:

  • original test: passes with overlay scroll bars, and fails the same two expectations as CI with scroll bars always shown;
  • this change: passes in both.

swift test --filter Popup: 23 tests pass.

Merging

One commit, any merge method.

Claude Opus 5.5 via Claude Code

horizontalPopupListsScrollToTheirLastEntry expected a list that fills an 80-point popup to be 80
points tall. Where macOS always shows scroll bars, as on CI's Macs, the horizontal scroll bar takes
17 of them, so the list is 63 points tall and the test failed on main and on every pull request.
The test now expects the height left above a scroll bar that is always shown.
@M4n0x
M4n0x requested a review from Seb-GRAF as a code owner November 2, 2026 11:53
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between ea0b4e4 and adcd9f6.

Files selected for processing: 1
  • Tests/StableBarTests/PopupClickTests.swift

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

Walkthrough

The horizontal popup scrolling test now calculates the expected document height based on whether the popup fills its height and whether the scrollers are legacy or overlay.

Changes: Popup scrolling test

Layer / File(s) Summary
Calculate expected document height
Tests/StableBarTests/PopupClickTests.swift
The test accounts for legacy scroller width when the popup fills its height. Otherwise, it expects a height of 20 points. The calculated value is used in the layout wait and subsequent height checks.

Possibly related PRs

  • Seb-GRAF/StableBar#410: Added the horizontal popup scrolling test whose expected height this change updates.

Severity of issue fixed: Low

Merge Risk: Minimal · up to adcd9

This test-only adjustment introduces no actionable merge-blocking risk.

Pre-merge checks: Passed 3
Check name Status Explanation
Description check Passed The description includes all required sections: Problem, Changes, Testing, and Merging. It explains the macOS scroll bar failure, the test-only fix, the test commands and results, and the merge prefer…
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.
Full details: Description check

Explanation

The description includes all required sections: Problem, Changes, Testing, and Merging. It explains the macOS scroll bar failure, the test-only fix, the test commands and results, and the merge preference. It ends with the required agent and harness attribution.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@M4n0x
M4n0x merged commit a7d4caf into main Nov 2, 2026
15 checks passed
@M4n0x
M4n0x deleted the test/horizontal-list-scroll-bars branch November 2, 2026 12:03
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant