Skip to content

fix(ui): a glass pane does not change on focus - #14992

Merged
bolichen97 merged 1 commit into
mainfrom
fix/glass-no-focus-step
Sep 29, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/glass-no-focus-step

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A Liquid Glass pane looks the same whether or not a control inside it has focus -- every pane: the composer dock, the mobile Settings search capsule, and the session-list / crew-roster search fields (SearchFilterBar, #14896). #14887 removed the composer's accent halo and the brighter focus fill but left one focus step: the side lines darkened and the shadow deepened while the textarea (or the mobile Settings search field) had focus. The maintainer, looking at the shipped frames, read that step as the same fault in a smaller size -- a second, whiter box on the transcript -- and decided the pane does not change on focus at all: "两边都改成完全无区别".

Before this change, on a .glass-shadow pane holding focus:

  • --glass-edge swapped to --glass-edge-focus (dark #ffffff24 -> #ffffff8c, light #0000003d -> #0009);
  • the box-shadow deepened (light rgba(0,0,0,.06) -> .14, dark .30 -> .55).

Why it matters

The composer is the most-focused element in the product. Every focus rendering it carries is what the whole material is judged by; a pane that gets crisper edges and a darker halo when tapped reads as a state change on the box, when the state change the user made is "I am typing here" -- which the caret already shows.

Not a goal

What changed (motivation → approach → change)

The focus step is gone

Symptom: focusing the composer darkened the pane's side lines and deepened its shadow. Cause: .glass-shadow:focus-within (three rules in index.css) and the --glass-edge-focus token. Change: all four removed. .glass-shadow is one rest shadow per polarity plus the approval-glow swap; no rule on it matches :focus-within, and no glass token has a focus form.

shadow (rest = focused) side line (rest = focused) tint (rest = focused)
dark rgba(0,0,0,.30) 0 0 18px #ffffff24 #1e1e2266
light rgba(0,0,0,.06) 0 0 18px #0000003d #f0f0f073
solid (fallbacks / switch) -- the pane's own 1px --border outline --

Measured on the built page (capture-liquid-glass.mjs): dock shadow, side line, tint and wrapper border are equal before and after the textarea takes focus, in both polarities, with a pending approval (the glow stays in the shadow slot), and on the mobile Settings capsule.

The same rule reaches every other .glass-shadow pane, which is the point: the session-list and crew-roster search fields (SearchFilterBar.tsx, landed in #14896 as glass panes with a transparent outline-hidden input) lose the same step and show only their caret on focus. No component code changes there; their focus-cue-ok comment and the module docblock now record the decision instead of claiming the step.

Comments say the decision, not a cue

The focus-cue-ok comments on the composer textarea (ChatInput.tsx), the mobile Settings search input (SettingsSearch.tsx) and the list search input (SearchFilterBar.tsx) claimed the pane's focus step as their cue, and two more ChatInput.tsx comments (the dock Glass and the clip wrapper) said "the focus step stays" under an approval glow. They now state the maintainer decision: the pane does not change on focus, the caret is the indicator. The Glass.tsx contract docblock, the SidePanelLayout capsule comment, the index.css token, shadow, Settings-search-ring and solid-fallback comments (including the dangling one at the end of the contrast block that described the deleted rule) and website/docs/theming-contract.md (the polarity-fixed variable list) say the same. scripts/check_focus_cue.py keeps its window and is green; its one comment describing the composer's cue is reworded to the decision. grep -riE 'glass-shadow:focus-within|focus step|edge focus' website/src scripts/check_focus_cue.py (tests excluded) returns nothing.

Backwards compatibility

CSS only: one token and three rules removed, none with a consumer outside index.css. No API, config or stored data changes.

Tests

  • ChatInput.liquidGlass.test.tsx: the token pins drop --glass-edge-focus; the shadow test pins the two rest shadows and the approval-glow swap, and asserts that no .glass-shadow rule matches :focus-within and that neither --glass-edge-focus nor --glass-tint-focus exists.
  • capture-liquid-glass.mjs: the composer, approval and mobile-Settings scenes now assert the pane is unchanged by focus (shadow, side line, tint, wrapper border) instead of asserting a delta, and photograph the focused states with the caret drawn (a frame with no caret caught fails the run).
  • capture-glass-search-dock.mjs: the sessions scene focuses the search input, asserts the glass field's shadow, side line and tint are unchanged, and photographs the focused state.

Manual verification

  • tsc, eslint (touched files), i18n-check, check_focus_cue.py: green.
  • capture-liquid-glass.mjs on the built SPA: 100 frames (shelf-r18), every focus assertion above passing; the composer and Settings frames below come from that run. capture-glass-search-dock.mjs against a loopback vite of this head: the sessions search field frames below, focus assertions passing in both polarities.

Screenshots / video

Rest / focused, dark and light: the pane is identical by design -- it does not change when the textarea takes focus; the caret in the focused frames is the indicator. (Playwright hides the caret in screenshots by default, so the harnesses now take the focused frame with the caret left alone and keep the take in which it is drawn -- scripts/lib/screenshot-with-caret.mjs, shared by both capture scripts; the on/off probe reads the focused input alone, never a region with motion of its own such as the pulsing approval glow.)

composer dark rest
composer dark focused
composer light rest
composer light focused

Approval pending, focused: the glow stays; the glass is unchanged.

composer dark approval focused
composer light approval focused

Mobile Settings capsule up close, rest then focused, dark and light: the pane is identical; the caret is the only difference.

settings capsule dark rest
settings capsule dark focused
settings capsule light rest
settings capsule light focused

Session-list search field (SearchFilterBar, the glass pane from #14896), rest then focused, dark and light: identical too. capture-glass-search-dock.mjs reads the pane's shadow, side line and tint before and after the input takes focus and asserts they are equal (the only pixels that differ between the two frames are the two pulsing "running" dots in the list).

sessions search field dark rest
sessions search field dark focused
sessions search field light rest
sessions search field light focused

Related Issues

Follow-up to #14887 (the focus step it left) and #14568.

Pattern harvest

Rule candidate: review-prompt
Pattern: when a maintainer says a state must look "the same", check the computed style for EVERY property the state could touch (shadow, edge, tint, border), not just the one that was changed last; a "no change" claim is a set of equalities, and the harness should assert all of them.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@CrysisDeu
CrysisDeu requested a review from a team September 29, 2026 08:51
@CrysisDeu
CrysisDeu requested a review from a team as a code owner September 29, 2026 08:51
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 95ba9ef2de5d19e5720eba425f13803f123db35a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify the maintainer's disposition comment exists on this head — the caret-only accessibility trade-off rests entirely on that recorded authorization.

Suggestions

[DESIGN-REVIEWED] 95ba9ef

Description read

[DESCRIPTION-READ] ef5f676e2d254580584c9816674d5ce160ad7426821abb7eb0cde7627f14363e

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 95ba9ef2de5d19e5720eba425f13803f123db35a and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 95ba9ef

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 95ba9ef2de5d19e5720eba425f13803f123db35a: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of 95ba9ef2de5d19e5720eba425f13803f123db35a — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Verify the maintainer disposition ("两边都改成完全无区别") is actually recorded on this head — the deleted WCAG 2.4.7 focus-cue pin rests entirely on it.

Not justified as shipped

  • Item 7 — rides along: screenshot-with-caret.mjs is new harness tooling, not the fix; declared, harm named (a caret-less focused frame is indistinguishable from rest), 5 call sites in 2 scripts, no existing helper (grepped caret in website/scripts, only unrelated hits).
  • Item 8 — rides along: the close-up rest/focused capsule frames are evidence-generation the fix does not need; declared in the screenshots section, harmless.

What this change ships

Inventory (9 items) — 7 justified

Intent: FIX — a Liquid Glass pane must look identical whether or not a control inside it has focus, per the quoted maintainer decision following #14887.

  1. The composer dock no longer darkens its side lines or deepens its shadow on focus — justified
  2. The mobile Settings capsule shows no focus change — justified
  3. The session-list and crew-roster search fields show no focus change — justified
  4. The --glass-edge-focus token is gone — justified
  5. Capture harnesses now fail if any measured pane property changes on focus — justified
  6. The sessions search capture gains its own focus-equality check and focused frame — justified
  7. Focused evidence frames must now show the caret (screenshot-with-caret.mjs) — rides along (declared; new harness helper, not the fix)
  8. New close-up rest/focused capsule frames — rides along (declared; evidence only)
  9. Comments, theming-contract.md and the focus-cue-ok markers now record the decision instead of claiming the deleted step — justified

Deleted pins (the focus-step tests, the WCAG 2.4.7 comment) are reversed openly: the description names the reversal, quotes the decision, and accepts the accessibility trade-off explicitly; the new negative pins fail on base. Grep of --glass-edge-focus post-change: only the negative test pin remains — zero consumers, matching the "none with a consumer outside index.css" claim. No docs/decisions/ entry covers the glass focus step, so no recorded decision is silently edited.

[FIRST-PRINCIPLES-REVIEWED] 95ba9ef

Description read

[DESCRIPTION-READ] 6f96ee1b1b75dd555fc2fa5d26209d04f3cefa447c93751a735dc5b90af58c93

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

UX-level review of 95ba9ef2de5d19e5720eba425f13803f123db35a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Blind reader could barely tell focused panes from resting ones — "if I looked away I couldn't tell which state I was in" — confirm that glance cost is the accepted decision's full extent.

[UX-REVIEWED] 95ba9ef

Description read

[DESCRIPTION-READ] e259f182fff357a3672312871cf69b3cd00656c909b92ff4ec05f14e4364dd45

That sha256 names everything this verdict read: the PR description, plus the 17 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed 95ba9ef2de5d19e5720eba425f13803f123db35a — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 95ba9ef

Verdict parsed from the review's SHA-scoped output markers for commit 95ba9ef2de5d19e5720eba425f13803f123db35a.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 95ba9ef2de5d19e5720eba425f13803f123db35a: <one-sentence reason>

@CrysisDeu
CrysisDeu force-pushed the fix/glass-no-focus-step branch 4 times, most recently from 361df84 to e10dbf6 Compare September 29, 2026 10:33
#14887 left one focus step on the Liquid Glass panes: while a control
inside a `.glass-shadow` pane had focus, the side lines swapped to
--glass-edge-focus (dark 14% -> 55% white, light 24% -> 60% black) and
the shadow deepened (6% -> 14%, dark 30% -> 55%). The maintainer read
that step, like the brighter focus tint before it, as a second, whiter
box sitting on the transcript, and decided a focused pane is the same
glass as a resting one -- in glass mode and in the solidified modes
alike.

The --glass-edge-focus token and every `.glass-shadow:focus-within`
rule are removed; `.glass-shadow.approval-glow` keeps the pending glow
in the shadow slot. The composer's focus indicator is the caret; a glass
chip that is itself a button keeps the app's :focus-visible ring; the
desktop Settings search bar is a boxed input and keeps its neutral ring.
The focus-cue-ok comments on the composer textarea and the mobile
Settings input now state that decision instead of a cue, the Glass
contract docblock and the theming contract follow, the CSS pins assert
that no `.glass-shadow` rule matches :focus-within and no token has a
focus form, and the capture harness asserts the pane is byte-identical
before and after focus (with and without a pending approval, and on the
Settings capsule).
@CrysisDeu
CrysisDeu force-pushed the fix/glass-no-focus-step branch from e10dbf6 to 95ba9ef Compare September 29, 2026 11:13
@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=8f5f0a6f0f51 record the focus decision under docs/decisions/: declined

Maintainer decision, recorded on this head: a Liquid Glass pane does not change on focus -- no accent, no brighter tint, no darker side lines, no deeper shadow -- in glass and solid modes alike; the caret is the indicator on an input and a glass button keeps the app's own :focus-visible ring. The decision is stated in the description, in the index.css token and shadow comments, in the Glass contract docblock and in the focus-cue-ok comments the focus gate reads, and it is pinned by tests that fail if any .glass-shadow rule matches :focus-within or any glass token grows a focus form. A separate docs/decisions entry is not added in this PR (scope frozen by the maintainer to the CSS reversal); if the question re-opens, the pins above are where it lands.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=cee4e36209a9 Item 7 -- screenshot-with-caret.mjs rides along: declined

Acknowledged as the reviewer states it: new harness tooling, declared, with the harm named (a caret-less focused frame is indistinguishable from a resting one once the pane itself does not change) and no existing helper to reuse. It ships here because the evidence for this exact change cannot be produced without it.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author
  • span=8fd2d130a8ba Item 8 -- close-up capsule frames ride along: declined

Acknowledged: the close-up rest/focused capsule frames are evidence for this change's claim (the pane is identical, the caret is the only difference), asked for by the UX lane on the previous head because the 3x phone frame shrank the caret to a hairline. Harmless, declared in the screenshots section.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 29, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Read-only review note. The change does what it says (the three .glass-shadow:focus-within rules and --glass-edge-focus are removed; check_focus_cue.py logic is untouched). Flagging for a human decision rather than a bot approval: after this the composer textarea (ChatInput.tsx:4457), the list search (SearchFilterBar.tsx:61) and the mobile Settings capsule (SettingsSearch.tsx:184) show only the caret on focus. A caret blinks, is hard to see at high zoom or low vision, and disappears while text is selected, so whether it satisfies WCAG 2.4.7 is arguable and it does not meet the 2.4.11/2.4.13 focus-appearance intent. Glass buttons keep their :focus-visible ring. The PR body accepts the trade-off knowingly; a maintainer should record that acceptance explicitly, or keep a subtle non-glass ring (e.g. outline on :focus-visible only) on these three inputs.

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed on behalf of the maintainers (sweep 2026-09-29): readiness passed, required checks green on 95ba9ef, no blocking review threads, security posture unchanged. Recording explicitly, per @iamwhatever's note: the caret-only focus cue on glass panes is the accepted product decision from the #14887 follow-up; approving and merging.

@bolichen97
bolichen97 merged commit cb6bb0f into main Sep 29, 2026
97 checks passed
@bolichen97
bolichen97 deleted the fix/glass-no-focus-step branch September 29, 2026 16:55
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 29, 2026
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.

3 participants