Repository navigation
feat(themes): add Top Bar theme, hide-until-hover placement and 5% low-usage alarm - #164
Open
articdevil03 wants to merge 1 commit into
Open
articdevil03 wants to merge 1 commit into
articdevil03 wants to merge 1 commit into
Conversation
…w-usage alarm Adds an optional built-in "Top Bar" theme: a wide, short strip docked at the top centre of a chosen monitor that stays collapsed as a small click-through tab and slides down when the cursor rests on it. One block per enabled provider, left to right, with %, a thin bar and a "Resets in" countdown; follows Windows light/dark. Theme engine (usable by any theme): an auto_hide placement option for edge-docked floating roots, handle_color, a countdown number format, data.updated.* bindings, light/dark colour expressions, alarm.* bindings and a snooze_alarm() click action. Settings > Display gains Hide until hover (Use theme setting / Enabled / Disabled), Widget display and Alarm at 5% remaining; Studio shows and can clear an active override and previews colour expressions. The 5% low-usage alarm covers each enabled provider's and account's headline windows plus Claude model caps, plays a bundled original WAV at most once a minute, keeps edge-docked surfaces revealed while a quota is low, and offers Snooze 1h on the bar and in the context menu. The Top Bar theme JSON is generated by tools/gen_top_bar.py. Also fixes a test that assumed more than a day of uptime (poller/retry_after.rs) and a clippy lint in window/taskbar_collision.rs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011HqUMQbM9NB7PuC292Sh69
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #163 (proposal and discussion).
Adds an optional Top Bar: a built-in theme that docks a wide, short usage strip at the top centre of a chosen monitor, stays collapsed as a small click-through tab, and slides down when the cursor rests on it. It also adds a 5% low-usage alarm. Both are opt-in through the theme and settings; Classic, Compact and custom taskbar/floating themes behave as before.
Theme engine (general, usable by any theme)
auto_hideplacement option for floating roots docked to a monitor's top or bottom edge: a collapsed handle, an 80 ms rest-to-open intent delay (not while the left button is held), ~250 ms slide, 0.6 s leave delay. The collapsed handle is click-through; the cursor is polled only while a hiding surface is visible (suspended behind fullscreen apps).handle_color, acountdownnumber format (<1m,14m,2h 14m,3d 4h, localized suffixes),data.updated.*bindings, light/dark colour expressions,alarm.*bindings and asnooze_alarm()click action (also listed in Studio).Top Bar theme (
src/themes/top-bar.json, generated bytools/gen_top_bar.py, which reproduces the JSON byte-for-byte from the repo root)claude.model.fablebinding. Amber at 70%, red at 90%. Follows Windows light/dark. Width grows with providers and stays within the monitor.5% low-usage alarm (on by default, can be turned off)
model.<slug>rule. Sub-quotas a poller does not surface as a headline window (e.g. Copilot metered Chat/Completions, Antigravity's non-preferred groups) are out of scope.src/assets/README.md) once per crossing, at most once a minute, silent with a "No Sounds" scheme or muted system sounds. Edge-docked surfaces stay revealed while a quota is low; a Snooze 1h button on the bar and a context-menu item let them hide again.Testing
cargo fmt --all -- --check,cargo clippy --all-targets -- -D warnings,cargo test --locked(583 passed, 0 failed, 5 ignored),cargo build --locked --release.Notes for reviewers
claude.model.fablebinding.cargo test/clippy run on this machine:poller/retry_after.rs(a test assumed the PC had been up for over a day) and a clippy lint inwindow/taskbar_collision.rs. I can move them to a separate PR.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_011HqUMQbM9NB7PuC292Sh69