Skip to content

fix(appearance): paint the editor gutter from the active skin - #1184

Merged
Harry19081 merged 1 commit into
developfrom
fix/skin-editor-gutter
Sep 1, 2026
Merged

fix(appearance): paint the editor gutter from the active skin#1184
Harry19081 merged 1 commit into
developfrom
fix/skin-editor-gutter

Conversation

@TsomgoLake

Copy link
Copy Markdown
Collaborator

Problem

On any non-baseline skin, the file viewer's line-number column kept the base
stylesheet's background while the code beside it took the skin's. Two surfaces
meant to share one colour visibly did not.

The base sheets declare, at :root:

--cm-editor-gutter-bg: var(--cm-editor-background);

A custom property declared as an alias has its var() substituted on the
element where it is declared
— here :root — and descendants inherit the
already-substituted result. Skin tokens are written as inline properties on
<body>, so overriding --cm-editor-background there never moved the gutter.

This is structural rather than a typo: it applies to any :root alias whose
referent a skin overrides, and it is invisible until someone notices a
mismatched strip on screen.

Solution

Emit --cm-editor-gutter-bg from deriveSkinTokens alongside
--cm-editor-background, so both land in the same scope and move together.

Add rootAliasParity.test.ts, which parses the shipped stylesheets, finds every
:root declaration that aliases another token, and fails when the referent is
skin-owned but the alias is not — and is not redeclared in the body scope,
where it would resolve correctly anyway. Reading the stylesheets rather than a
hand-maintained list means the next such alias is caught when it is added.

Auditing the current sheets found exactly one offender. The other three aliases
(--cm-font-family, --diff-added-chunk, --diff-deleted-chunk) point at
tokens no skin overrides.

Also renames the Codex skin's display label to Constantly Reset, returning
the joke Codex makes with its Claude-flavoured "Absolutely". The rename lives in
a SKIN_LABEL_OVERRIDES map in the hand-written registry.ts, not in the
generated codexSkins.ts, for two reasons: the generated module stays a
faithful record of what Codex actually ships, so regenerating it cannot quietly
revert the label; and only the label changes. The id codex-codex is what
general.lightSkin / general.darkSkin persist, so renaming it would fail the
settings enum and silently reset every install that had this skin selected.

This PR carries a bug fix and a rename together at the author's request. They
are independent — the gutter fix stands whether or not the new name does.

Potential risks

  • Baseline skins are unaffected. They emit no tokens at all, so the shipped
    light and dark designs keep resolving the alias through the stylesheet exactly
    as before. The change is only observable on a Codex skin.
  • The parity test reads public/orgii_*.css from disk. Moving or renaming those
    files breaks the test rather than failing silently, which is the intended
    direction, but it is a build-time coupling to a path.
  • The test only understands :root and body scopes. An alias declared under a
    narrower selector would not be checked; none exist today.
  • The rename is cosmetic and reversible in one line. It does change a
    user-visible label for anyone already running the Codex skin, who will see the
    entry rename itself without their selection changing.

Verification

Verified in a clean git worktree checked out at origin/develop (57c8ffd47)
with only this branch's four files applied, rather than in the working checkout,
which carries unrelated in-flight work:

  • npx tsc --noEmit --pretty false — exit 0
  • npx eslint src/config/appearance --ext .ts --max-warnings 0 --report-unused-disable-directives — exit 0
  • npx vitest run --config config/vitest.config.ts src/config/appearance src/config/settingsSchema — exit 0, 12 files / 83 tests passed

The new guard was checked for vacuity: reverting the one-line fix makes it fail
with --cm-editor-gutter-bg -> var(--cm-editor-background), and restoring it
passes.

Not verified: no screenshot of the corrected gutter across skins, and the full
test suite was not re-run for this change — the diff is confined to the skin
registry and its own tests, and CI runs it.

The base sheets declare `--cm-editor-gutter-bg: var(--cm-editor-background)`
at `:root`. A custom property declared as an alias has its `var()` substituted
on the element it is declared on, and descendants inherit the substituted
result, so overriding the editor background on `<body>` never moved the
gutter: the line-number column kept the stylesheet's background while the code
beside it took the skin's.

Emit the gutter background alongside the editor background so both land in the
same scope, and add a test that reads the shipped stylesheets and fails on any
`:root` alias pointing at a skin-owned token.

Also rename the Codex skin to "Constantly Reset", matching the joke Codex
makes with its Claude-flavoured "Absolutely".
@Harry19081
Harry19081 merged commit e3bf39d into develop Sep 1, 2026
6 checks passed
@Harry19081 Harry19081 added UX Improvements to user experience, workflow smoothness frontend-ui Frontend UI, design system, accessibility, layout, or theming labels Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend-ui Frontend UI, design system, accessibility, layout, or theming UX Improvements to user experience, workflow smoothness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants