5.0 KiB
FAIL
Checked: cargo test -p ely-ui -p ely-platform passes (ely-ui 6 unit tests, ely-platform 10 + 12 + startup_panic). tests/scripts/theme.sh passes on macOS. cargo clippy --all-targets on both crates is clean. The three fixtures match themes/{tokyo-night,catppuccin-latte,white}/colors.toml in basecamp/omarchy at f45461a, so the "real palettes" claim holds. Contrast numbers below come from a probe crate outside the repo that #[path]-includes omarchy.rs and calls parse on the fixtures.
-
crates/ely-ui/src/theme/omarchy.rs:73 (and the test at :244) What is wrong:
readableandtoward_bglift text only againstbg. The test also checks only againstp.bg. The components put this text onsurface,sunken,hover,activeandselection, which are mixed towardfg, so the lifted colors drop below 4.5 there. Ely's own palettes stay at or above 4.5 on every one of those surfaces exceptselection. The TASKS line ("全部正文色达 4.5:1") and agents.md ("每个正文色拉到 4.5:1") claim more than the code does. Failing scenario: catppuccin-latte givesfg_mutedonsurface4.35,fg_subtleonsurface4.30 and onactive3.70. tokyo-night givesfg_subtleonsurface4.20 and onactive3.44. white givesfg_subtleonsunken3.98.shell::OfflineIndicator(status.rs:128,133) drawsfg_mutedonsurface, so under catppuccin-latte its label reads 4.35:1. Fix direction: lift each text token against the darkest or lightest surface it is drawn on (bg, surface, sunken, hover, active), not just bg. Extend the test to assert every text token against each of those surfaces. -
crates/ely-ui/src/theme/omarchy.rs:75-84 What is wrong: only the named keys (
red,green,blue, …,selection) are read. Omarchy v4's owncolors.tomlformat also carriescolor0..color15,purple/bright_purpleandselection_background. Omarchy's resolver (bin/omarchy-theme-color) aliases red→color1, green→color2, yellow→color3, blue→color4, magenta→color5/purple, cyan→color6, and selection→selection_background.omarchy-theme-colors-from-alacrittywrites onlyaccent,selection,background,foregroundandcolor0..color15. Every theme without its owncolors.toml(for example a user or git-installed theme that shipsalacritty.toml) therefore reaches Ely in that form. Each missing hue then silently becomes Ely's default throughunwrap_or(p.danger)and the like, with no log line. That is a default value hiding missing data (rule 2), and the theme is not synced. Failing scenario: parse a generated file (accent,selection,background,foreground,color0..color7from Tokyo Night). The probe showspalette.danger == Palette::dark(false).dangerandsuccessequal to Ely's default. Syntaxkeywordcomes from Ely's chart, not the theme'scolor5. Danger, success, warning, info, chart, ANSI and syntax colors all show Ely's palette under an Omarchy theme. Fix direction: resolve keys with Omarchy's alias cascade (named key, thencolorN, thenpurple/selection_background). Where a key is still missing, log it rather than substituting silently, and add a fixture in the generatedcolorNform. -
crates/ely-ui/src/theme/mod.rs:37 What is wrong:
ELY_OMARCHY_SYNCtreats every value except"0"as on, without a warning.ELY_APPEARANCE(:32) andELY_REDUCE_MOTION(accessibility.rs:20) both warn on an invalid value. This is a silent fallback on a documented 0/1 switch. Failing scenario:ELY_OMARCHY_SYNC=falseoroffleaves Omarchy sync on, and the log does not say the value was ignored. Fix direction: match"0","1"and unset explicitly, and warn on anything else, as the other two switches do. -
crates/ely-ui/src/theme/watch.rs:40 What is wrong: when the live theme directory has no
colors.toml,reloadlogs at debug and keeps the previousOmarchyState. The app keeps showing the theme the user just left. Failing scenario: the app runs under tokyo-night, and the user runsomarchy-theme-setwith a user theme that has nocolors.tomland noalacritty.toml, so Omarchy writes none.theme/is swapped andtheme.namechanges, but Ely stays on the tokyo-night palette. Nothing above debug level records this. Fix direction: onOk(None)after a change, clearOmarchyState, re-apply (Ely's palette or the chosen appearance), and log at info. -
crates/ely-platform/src/dirs.rs:19-21 What is wrong: the default Omarchy directory comes from
BaseDirs::state_dir(), which honours$XDG_STATE_HOME. Omarchy hardcodes$HOME/.local/state/omarchy/current(bin/omarchy-theme-set:CURRENT_THEME_PATH="$HOME/.local/state/omarchy/current/theme"). Failing scenario: on an Omarchy machine withXDG_STATE_HOME=$HOME/.state, Ely looks in~/.state/omarchy/current, logs "no Omarchy on this machine", and never syncs. Fix direction: build the path from the home directory as.local/state/omarchy/currentto match Omarchy, withELY_OMARCHY_DIRstill taking precedence.