Skip to content

Add a selectable light notch surface on Windows - #333

Closed
abrahaofv wants to merge 3 commits into
vinzdg:mainfrom
abrahaofv:solid-light-surface
Closed

abrahaofv wants to merge 3 commits into
vinzdg:mainfrom
abrahaofv:solid-light-surface

Conversation

@abrahaofv

@abrahaofv abrahaofv commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • adds a Dark/Light Surface control under Windows Appearance
  • persists the backwards-compatible light_surface setting and refreshes the notch immediately
  • uses semantic neutral tokens so the light surface has off-white and white layers, soft black marks, grey borders and tracks, and restrained high-contrast usage colors

Scope

Windows only; the existing dark surface and its vivid usage palette remain the default.

Verification

ode scripts/check-ui-scripts.mjsn- ode --test test-codex-headline.cjsn-
ode --test scripts/test-ko-i18n.cjsn- ode --test test-light-surface.cjsn- cargo test --locked (132 passed, 3 ignored)

  • measured light-surface contrast: primary text 14.19:1; muted text and usage states 5.18:1–5.81:1

Co-authored-by: Codex <322868195+abrahaofvcodex@users.noreply.github.com>
@abrahaofv
abrahaofv requested a review from vinzdg as a code owner September 22, 2026 22:56
abrahaofv and others added 2 commits September 22, 2026 20:05
Co-authored-by: Codex <322868195+abrahaofvcodex@users.noreply.github.com>
Co-authored-by: Codex <322868195+abrahaofvcodex@users.noreply.github.com>
@vinzdg

vinzdg commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Thanks @abrahaofv — and I'm sorry, because this is the second time this week you've hit a collision you had no way to see. I'm taking #320, which landed on the same idea a few hours earlier.

The deciding difference is scope: #320 themes the Settings window and the drag overlay as well as the notch, and it sets the appearance before the window is built (initialization_script), so there's no dark frame on the first paint. Yours applies the class after page load (ui/notch.html:1515), so a light notch flashes black on every launch, and Settings and the dropzones stay dark underneath it — a visibly half-done feature through no fault of the code.

Two things in yours are better than what landed, and I'd like them:

One thing to know for next time: bool_or_false (config.rs:184) calls bool::deserialize(deserializer).unwrap_or(false), which swallows the error but leaves the serde stream mid-token for any non-scalar value. Your test only covers a string, which is why it passes. Option&lt;bool&gt; plus unwrap_or is the safe spelling.

For the record, both of you independently solved the same real trap — the JS-drawn SVG arcs and card dots don't follow a CSS theme. Your neutral()/usageColor() helpers and #320's readPalette() are two good answers to it.

#318 and #319 are merged, by the way — thank you for those.

@vinzdg vinzdg closed this Sep 23, 2026
vinzdg added a commit that referenced this pull request Sep 24, 2026
The follow-up invited when #333 was closed. It fails on all four ways the theme
can break, and deserialize_theme_or_system means a malformed theme no longer
discards the rest of the config. Thanks @abrahaofv.
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.

2 participants