Skip to content

Composer glass shape() uses px constants that break at non-default interface font size #5662

Description

@Williawar

The composer's glass slab visibly overhangs the "Current checkout" strip's border whenever Typography → Interface font size is not 16.

Repro

  1. Settings → Typography → Interface font size: 20
  2. Look at the checkout strip under the composer — easiest to see against any non-flat canvas (a tinted theme; a textured background makes it obvious).
  3. The glass slab pokes ~5.5px past the strip's hairline on both sides and around the bottom corners, reading as "the background is bigger than the border."

Cause

The strip is laid out in rem — chat-composer-context-strip … w-[calc(100%-2.75rem)] (BranchToolbar.tsx), i.e. a 1.375rem inset per side that scales with the interface font size.

The glass slab that traces it is clipped with px constants — apps/web/src/index.css, .chat-composer-glass-shell-with-context::before, the shape() path steps in a hardcoded 22px (with 38px / 29.16px / 9.85px companions). 22px == 1.375rem only at root size 16, so the slab's silhouette and the strip's border coincide only at the default font size. The comment above the path ("whose visible sides align with the composer's bottom tangents") holds at 16 and silently breaks at every other size.

Fix

Express the step-in constants in rem so they track the strip:

  • 22px → 1.375rem (only in the step-in/side positions — the composer's top corner radius is genuinely 22px and stays px)
  • 9.85px → 0.6156rem (step-transition curve controls, 9.85/16)
  • 38px → calc(1.375rem + 16px)
  • 29.16px → calc(1.375rem + 7.16px)

(The bottom corner radius 16px / 7.16px values match the strip's px-literal border-radius: 0 0 16px 16px and stay px.)

I run exactly this substitution as a local override and it's pixel-correct at interface sizes 16 and 20 (verified via devtools screenshots against a textured background).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions