Skip to content

Studio: WebKitGTK Glass drops the sidebar's live blur and Frosted's grain tile (long-chat scroll) - #17327

Merged
danielhanchen merged 1 commit into
mainfrom
studio-webkitgtk-glass-scroll
Nov 9, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
studio-webkitgtk-glass-scroll

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Problem

On the Linux desktop app (WebKitGTK, where data-glass-cpu is set), scrolling a long chat with Glass on still drops frames: on a GitHub ubuntu-latest runner at 150 turns, 32 to 35 of about 70 scroll frames take over 50 ms with Liquid 3D. #16957 already removed the live blur everywhere on this path except the sidebar. WebKitGTK re-runs every backdrop-filter on each composite, so that one remaining sidebar blur runs again on every scroll frame. Frosted has a second cost: its grain texture is an SVG feTurbulence background tile on the sidebar and composer, which WebKitGTK redraws on every paint.

Change

Only under html[data-glass-cpu] (set on WebKitGTK only; macOS, Windows and Chromium are untouched):

  • The sidebar is no longer exempt from the no-live-blur rule, and its fill is raised to the 96% cap (--glass-pane-floor: 110%) so it stays readable without the blur.
  • Frosted's grain tile is dropped (background-image: none) on the sidebar, composer, files panel and the wallpaper preview composer.

Results

Real runner, ubuntu-latest, Playwright WebKit on the app's WebKitGTK path, 150 turns, Liquid 3D scroll; base run twice as an A/A arm, arms rotated per runner:

Runner base base (A/A) this PR
1: frame p50 / p95, frames > 50 ms 47 / 105 ms, 32 51 / 106 ms, 35 34 / 71 ms, 15
2 22 / 38 ms, 4 23 / 40 ms, 4 18 / 34 ms, 3

Solid and Chromium are unchanged on the same runs. Locally (Playwright WebKit, GTK path, sum of 178 scroll frame gaps at 150 turns, base 6 runs vs head 3): Liquid 3D 3424 to 3751 ms -> 3136 to 3284 ms, Frosted 4915 to 7432 ms -> 3177 to 3189 ms (p50 28 to 33 -> 16 ms); every head run below every base run.

Look

On the Linux desktop app with Glass, the sidebar is a dense fill instead of frosted glass, and Frosted loses its grain. Over the default backdrop the sidebar differs by at most 5 to 6 / 255. Over an image wallpaper the difference will be visible (not captured here). Left: main. Right: this PR.

Liquid 3D, Linux desktop path, main vs this PR

Frosted, Linux desktop path, main vs this PR

