Merged
Conversation
Provide a shared pre-iOS 26/macOS 26/tvOS 26 fallback for glass-style buttons and glassEffect surfaces so overlay controls remain readable on older systems. Also update the UIKit end-page close button path to use a matching background treatment, including reduce-transparency fallbacks.
c9dbf76 to
62d26ad
Compare
Remove the extra legacy glass surface from adaptiveButtonStyle on older systems and keep only a lightweight readability enhancement so button shapes stay unchanged. Retain surface fallback for non-button glassEffect usages and switch the UIKit end-page close button to shadow-based contrast only.
Replace the pre-26 bordered fallback with a custom button chrome that includes a thicker material background and tint overlay while preserving button border shapes. Also update the UIKit reader end-page close button to use a matching old-system background treatment.
Move the old-system button chrome into a ButtonStyle so shape rendering and hit testing stay attached to the button itself. This restores circular overlay controls and prevents taps on the button background from falling through to the reader content.
Remove the extra padding from the old-system LegacyGlassButtonStyle so the fallback only draws background chrome and does not change button sizing or layout.
Add back a conservative control-size-based padding layer inside LegacyGlassButtonStyle so the pre-26 fallback matches bordered button spacing more closely without returning to the previous hit-testing issues.
This reverts commit f810318.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Reader controls that rely on glass styling become hard to read on pre-26 systems because the older fallback path remains too transparent against bright or dark content. The PDF overlay reported in #721 is the clearest example, but the same issue affects shared glass-style buttons more broadly on older OS versions.
Approach
Keep the fix in the shared
adaptiveButtonStyleentry point so old systems get a consistent fallback everywhere. Instead of relying on the system bordered style, pre-26 bordered and borderless buttons now use custom chrome with a thicker material background, a light tint overlay, and a matching border shape, while non-buttonglassEffectusages keep their separate surface fallback. The UIKit reader end-page close button was updated to use the same old-system background treatment.Scope
.borderedand.borderlessfallback with custom button chrome inadaptiveButtonStylebuttonBorderShape(.circle/.capsule)while increasing contrast with thicker background surfacesglassEffectfallback behavior unchangedValidation
make formatmake build