config: warn on clamped opacity and scroll multiplier #159

Merged
natsukium merged 1 commit from fix/config-clamp-warnings-143 into main 2026-09-06 13:05:34 +09:00
Owner

Fixes #143.

window.opacity and mouse.scroll_multiplier were clamped silently at
their use sites, so felis config check passed on files whose values the
client would not honor. Both now emit a value warning naming the clamped
result, matching the two rows the reference table already advertised as
load-stage warnings. scroll_multiplier = nan previously zeroed every
notch (f64::clamp passes NaN through); it now falls back to the default,
as clamped_opacity already did for opacity.

The "must be a TOML float" claim about font.size_px was false — toml
deserializes an integer into f32, and size_px = 14 has always loaded —
so that wording is removed and tests pin both spellings as one value
through config check and show-effective.

Doc cascade: docs/reference/config.md (clamp/warning rows, the
theme.palette.indexed string-key reason), docs/how-to/install.md,
nix/hm-module.nix, .agents/skills/add-config-key/SKILL.md,
crates/felis-client-core/felis-config.schema.json (regenerated), and a
CHANGELOG.md entry.

Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high

Deferred

  • just skill-check cannot run in this environment: yq is absent from
    PATH, so scripts/skill_check.sh fails on untouched main as well —
    an environment gap, not a repo defect.
Fixes #143. `window.opacity` and `mouse.scroll_multiplier` were clamped silently at their use sites, so `felis config check` passed on files whose values the client would not honor. Both now emit a `value` warning naming the clamped result, matching the two rows the reference table already advertised as load-stage warnings. `scroll_multiplier = nan` previously zeroed every notch (`f64::clamp` passes NaN through); it now falls back to the default, as `clamped_opacity` already did for opacity. The "must be a TOML float" claim about `font.size_px` was false — `toml` deserializes an integer into `f32`, and `size_px = 14` has always loaded — so that wording is removed and tests pin both spellings as one value through `config check` and `show-effective`. Doc cascade: `docs/reference/config.md` (clamp/warning rows, the `theme.palette.indexed` string-key reason), `docs/how-to/install.md`, `nix/hm-module.nix`, `.agents/skills/add-config-key/SKILL.md`, `crates/felis-client-core/felis-config.schema.json` (regenerated), and a `CHANGELOG.md` entry. Verified: just check green (fmt, clippy, nextest, deny, proto-compat); reviewed by pi luna + pi sol; docs proofread by Gemini gemini-3.8-flash-high ## Deferred - `just skill-check` cannot run in this environment: `yq` is absent from PATH, so `scripts/skill_check.sh` fails on untouched `main` as well — an environment gap, not a repo defect.
config: warn on clamped opacity and scroll multiplier
Some checks failed
bench / Criterion full-suite snapshot (pull_request) Has been skipped
fuzz / cargo fuzz nightly long-run (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 49s
bench / Criterion regression gate (pull_request) Failing after 2m14s
fuzz / cargo fuzz smoke (per target) (pull_request) Successful in 1m19s
pr / nix flake check (pull_request) Successful in 27s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m39s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 53s
windows / cargo nextest (Windows) (pull_request) Successful in 6m45s
pr / publish felis (x86_64-linux) (pull_request) Has been skipped
windows / cargo clippy (Windows cross) (pull_request) Successful in 15s
windows / frontend smoke (Windows) (pull_request) Successful in 1m52s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
pr / wire schema is compatible with the base (pull_request) Successful in 8s
76b4b132b4
`window.opacity` and `mouse.scroll_multiplier` were repaired silently
where they were used, so `felis config check` passed on a file whose
values the client would not honor — the one row the reference table
already promised as a load-stage clamp. Both now report a `value`
warning naming the clamped result, so the two rows the table calls
load-stage warnings are warnings the validator actually emits.

The band, not the size of the repair, decides whether a value is
reported: a value a single ULP outside a bound clamps just as much as
one far outside it, and its gap to the bound sits below `f64::EPSILON`.

`f64::clamp` passes NaN through and the wheel handler multiplies by the
result, so `scroll_multiplier = nan` zeroed every notch; it now falls
back to the default the way `clamped_opacity` treats NaN as opaque.

The "must be a TOML float" claim carried by the field docs, the
install guide, the home-manager option and the config-key skill is
false — `toml` deserializes an integer into `f32` — and `size_px = 14`
has always loaded, so the wording goes and tests pin the two spellings
as one value through `config check` and `show-effective`.
`theme.palette.indexed` keeps string keys, with the reason recorded
where a reader meets the key: TOML has no integer keys, so `indexed.16`
and `indexed."16"` are one entry.

Refs #143
natsukium deleted branch fix/config-clamp-warnings-143 2026-09-06 13:05:34 +09:00
Sign in to join this conversation.
No description provided.