Tests

  • tests/glass-webkit-blur.test.ts updated for the sidebar and the Frosted grain.
  • Frontend node suite passes (one KaTeX test fails only with a shared, symlinked node_modules, the same on main); the Chromium long-chat gate passes.
  • Not covered: a real WebKitGTK desktop / AppImage build (the runner uses Playwright's WebKitGTK build).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 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-09T21:47:06.260331Z f4aa409 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.

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 9, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Nov 9, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: f4aa409e9c

ℹ️ 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
danielhanchen merged commit c96493c into main Nov 9, 2026
@danielhanchen
danielhanchen deleted the studio-webkitgtk-glass-scroll branch November 9, 2026 22:24
wasimysaid added a commit that referenced this pull request Nov 10, 2026
… browser tab strip on Linux (#17380)

Two rendering defects with Glass on (Liquid Glass / Liquid Glass 3D).

**Diagonal stripes on glass surfaces (macOS and Linux apps, Safari,
Firefox).** The liquid sheen fades about 2% of white out across half the
surface. WebKit and Firefox do not dither gradients, so each 8-bit step
draws as a wide diagonal stripe. In dark theme that is five bands across
the Settings dialog, and the same on the sidebar, the composer and the
browser toolbar. Chromium dithers the same gradient into a fine pixel
pattern, so Windows and Chrome/Edge do not show it. The sheen is now off
on WebKit (`data-glass-layers`) and on Firefox (`@supports
(-moz-appearance: none)`); the rims and the short edge glows are
unchanged, and Chromium keeps the sheen.

**Rings around the welcome greeting with Glass on and no image (reported
on macOS).** The greeting sits on a soft elliptical halo that darkens a
background image behind the text. Glass with no image draws a plain
backdrop in the page colour, so the halo is the same colour as what it
covers: it changes nothing, and blending it rounds a step dark in
places, which draws concentric rings. The halo is now drawn only where
the wallpaper is an image (`data-wallpaper-image`).

**Black strip across the top of the browser pane (Linux app).** On the
WebKitGTK path that drops live blur and uses dense fills (#16957,
#17327), the side panes took a fully opaque fill. The browser's tab
strip is its own layer (`z-40`), and WebKitGTK paints that opaque layer
black when the pane opens, hiding the tabs until something restyles it.
A fill just under opaque, or no `z-index`, draws correctly. The side
panes now use the same 96% cap the sidebar already uses. This change is
limited to `html[data-glass][data-glass-cpu]`.

Validation:

- Native Tauri dev build on Linux, WebKitGTK 2.54.2, NVIDIA, KDE
Wayland, dark theme, Liquid Glass 3D, no wallpaper image.
- Stripes: before, text-free areas of the Settings dialog, sidebar and
composer spanned 3 to 5 brightness levels in diagonal bands; after, each
is a single flat value. Checked in OS screenshots of the Settings
dialog, sidebar, new chat composer and browser pane. That run used the
first commit, which keyed the override on the Linux-only flag; the
second commit keys it on the WebKit flag, which is set under the same
conditions on Linux.
- The same gradient over the same fill on a bare page: Chromium 156
dithers it (no bands), WebKitGTK and Firefox draw clean bands about
130px wide.
- The sheen rules lifted from `index.css` onto a test page (dark Liquid
Glass 3D, a plain surface and a composer surface): Firefox renders both
flat after the change, Chromium still renders the sheen.
- Rings: on the Linux app's page rebuilt in WebKitGTK 2.54.2 with the
plain Glass backdrop, the area around the greeting has 4,844 pixels one
step darker than the page, in concentric ellipses, with the halo and 0
without it. The new selector matches with an image and not with the
plain backdrop. New `tests/welcome-halo-image-only.test.ts`.
- Black strip: reproduced on every open of the browser pane before the
change, in both OS screenshots and the webview's own screenshot, so it
is page paint and not the native page. After the change the tab strip
drew correctly on 3 of 3 reopens.
- Isolated the black strip by reopening the pane with single overrides:
an opaque fill with or without the sheen stayed black; 96% alpha or
`z-index: auto` drew correctly.
- `tests/glass-webkit-blur.test.ts` updated for the pane fill and
extended to pin both sheen overrides; full frontend suite passes.

Not checked: macOS itself (the stripes and the rings there were reported
by macOS users; I have no Mac to confirm either fix on), Studio's own UI
in Firefox (only the test page above), light theme, a wallpaper image,
and pages other than chat and Settings.
wasimysaid added a commit that referenced this pull request Nov 10, 2026
…th and the Windows-style title bar) (#17387)

Since #16957 and #17327, Glass on the Linux desktop app has no live blur
at all: every glass surface is a dense or opaque fill. On a machine with
a GPU that trade buys nothing and Glass stops looking like glass:

- The sidebar, composer, menus, dialogs and side panes no longer frost
what is behind them. Over a wallpaper image the sidebar is a 96% opaque
slab.
- Glass strength does nothing. Dragging it from 0 to 100 on the chat
page changes the computed paint of 0 of 932 elements and 0 pixels,
because there is no blur to scale and every fill sits at its cap.

This removes the WebKitGTK no-blur rule and every fill that compensated
for it, so Linux Glass uses the same blur, fills and strength as macOS
and Windows again.

**Kept from those PRs**, still under `data-glass-cpu`, because they are
paint costs that do not depend on the blur:

- Frosted's grain tile (an SVG `feTurbulence` redrawn on every paint)
stays off.
- Liquid 3D's wide inner glows stay gradients and its lifts keep the
smaller blur.

**Software compositing.** The pause-blur-while-moving path (#17007)
skipped WebKitGTK only because there was no blur left to pause; it no
longer does. One limit: WebKitGTK masks the WebGL renderer string
("Apple GPU"), so `softwareCompositing()` only reports true there when
WebGL is unavailable or the documented override is set. It does not see
llvmpipe.

**The composer's blur was never drawn on Linux (second commit).** With
the blur back, the sidebar frosted the wallpaper but the composer showed
it sharp behind a tint, although both compute the same
`backdrop-filter`. The composer and the files panel each hold a "Drop
files here" overlay that sits at `opacity: 0` with its own
`backdrop-blur-sm` until a file is dragged, and WebKitGTK stops drawing
a surface's own backdrop blur while a hidden child of it carries a
`backdrop-filter`. The overlays now take their blur only in the states
that show them. In the real app, edge detail behind the composer goes
from 24.0 to 1.6 (sidebar 0.8, bare wallpaper 35.2), and putting the
hidden overlay's blur back on the live element returns it to 24.0. New
`tests/glass-hidden-overlay-blur.test.ts` pins it.

**The Linux title bar now matches Windows (third commit).** Linux uses
the same in-page title bar as Windows, but three parts of its Glass
layout were switched on for Windows only: the frame that joins the title
bar strip and the pinned sidebar into one frosted surface with a rounded
inner corner, the browser pane's single glass layer below the caption,
and the wallpaper blur behind non-chat pages. On Linux the strip behind
the window buttons was bare wallpaper. All three now key on
`shouldUseCustomWindowTitlebar()` instead of a Windows check; the
`data-windows-*` attribute names are unchanged. On a rebuilt copy of the
Linux page in WebKitGTK 2.54.2 the frame draws as on Windows (its `mask`
and `backdrop-filter` on one pseudo-element work there), and that build
supports the CSS anchor positioning the page layout uses. The look was
checked by eye in the running Linux app against Windows screenshots.

Measurements, native Tauri dev build, WebKitGTK 2.54.2, KDE Wayland,
Liquid Glass 3D over a wallpaper image, 600-message thread, 238 scripted
scroll frames, three alternating runs each:

| Rendering | Blur | Frame p50 / p90 | Frames over 25 ms |
| --- | --- | --- | --- |
| GPU (NVIDIA) | on (this PR) | 16 / 18 ms | 0 to 9 |
| GPU (NVIDIA) | off | 16 / 17-18 ms | 0 to 9 |
| Software GL (llvmpipe forced) | on (this PR) | 20-22 / 24-28 ms | 18
to 38 |
| Software GL (llvmpipe forced) | off | 16 / 17 ms | 2 to 6 |
| Software GL, motion pause forced on | paused while scrolling | 16 / 17
ms | 1 |

So with a GPU the live blur is free here, and without one this PR costs
about 5 ms a frame on a fast desktop CPU, more on a slower one. That
cost is the trade-off of this change. With the motion pause on,
scrolling is back to 16 ms and the blur returns at rest, so a reliable
software-rendering signal for WebKitGTK (for example from the shell)
would close the gap as a follow-up.

Validation:

- Live in the app: the sidebar and composer compute `blur(...)
saturate(...)` with translucent fills again, and follow Glass strength.
- `tests/glass-webkit-blur.test.ts` rewritten: the flag may only swap
paint costs (no rule under it touches a blur, a fill or the strength
variables); the grain and glow rules are still pinned.
`tests/glass-motion.test.ts` updated for the gating. Full frontend suite
(15,608) and the test typecheck pass.

Not checked: the title bar change on Windows itself (the condition is
still true there, so it should be unchanged), the drop overlays while a
file is actually being dragged, light theme, Frosted and Blurred styles,
a real host without a GPU (software GL was forced on a GPU machine), and
the AppImage build.

Relation to #17380: that PR's side-pane fill change edits a rule this PR
deletes, so whichever lands second needs a small rebase. Its black tab
strip came from the opaque fill removed here. Its sheen fix is still
needed, since the stripes do not depend on the blur.
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.

1 participant