Skip to content

Add the chrome primitives the new toolbars are built on - #112

Open
AndrewG828 wants to merge 1 commit into
user/andrewgao/feature/UI-UX-Lucid-Refactorfrom
user/andrewgao/feature/UI-UX-Lucid-Refactor-02-chrome-primitives
Open

Add the chrome primitives the new toolbars are built on#112
AndrewG828 wants to merge 1 commit into
user/andrewgao/feature/UI-UX-Lucid-Refactorfrom
user/andrewgao/feature/UI-UX-Lucid-Refactor-02-chrome-primitives

Conversation

@AndrewG828

@AndrewG828 AndrewG828 commented Sep 3, 2026

Copy link
Copy Markdown
Member

Stacked PR 2 of 15. Based on #111 — merge in order.
#111#112#113#114#115#116#117#118#119#120#121#122#123#124#125

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

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
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 131f1c39-a276-4682-93d1-f9fbfe9dd187

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

import SwiftUI

/// Liquid Glass background for the floating toolbar controls that sit over a
/// scrolling feed (search pill, filter button, notification button).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think you should put a modifier file into a diff direc maybe like "custom" or "modifier"

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.

2 participants