Skip to content

fix(appearance): follow-ups on imported themes from the #3547 review - #3588

Merged
devswha merged 1 commit into
mainfrom
fix/theme-file-followups
Nov 10, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/theme-file-followups

Conversation

@devswha

@devswha devswha commented Nov 10, 2026

Copy link
Copy Markdown
Owner

What

The five LOW findings of the merge pass's last review of #3547 (at 976e95e), which that PR left for a follow-up so its head stayed merge-only. All of it is the imported-theme feature merged in 68f1fa9 and not yet released, so there is no new changelog fragment: changelog.d/theme-files.md still describes it.

Change

Finding Resolution
An imported theme's filled button dropped under 4.5:1 on hover (3.45:1 in the reported file, 20% of random imports) primary-text is fitted against the fill and the hover fill together. Where no color reads on both, it keeps the fill and primary-hover takes a step the text does read on: toward the background instead of the text, or none. The derived-theme tests now hold primary-text on primary-hover to 4.5:1 for every palette. The built-in themes are not touched, and the pair is not added to CONTRAST_PAIRS, which several of them would fail.
cleanName kept U+2800, and stripped ZWJ, ZWNJ and VS16 from names that need them A name is kept as its file wrote it: U+200C, U+200D and U+FE0F stay, so an emoji sequence, an emoji-style sign and Persian and Indic words draw as written. Every other character that draws nothing still goes, U+2800 with them. Names are compared on a folded key (nameKey: everything unseen removed, NFC), so two that look the same are still one theme on import. A name of only joiners or blanks is no name. Cleaning a kept name changes nothing; tested.
Two imported themes of one name drew two cards with the same label Such a theme says its sides on its card and on its Remove button (Mine · Dark, Mine · Dark · Light), as the list beside them already did. One label function for both.
A Base16 YAML file with quoted keys was refused (as invalid JSON with double quotes) The line reader strips one pair of matching quotes from a key. A nested quoted name is still not the scheme's.
A two-sided YAML was refused as "No theme was found" Its own refusal, two-sides: "That file holds more than one side. A YAML scheme is one side: write a dark and a light side as one JSON file." (en, ko, ja, zh).

Left as the report said it could stay: a full list still refuses an edit that drops a side, with the message that says to remove one first.

Validation

Ran, on 19e1866 (branched from origin/main at 9243bc3):

  • bun run check fast: workflow syntax, generated types, generated themes, typecheck, build, unit tests (14,779 pass, 0 fail).
  • bun scripts/theme-file-demo-regression.ts at 390 and 1440 px, dark and light, with two new steps: a second "Lamplight" with other sides is its own card and both say their sides, and a two-sided YAML is refused with its reason.

Skipped:

  • The other browser regressions. This changes the file reader, the name handling, one derived color and two labels; CI runs them all.
  • bun run check full: no server route or herdr call changed.
  • No run on a phone or a Mac.

🤖 Generated with Claude Code

- The filled button's text reads on its fill and on the fill under the
  pointer. Fitted to the resting fill alone it could drop to 3.4:1 on hover;
  where no colour reads on both, the hover takes a step the text does read on.
- A theme's name is kept as its file wrote it: the joiners and the emoji
  selector that an emoji sequence and Persian and Indic words need are no
  longer stripped. Names are compared without them (nameKey), so two that look
  the same are still one theme on import. The blank Braille cell is dropped.
- Two imported themes of one name say their sides on their cards and their
  Remove buttons, as the list beside them already did.
- A YAML key may be quoted, as a value may.
- YAML that holds two sides is refused with that reason, not as a file in
  which no theme was found.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Imported themes with matching names are distinguished by their available sides, and visually equivalent names are matched consistently.
  • Bug Fixes
    • Theme imports now provide clearer errors for files containing multiple sides or duplicate colors.
    • Filled-button text remains readable on both the resting and hover colors.
  • Documentation
    • Theme-file guidance now covers name handling, side labels, button readability, and import errors.

This change updates theme-name normalization and matching, YAML theme-file parsing and error reporting, labels for same-name imported themes, and primary-button contrast derivation. It also updates related tests, regression coverage, translations, and documentation.

Changes: Theme file import and display

Layer / File(s) Summary
Theme name normalization and matching
src/lib/customThemes.ts, src/lib/customThemes.test.ts
Theme names retain selected joiners and emoji selectors. Comparison keys normalize names and ignore invisible characters. Import matching uses those keys while retaining the same-sides requirement.
YAML scheme parsing and refusal
src/lib/customThemes.ts, src/lib/customThemes.test.ts, src/components/ThemeFiles.tsx, src/lib/i18n/settings-layout.*.ts, scripts/theme-file-demo-regression.ts, docs/themes.md
YAML parsing recognizes quoted keys and top-level metadata. Multi-side YAML input and duplicate color keys use the two-sides error. Error messages, translations, tests, and regression coverage reflect the refusal behavior.
Imported theme labels
src/components/ThemeFiles.tsx, src/components/SettingsDialog.tsx, scripts/theme-file-demo-regression.ts, docs/themes.md
Theme cards and Remove controls show available sides when imported themes have matching normalized names. The settings dialog uses the same label. Regression coverage checks importing and removing a same-name, dark-only theme.

