Skip to content

Unify scrollbars and remove duplicated footer exclusion - #130

Open
PystoyPlayer wants to merge 11 commits into
TelegramMessenger:masterfrom
PystoyPlayer:codex/sidebar-scrollbar
Open

PystoyPlayer wants to merge 11 commits into
TelegramMessenger:masterfrom
PystoyPlayer:codex/sidebar-scrollbar

Conversation

@PystoyPlayer

@PystoyPlayer PystoyPlayer commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Key change

Use a shared slim themed native overlay thumb in common vertical ScrollViews, preserving AppKit track feedback, hit geometry and auto-hide. Remove duplicated additional footer scroller insets while retaining content clearance; chat-history input and picker overlay exclusions remain.

Reason

AppKit combines content and scroller insets. Reserving the same floating footer twice made the thumb stop above the usable lower boundary. Content already clears that footer, so its additional scroller inset is zero. The updated test encodes this measured geometry; it is not a claim of maintainer product approval.

Screenshot/video result (before/after)

The retained actual-client Settings crops show identical bottom position before/after and exclude the account profile. Neutral-row native captures cover additional geometry. The knob slot now delegates to NSScroller; Increase Contrast selects an opaque color that contrasts with the actual panel surface and a 5 pt thumb. The actual system Increase Contrast preference has not been exercised.

Before

Before: the Settings scrollbar stops too far above the floating navigation bar

After

After: the themed Settings scrollbar reaches the navigation-bar boundary

Confirmation

macOS 27.0.1 (26A434), Xcode 27.2 (27B52), Telegram 13.1.0 (283357), Debug arm64.

The standard TGUIKitTests target passes all six ThemedScrollerTests. The new regression changes content clearance between 0, 56 and 20 points and reapplies the picker scroller insets repeatedly, asserting both additional clearance and the real native scroller endpoint. This models repeated search/category/theme state updates. The emoji update now derives its additional bottom exclusion from the current contentInsets instead of restoring a fixed 50 pt inset, retaining 46 pt top clearance and standalone behavior.

The added standalone source-extraction harness, screenshots and superseded review logs have been removed from the production patch. The earlier actual-client crops above remain historical comparisons in this description; they are not current dynamic-update screenshots. Standard target coverage replaces the unwired harness.

A fresh full Debug arm64 workspace integration build with the shipping fixes passed. Local SDK/profile overrides and other pending changes are included; this is not an independent distribution build of this PR head. Other macOS versions and the physical Increase Contrast preference were not exercised.

  • I confirm that I have tested the affected behavior and verified that it works properly, or verified the content and links for a documentation-only change.
@PystoyPlayer PystoyPlayer changed the title Fix sidebar scrollbar endpoint and refine its appearance Oct 27, 2026
@PystoyPlayer PystoyPlayer changed the title Unify application scrollbars and fix duplicated footer insets Oct 28, 2026
@macosswift

Copy link
Copy Markdown
Collaborator

Issues:

CONFIRMED: ThemedScroller.swift:13: with Increase Contrast on, the thumb is filled with the system NSColor.labelColor instead of a palette color, so it follows the window's macOS appearance rather than the Telegram theme, and in windows that do not set an appearance (such as the reactions panel) it is drawn near-black on a dark theme when macOS is in Light mode.

@macosswift

Copy link
Copy Markdown
Collaborator

Issues:

  • ThemedScroller.swift:10-19: with Increase Contrast on, the thumb takes the app theme's opaque text color whatever surface it sits on, so with a light theme it is drawn black on the always-dark group call participant list and the video editor's tools panel and is practically invisible there, while the native knob it replaces followed those surfaces' dark appearance.
@macosswift

Copy link
Copy Markdown
Collaborator

This pull request is not filled in correctly: the confirmation checkbox is missing. Please complete every section as described in CONTRIBUTING.md and update the PR so it can be reviewed.

This doesn't compile. Please make sure the project builds before opening a PR.

Issues:

  • ThemedScrollerTests.swift:36-38: testHighContrastFollowsTelegramPaletteWithOppositeSystemAppearance uses NSAppearance.Name.darkAqua (macOS 10.14) and performAsCurrentDrawingAppearance (macOS 11.0) without #available, but the TGUIKit package declares .macOS(.v10_13), so the TGUIKitTests target does not compile and swift test --package-path packages/TGUIKit cannot build any TGUIKit test.

  • ThemedScroller.swift:64-66: ThemedScroller.drawKnobSlot(in:highlight:) only calls super.drawKnobSlot(in:highlight:), so the override is dead code with the same behavior as having no override.

@macosswift

Copy link
Copy Markdown
Collaborator

Issues:

  • README.md:16: The inset audit says the emoji, sticker and GIF pickers' 50 pt bottom scroller inset does not duplicate contentInsets, but EntertainmentViewController.updateSectionsBottomInset sets contentInsets.bottom to the 56 pt tabs area on those same tables, so by the PR's own reasoning their thumb still ends 50 pt above the tabs-area boundary, the same double exclusion this PR removes on the other screens.
@macosswift

Copy link
Copy Markdown
Collaborator

Issues:

  • EntertainmentViewController.swift:508-510: In the emoji picker hosted by EntertainmentViewController, the reset table.scrollerInsets.bottom = 0 is undone by EmojiesController's update(sections:packs:state:context:arguments:mode:), which reassigns scrollerInsets with bottom: 50 on every state emission, so after a search, a category change or a theme change the emoji thumb again ends 50 pt above the 56 pt tabs area that the PR sets out to remove.

  • native-build.txt:3: The PR commits eight screenshots (about 1.4 MB), five result logs and a source-extraction harness under tools/tests/sidebar-scroll that are review evidence rather than part of the fix: regression.txt and review-run.txt are superseded by current-checks.txt (the README says the first predates the picker cases), native-build.txt records a private integration checkout that cannot be reproduced from this branch, and run.py/main.swift are not wired into any test target.

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

Labels

None yet

2 participants