Add the chrome primitives the new toolbars are built on - #112
Conversation
Groundwork shared by the Explore, Home and Product Details screens that follow. Nothing calls these yet. - `GlassToolbarModifier` (new): the Liquid Glass pill behind floating toolbar controls. It lives in Components rather than next to its first caller because Home, Explore and the category browser all need the same treatment. The near-transparent fill plus explicit `contentShape` are load-bearing — neither `glassEffect` nor `Material` claims the full pill for hit testing on its own, so without them taps near a control's edge fall through to the feed. - `View.enableSwipeBack()`: screens that hide the navigation bar to draw their own chrome also lose the interactive pop gesture, because the system gesture is owned by the back button they just hid. This re-enables it and gates it on having something to pop back to. - `UIImage.prefersLightToolbarIcons(displayedIn:)`: samples a 16x4 luminance grid from the strip of a photo that actually sits under the toolbar (after aspect-fill cropping and EXIF orientation flattening) so overlaid icons can pick black or white. It requires 78% of samples to be dark before going white, so mid-tone heroes stay on black instead of flickering between the two. - `BackButton` takes an optional `tint` for the same reason: over a photo hero the chevron can't be unconditionally black. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017R8mua9xepzF3mnRETtd6W
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| import SwiftUI | ||
|
|
||
| /// Liquid Glass background for the floating toolbar controls that sit over a | ||
| /// scrolling feed (search pill, filter button, notification button). |
There was a problem hiding this comment.
I think you should put a modifier file into a diff direc maybe like "custom" or "modifier"
Groundwork shared by the Explore, Home and Product Details screens that follow.
Nothing calls these yet.
GlassToolbarModifier(new): the Liquid Glass pill behind floating toolbarcontrols. It lives in Components rather than next to its first caller because
Home, Explore and the category browser all need the same treatment. The
near-transparent fill plus explicit
contentShapeare load-bearing — neitherglassEffectnorMaterialclaims the full pill for hit testing on its own,so without them taps near a control's edge fall through to the feed.
View.enableSwipeBack(): screens that hide the navigation bar to draw theirown chrome also lose the interactive pop gesture, because the system gesture
is owned by the back button they just hid. This re-enables it and gates it on
having something to pop back to.
UIImage.prefersLightToolbarIcons(displayedIn:): samples a 16x4 luminancegrid from the strip of a photo that actually sits under the toolbar (after
aspect-fill cropping and EXIF orientation flattening) so overlaid icons can
pick black or white. It requires 78% of samples to be dark before going
white, so mid-tone heroes stay on black instead of flickering between the two.
BackButtontakes an optionaltintfor the same reason: over a photo herothe chevron can't be unconditionally black.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_017R8mua9xepzF3mnRETtd6W