Primary-button contrast

Layer / File(s) Summary
Primary-button text and hover derivation
src/lib/themeDerive.ts, src/lib/themeDerive.test.ts, docs/themes.md
Primary text and hover fills are derived to meet the configured contrast floor where possible. Tests check contrast on resting and hover fills.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related PRs

  • devswha/ovis#3547: Adds theme-file import, parsing, storage, and selection behavior, which overlaps with the theme import and parsing changes here.
Merge Risk: Minimal · up to 19e18

The reviewed changes have no confirmed issue that should block merging after normal checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title clearly identifies follow-up fixes for imported themes from the #3547 review.
Description check Passed The description explains the problems and resulting behavior, and lists validation commands, results, and skipped checks.
Docstring Coverage Passed Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentati…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 90.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 10 functions across 10 files. (1 skipped: 1 unsupported.)

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9258726 and 19e1866.

Files selected for processing: 11

  • docs/themes.md
  • scripts/theme-file-demo-regression.ts
  • src/components/SettingsDialog.tsx
  • src/components/ThemeFiles.tsx
  • src/lib/customThemes.test.ts
  • src/lib/customThemes.ts
  • src/lib/i18n/settings-layout.ja.ts
  • src/lib/i18n/settings-layout.ko.ts
  • src/lib/i18n/settings-layout.zh.ts
  • src/lib/themeDerive.test.ts
  • src/lib/themeDerive.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.

@devswha

devswha commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Local merge gate: PASS

Local merge gate: PASS #3588 merge=69b75d5052a7 head=19e1866b26a8 main=62a5192c0817 on herdr-ci-runner:local on devswha-ThinkStation-P620 CPUs 64-127 in 644s, reruns=3

The Linux suites of the required checks (Fast checks, Integration and browser), run on main 62a5192 with this PR's head 19e1866 merged in (local merge 69b75d5052a7, not pushed), as groups side by side in the self-hosted CI runner image on herdr-ci-runner:local on devswha-ThinkStation-P620 CPUs 64-127 (17% busy before the start, host load 56.65; shards=4 unit_workers=8 browser_main_workers=2 browser_other_workers=16). Scope: full. Native Windows install and the macOS checks are not part of this gate.

Step Command Result Seconds Counts
fast-install bun install --frozen-lockfile pass 0 -
release-guards bun scripts/release-guards.ts --base 62a5192c0817 pass 0 -
fast bun run check fast pass 229 tests 14795 pass / 0 fail; check steps 6 ok / 0 failed
integration-install bun install --frozen-lockfile pass 0 -
integration bun run check integration pass 236 tests 1386 pass / 0 fail; check steps 3 ok / 0 failed
browser-main-install bun install --frozen-lockfile pass 0 -
browser-main-build bun run build pass 15 -
browser-main BROWSER_SCRIPTS=ui-regression,ui-contexts-regression bun run check run -- bun scripts/ci-browser-parallel.ts pass 438 browser scripts 2/2 passed
browser-other-install bun install --frozen-lockfile pass 0 -
browser-other-build bun run build && bun run build:shell pass 20 -
browser-other BROWSER_EXCLUDE=<those two> bun run check run -- bun scripts/ci-browser-parallel.ts pass 614 browser scripts 202/202 passed

Reruns:

  • browser scripts/sidebar-filter-demo-regression.ts failed, then passed on its automatic second run
  • browser scripts/palette-machines-demo-regression.ts failed, then passed on its automatic second run
  • browser scripts/relay-e2e-regression.ts failed, then passed on its automatic second run

Total 644s.

@devswha
devswha merged commit 8ffa66a into main Nov 10, 2026
13 checks passed
@devswha
devswha deleted the fix/theme-file-followups branch November 10, 2026 13:19
@devswha

devswha commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 19e1866b26a8 as 8ffa66ade983 on the local merge gate, with no unresolved review threads.

Reviewer Verdict Note
claude CLEAR
codex CLEAR

Both reviewers CLEAR (Claude Opus 5.5, Codex Terra); follow-up to #3547 (unreleased feature). Contrast held on 16,000 random and 184,880 adversarial imports (lowest 4.50 at rest and on hover); built-in themes byte-identical. Left as known, none in a release: the two-sides refusal also fires for a non-theme file with a top-level dark:/light: line; broken JSON that does not start with a brace goes through the YAML reader; names differing only by joiners or the emoji selector are one name (same as before); a main-built test app's list with U+2800 in a name is not taken by this build.

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