Skip to content

Fix header gradient banding on plain glass backgrounds - #17403

Merged
danielhanchen merged 2 commits into
unslothai:mainfrom
Imagineer99:fix/plain-glass-header-fade
Nov 12, 2026
Merged

danielhanchen merged 2 commits into
unslothai:mainfrom
Imagineer99:fix/plain-glass-header-fade

Conversation

@Imagineer99

@Imagineer99 Imagineer99 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Plain glass backgrounds inherit the image wallpaper's 150px header contrast fade. Blending that fade over the same page colour produces subtle horizontal bands in WebKit.

Restrict the existing fade selector to wallpapers without data-glass-backdrop. Plain glass becomes uniform while image wallpapers retain their header contrast fade. This changes one selector, using the existing marker without adding platform branches or override rules. It builds on merged #17380 and does not change greeting or Settings styling.

Validation:

  • npm run build and 60 existing tests across the glass, greeting halo, window material, and composer outline suites passed.
  • 24 before/after component comparisons in Linux Playwright Chromium and WebKit, covering light/dark liquid glass, clear glass, image wallpapers, and solid controls.
  • WebKit dark liquid glass: the sampled header background changes from RGB 23/24 bands to uniform RGB 24; 6,000 pixels change in the 1200×200 header crop.
  • Every image-wallpaper and solid-theme control is pixel-identical. Chromium plain-glass captures are also identical; the visible banding reproduced in WebKit.
  • git diff --check passed.

The browser checks use production GlassBackdrop/ChatBackground components and the production stylesheet in a controlled header scene, with seeded wallpaper state. These are not full native-app or cross-OS captures.

Before / after (Studio built from the merge base and from this branch)

Dark theme, Liquid Glass, no background image, /chat header region in Playwright WebKit. The lower row stretches contrast 40x so the 1-level steps are visible. Before: the column through the chat header alternates RGB 24/23 in 11 runs over the 150px fade. After: uniform RGB 24. The fade's ::after computes to content: none on the plain Glass backdrop in both WebKit and Chromium; the Chromium capture is pixel-identical before and after, since Chromium dithers the gradient.

WebKit header before and after

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T12:41:21.965571Z 1db055a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Nov 12, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 1db055aa93

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 12, 2026
@danielhanchen
danielhanchen merged commit 289d9a7 into unslothai:main Nov 12, 2026
danielhanchen added a commit that referenced this pull request Nov 15, 2026
With glass off, the 24px header fade under the model selector is drawn
over a flat page. Over a flat page every engine rounds some of its
gradient pixels one level off the page colour, which shows as a faint
line or band below the header.

The chat and compare-pane header fades now stay hidden until their own
thread scrolls under the header, and fade back out at the top. With
nothing scrolled beneath them there is nothing to fade, so the page is
exactly flat in every engine. Once content scrolls under the header, the
fade softens it as before. The fades keep Tailwind's default Oklab
interpolation; switching them to sRGB makes WebKit band.

A capture-phase scroll listener on each fade's parent toggles
`data-thread-scrolled` on the DOM directly, so scrolling causes no React
re-render. Only the thread viewport sets it; code blocks and the
full-view dock thread are ignored. The separate plain-glass wallpaper
fix is already on main in #17403.

### Measurements

Live Studio `/chat` page built from the merge base and from this branch,
1600 x 350, dark theme, glass off, empty chat. Count = pixels inside the
fade that differ from the page colour (24, 24, 24):

| Engine | DPR | main | this PR | fade opacity at rest / scrolled / back
at top |

|--------|-----|------|---------|-----------------------------------------------|
| Chromium | 1 | 0 / 31440 | 0 / 31440 | 0 / 1 / 0 |
| Chromium | 2 | 0 / 125760 | 0 / 125760 | 0 / 1 / 0 |
| WebKit | 1 | 0 / 31440 | 0 / 31440 | 0 / 1 / 0 |
| WebKit | 2 | 0 / 125760 | 0 / 125760 | 0 / 1 / 0 |
| Firefox | 1 | 17030 / 31440 | 0 / 31440 | 0 / 1 / 0 |
| Firefox | 2 | 62880 / 125760 | 0 / 125760 | 0 / 1 / 0 |

On main the fade's opacity is 1 in every state. The first version of
this branch (sRGB fades) left Chromium unchanged and made WebKit band at
DPR 1 (0 to 19650 of 31440 pixels); a bare gradient sweep also showed
WebKit sRGB banding in 15 of 20 offset, theme and DPR cells, where Oklab
was flat in all 20.

![Firefox DPR 2, dark, empty chat. Orange marks every pixel one level
off the page colour: a band below the header on main, none on this
branch.](https://raw.githubusercontent.com/danielhanchen/unsloth-staging-2/pr-media/pr/17690/pr17690_firefox_fade-2560621f1901.png)

### Tests

`tests/chat-header-fade-scroll-gate.test.ts` covers the flag following
the thread viewport's scrollTop in the capture phase, other scrollers
and the dock leaving it alone, the hidden-by-default CSS gate on a
direct parent, and both fade parents carrying the tracker with Oklab
kept. The frontend suite (15939 passed, 0 failed) and the production
build pass.

---------

Co-authored-by: Daniel Han <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants