Skip to content

fix(als-brightness): center slider windows and ship the tuned node defaults - #988

Merged
ItsLemmy merged 1 commit into
noctalia-dev:mainfrom
ZhangDM-520:fix/als-brightness-centered-slider-windows
Oct 11, 2026
Merged

ItsLemmy merged 1 commit into
noctalia-dev:mainfrom
ZhangDM-520:fix/als-brightness-centered-slider-windows

Conversation

@ZhangDM-520

Copy link
Copy Markdown
Contributor

Plugin

  • Id: zhangdm/als-brightness
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

Fixes the threshold sliders' calibration and adopts the maintainer's tuned curve as the shipped default (0.5.0 → 0.6.0):

  • Slider windows are now centered on their default. The old [d/3, 3d] window parked the default at 25 % of the linear track, which read as a mis-calibrated slider. Every window is now [0, 2·d] (brightness) / d ± 500 (temperature), so the value shown at rest sits at the exact midpoint of the track — with one documented exception: node 1 defaults to 0, which cannot be centered on a non-negative axis (thr_brightness_01 gets [0, 2]).
  • New shipped node positions (the maintainer's hand-tuned values, 2026-10): brightness raw counts 0, 1, 3, 10, 33, 61, 560, 1680, 4800, 14200; temperature 2000 … 6000. The fixed outputs are unchanged (20.8 % … 100 %, 5100 … 6500 K), so the curve's shape is the same and only where each step applies moves. A fresh install now behaves like the maintainer's tuned machine.
  • The 16384 sensor-ceiling cap on slider windows is dropped: readings above the sensor's 16383 ceiling are unreachable, so a threshold up there is inert — where a node sits is the owner's judgement.
  • A drift-check property pins the requirement: all 20 sliders assert default == (min + max) / 2, with the thr_brightness_01 exception named in the test.

External dependencies

  • noctalia (the manifest dependencies entry): unchanged from 0.5.0 — short-lived noctalia msg commands (keyboard-backlight-set, brightness-set, config-reload, status) via an argv table. No network. This change touches no additional processes.

Every filesystem write, accounted: unchanged from 0.5.0 — profile.json and als-brightness.log in the plugin data dir, and (with colortemp on) the night-light settings.toml text splice. This change writes nothing new.

Every spawned process, accounted: the four noctalia msg commands above; nothing else.

Testing

  • Tested on Niri

  • Tested on Hyprland

  • Tested on Sway

  • Tested on another compositor:

  • Noctalia version tested against: v5.2.1

  • Plugin API level: 24

  • Offline gate: 1344 checks across 10 suites, 0 failures (was 1303 — the curve and settings-spec suites grew for the rebaseline), run with ./run-tests.sh. The settings-surface drift check (manifest rows, translations and code constants must agree) is green at 66 rows.

  • Drift-check property added: every slider's default is asserted to sit at the exact midpoint of [min, max], with thr_brightness_01 (default 0) named as the single exception.

  • Validated with this repo's CI validator: validate-plugins.py reports no errors for als-brightness/.

  • The maintainer's machine carries these values as settings overrides today; the sliders were exercised there while hand-tuning them, and the screenshots in the issue thread show the exact values shipped here.

Screenshots / Videos

None: this update changes slider ranges and defaults in the existing settings sheet — no new visual surface. (Settings-page screenshots were shared with the maintainer during development.)

Checklist

Ready-for-review requirement: Every box in this section must be checked. If any statement is not true, keep the pull request as Draft. An explanation does not replace a required check.

  • The directory name matches the part of id after the / in plugin.toml exactly.
  • It ships plugin.toml, README.md, thumbnail.webp, and translations/en.json.
  • README.md follows the
    README template, documents
    every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • thumbnail.webp is present and relevant; for a new plugin I created it with the thumbnail generator, and for an update I regenerated it with the generator if the visual identity or user-facing appearance changed.
    (Unchanged: the card identity did not change — this update alters slider ranges/defaults in the settings sheet.)
  • version follows semver and is bumped in this PR; plugin_api is the oldest API level this plugin requires.
  • Every non-English translation in this PR uses a locale supported by Noctalia core, and I can read, write, and
    understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
    (No translation files change in this PR.)
  • I did not edit catalog.toml; CI generates it.
  • This PR touches exactly one plugin directory.

Code review attestation

Plugins run as trusted, unsandboxed Luau in the user's session. Confirm:
Ready-for-review requirement: Every attestation below must be checked.

  • The code is readable and not obfuscated, minified, or generated.
  • It does not download and execute remote code.
  • Every network call, filesystem write, and spawned process is something the description above accounts for.
  • I have the right to publish this code under the license declared in plugin.toml.
    (The maintainer is the plugin's author; MIT as declared.)

…faults

The threshold sliders' windows were anchored on the default asymmetrically
([d/3, 3d] parked the default at 25% of the linear track), so even unedited
sliders read as mis-calibrated. Every window is now centered on its default:
[0, 2d] for brightness (d=0 gets [0, 2], the one un-centerable exception),
d +/- 500 for temperature. The 16384 sensor-ceiling cap is dropped — readings
above 16383 are unreachable, so a threshold up there is inert.

The shipped node positions become the maintainer's hand-tuned values
(brightness 0, 1, 3, 10, 33, 61, 560, 1680, 4800, 14200; temperature
2000-6000); the fixed outputs are unchanged. A drift-check property pins
default == (min+max)/2 across all 20 sliders.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ItsLemmy
ItsLemmy merged commit 162bbb0 into noctalia-dev:main Oct 11, 2026
3 checks passed
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.

2 participants