Commit Graph
3 Commits
Author SHA1 Message Date
4grayandClaude Opus 5.5 84a649c4bb fix(ui): test the token guard's file selection, drop duplicate dark elevation
The guard's tests only fed source strings to the matcher, so a pathspec
change that skipped nested files would have kept CI green. Export the file
selection and test it against a temporary repository: nested app and lib
sources are scanned, specs, untracked files and paths outside apps/libs are
not.

The dark theme context re-declared the elevation tokens with the same black
shadows html already declares; keep only the color roles there (756 bytes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:43:00 +02:00
4grayandClaude Opus 5.5 cccb7bff1c fix(ui): declare Material system tokens and migrate dead --mdc overrides
The theme is built with the legacy mat.define-theme config, whose component
mixins never declare the --mat-sys-* system variables, so every app style
that read one resolved to nothing. Declare them with mat.system-level-* for
the light (html) and dark (.dark-theme) contexts.

Material 22 reads only --mat-* component tokens, so the remaining --mdc-*
overrides compiled but did nothing. Move them to the mat.*-overrides()
mixins (which reject unknown names at build time) and add a CI guard,
styles:material-tokens:validate, that rejects retired --mdc-* names.

Where a now-resolving token changed a shipped surface for the worse, keep
the shipped look:
- form fields keep the theme's outline roles (the hairline app token gave
  inputs a 1.4:1 boundary) and default text sizes (a 13px field floated a
  10px label);
- M3U and collection live views and the radio hero sit on --app-content-bg
  like the Xtream/Stalker live views, instead of the M3 neutral surface;
- the rail brand stays untiled.

Adds the global .app-destructive-button class (adopted by the follow-up
confirmation change) and the theme-tokens Electron E2E, and updates the
token policy in the UI guidelines and the theme skill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 06:43:00 +02:00
4grayandClaude Opus 5 c741815b97 fix(build): include shared UI stylesheets in Nx cache inputs (#1360)
* fix(build): include shared UI stylesheets in Nx cache inputs

`libs/ui/styles` held shared SCSS partials but had no `project.json`, so its
files belonged to no Nx project and were absent from every task hash. Editing
a partial and running `pnpm nx build web` reported 4 of 4 tasks cached and
shipped the previous CSS — a silent wrong build rather than a failure.

Nx derives its project graph from TypeScript imports only, so a relative Sass
`@use` that crosses a project root creates no edge. Verified directly: after
adding the project but before declaring anything, `ui-styles` still had zero
dependents in the graph.

Make it the `ui-styles` project (no targets — it exists to be hashed) and
declare `implicitDependencies` on the 8 consumers. Chosen over adding the path
to `sharedGlobals`, which would put shared styles into every project's hash and
make a one-line SCSS tweak mark the whole workspace affected. A styles edit now
marks 15 projects affected and leaves electron-backend, website, the mock
servers and the shared libs alone.

`libs/ui/styles` was the only projectless directory holding files under `libs/`
or `apps/`.

Add `pnpm run styles:inputs:validate` to keep it closed: it resolves every
relative stylesheet import against Nx's real project graph and fails when one
escapes the input closure of a build that compiles it, naming the project to
declare. It exits 1 with 21 diagnostics on the pre-fix tree. Imports of
`apps/web/src/nav-list.scss` are deliberately accepted — `web` already hashes
that file, and a lib -> app edge would make the graph cyclic.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(build): spawn git without a shell in the stylesheet check

`execSync("git ls-files '*.scss'")` runs through `cmd.exe` on Windows, where
single quotes are literal characters rather than quoting. Git received the
pathspec with the quotes intact, matched nothing and exited 0, so
`styles:inputs:validate` reported success after checking zero stylesheets —
silently disabling the check for Windows developers while staying green.

Spawn with `execFileSync` so no shell is involved and git expands its own
pathspec; verified to return the identical 133 files.

Both this and the eslint glob trap next to it in the docs report success while
covering nothing, so also make an empty scan fail rather than pass: the
workspace always contains SCSS, and a listing that returns none means the scan
broke.

Reported by Codex review on #1360.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* refactor(styles): move nav-list partial into ui-styles (#1361)

* fix(build): count every target of a comma-separated Sass @import

`@import` is the only rule that takes a list, and the scan read just its
first target. A later entry crossing an Nx project boundary escaped the
cache key while the check still reported success — the same silent-pass
failure the tool exists to prevent.

Parse every target of an `@import` list. The obvious "read all quoted
strings" fix trades one silent gap for a phantom one, so the rule decides:
`@use`/`@forward` load exactly one module and a quoted string after it is
`with (...)` configuration, and `url(...)` stays a plain CSS import the
browser resolves at runtime. Neither is a module Sass compiles.

The workspace has no relative `@import` at all today, so the scan still
finds the same 42 imports across 133 files; this closes the gap before
someone writes one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-02 23:18:37 +02:00