Glass: no flicker on bar morphs, tab switches, hovers or typing (#287) #383
Loading…
Reference in a new issue
No description provided.
Delete branch "issue/287-glass-flicker-2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #287. Replaces #374: the same work with current
dev(63ef0f6, after #376 / train #381) merged in. Conflicts are resolved keeping both sides: the PhoneStack note screen (#285, #294), Settings'{active}bar (no toasts in the hidden tab), the keyboard room (#290),plainRgbin theme-color (#304), the input-source signal (#344), and dev's tabs and keyboard test fixes. Morph keeps #376's keyboard early returns in enter and exit.Causes, proven on the issue (frame data, CDP LayerTree, Animation and a per-frame watcher): #287
opacityfaded the whole tab layer, which is a backdrop root for every pane. The panes showed the sharp photo for the whole fade, then snapped back to frosted.visibility: hidden: the first frame's glass blurs nothing, so there was one dark frame on every switch.route.queryand woke the theme and backdrop effects. They rewrotetheme-colorand the root's vars on every bar morph (4–8 writes) and on every key in search (40 theme-color writes + 80 root style changes + 20replaceStateper 20 characters).mix-blend-mode(crbug 1348920).Fix
opacity: 0+inert+aria-hidden.Morph: the glass is a childless.morph-glass, the contents are on.morph-clip, the halo always has its own layer, and the away fade is on the glass layers rather than a parent. The springy morph is unchanged, and the bar looks the same (pixel difference < 0.2/255 in every mode, Chromium and WebKit, 1440/390/320).@calternal/ui/lib/page-chrome(setThemeColor,setRootVar,setRootData,applyRoute): it writes only on a real change. Used by the theme, backdrop, keyboard and input flag in both apps.Guards:
glass.specchecks every frame for backdrop roots (including animated ones), that the bar glass has no children, one-frame flashes on the panes and halo, and frames in between on a tab switch. All three new checks fail before this change and pass after.page-chrome.spec: typing 20 characters and a bar morph cause 0 theme-color writes, no root changes, and at most 1 address write after typing stops.tabs.specnow takes the note's address once the editor is live.Merge follow-ups:
page-dim'sdata-dimnow usessetRootData, which now takesnullto remove a key.data-edgeis written only on change and removed only when the stack goes.opacityProperty).data-morph-untillike the capsule, so the layout-shift checks in editor.spec and prefs-offline.spec treat them as the morph.Tests: glass, page-chrome, tabs, keyboard, bar-stable, bar-stays, phone-bars, phone-edges, safe-areas, toast-bar, prefs and prefs-offline ran on chromium and webkit at 390 and 1440: 853 passed. Two failed:
bar-stays.spec:77on webkit-390, the link-chip tap. It fails 3 of 3 ondevhere as well.prefs-offline:107on prefs-chromium, a layout shift on.morph-glass. That one is mine and is fixed in the last commit. I reran prefs-offline once after the fix, on prefs-chromium only (prefs-webkit not run), and it passed. editor.spec passed 3 of 3 on chromium-390 and webkit-390.safe-areas.spec:142, the box-shadow caught mid-transition, passes 3 of 3 on chromium-390 and 3 of 3 on webkit-390. It also passed in the full run. It is skipped at 1440 by design.Perf: CSS and a few small JS changes. Less work while typing and on morphs: no theme or backdrop effect re-runs, no root style writes, one history call per burst. The hidden tab is now painted at opacity 0 rather than skipped; it is static, so it costs nothing per frame.
kayg, please confirm on the Mac: the steps are on the issue (tab switching, bar hover and morph, typing).
🤖 Generated with Claude Code
https://claude.ai/code/session_018Yyy8fQGxPLkLa8v8NXz7T
63ef0f6) into issue/287-glass-flicker-2; page-dim and the phone edge write only on change 3e077a187c