Skip to content

feat(editor): light mode - #36

Merged
NiJingzhe merged 1 commit into
devfrom
feat/editor-light-mode
Oct 13, 2026
Merged

NiJingzhe merged 1 commit into
devfrom
feat/editor-light-mode

Conversation

@NiJingzhe

Copy link
Copy Markdown
Collaborator

What

Light mode for sca edit.

  • Follows the operating system's theme; a button at the end of the header cycles system → light → dark and the choice is remembered (localStorage["sca-theme"]). A small script in index.html sets the theme before first paint, so there is no flash.
  • The page palette is two sets of CSS variables (light is the default, html.dark restores the existing dark look); the Tailwind black/white literals (about 25 sites) became tokens. Light keeps the square black-and-white look with the four meaning inks darkened for contrast.
  • The 3D viewport goes light too (src/scene/theme.ts): background, edge color, grid, axis gizmo, vertex points and the selection highlight. BRepRenderer.setTheme recolors in place, so the model, camera and picked selection are untouched.
  • CodeMirror colors are CSS variables (one theme serves both); the loading veil's canvas reads its inks from the page.

Checked (ego-browser)

  • Light and dark screenshots of the same state: model with a picked face and the selection cell, module view with controls, log dock with an error, loading veil, workspace tab. Dark is unchanged.
  • Toggle cycle and persistence across a reload; system follows the emulated OS theme live; switching keeps the camera and the selection overlay.
  • The light viewport background matches the page (254 vs 255 after tone mapping).
  • npm run build (tsc + vite) and pytest test/test_editor.py pass.

Notes

  • Not exercised: a real OS theme change on a physical browser (headless emulation only fires the change event after a frame is rendered).
  • The LazyLoader ... 'cryptography' package is not installed warning still shows in the first cell's output; unrelated to this change.

Follows the system theme, with a header button cycling system/light/dark
(remembered). The page colors are CSS variables for both palettes; the 3D
viewport (background, edges, grid, axes, vertex points, selection), the
code editor and the loading veil switch with it, in place.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@NiJingzhe
NiJingzhe merged commit 17d6eef into dev Oct 13, 2026
5 checks passed
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