Commit Graph
9 Commits
Author SHA1 Message Date
tiennm99 d583e173d2 fix(ui): resize on Ctrl+wheel only after 100 px of gesture travel
A new gesture, including one started by a change of direction, used to
send a full step at once, so a few px of reversed jitter in a touchpad
pinch shrank and grew the bubble back and forth. A new gesture now starts
from its own travel and steps only once that reaches 100 px.
2026-10-23 03:37:38 +07:00
tiennm99 a4f8011b26 fix(ui): accumulate Ctrl+wheel travel before resizing the bubble
Every wheel event used to send one resize step, so a touchpad's stream
of small deltas jumped straight to the smallest or largest size. Wheel
travel is now normalised to px and accumulated: the first event of a
gesture gives one step, then each further 100 px gives another. A
200 ms pause or a change of direction starts a new gesture, so one
mouse notch still resizes by exactly one step.
2026-10-23 03:25:37 +07:00
tiennm99 c4ad23236e fix(ui): reserve the weekly percent column at its semibold weight
The tail percent is drawn at weight 600 but its column was measured at
400, so "100%" was clipped at larger bubble sizes. The layout now asks
the measure callback for the weight the text is drawn in.
2026-10-23 03:25:28 +07:00
tiennm99 6afd603d5e refactor: rename the project to usage-monitor
Rename the crate, binary, product name, identifier, settings folder, log
file, autostart entry, user agent, updater endpoint and release assets.
Legacy Win32 clients still update: they fall back to the first .exe asset,
and the legacy rollback workflow reads the package name from the ref it
builds. Upgraded installs start with default settings.
2026-10-22 16:59:32 +07:00
tiennm99 2180efaf85 feat: draw the details panel from the payload and suppress webview shortcuts 2026-10-21 15:29:26 +07:00
tiennm99 094b6bdcb0 feat: draw the bubble from the payload in HTML, CSS and SVG
The stadium pill holds SVG usage and time rings, pill-shaped tail bars and
the payload's texts, laid out in physical px from canvasW, canvasH and dpi
with the GDI bubble's formulas (ui/layout.js, unit-tested). The palette is
CSS custom properties per theme; fills come from Rust. The ring arc, weekly
fill and weekly percent pulse at 95% and above on an 80 ms step, and the
time progress advances every minute.

Only the pill takes pointer input, so the corners are dead. A press that
moves 3 physical px starts an OS drag after arming the move end; an earlier
release is a click. Right-click opens the native menu and Ctrl+wheel resizes.
2026-10-21 14:40:18 +07:00
tiennm99 f2063bda4f feat: add tray icons, the native context menu, notifications and start at login
Each enabled live provider gets a tray icon with the usage badge, a four-line tooltip and the context menu; a left click toggles the widget. Menus are rebuilt from state after every click so native check marks stay right, and a bubble right-click pops the same menu.

Alerts go through the notification plugin. On Windows the app id is registered under HKCU with a name and icon first, so a portable exe without a Start-menu shortcut can show toasts.

Start at login uses the autostart plugin under the Run value name earlier releases wrote, so an existing entry is picked up as is. On Linux the tray is skipped when no AppIndicator library loads instead of aborting.
2026-10-21 13:45:59 +07:00
tiennm99 83f60d1c1c feat: run the app on a Tauri runtime with shared state and commands
run() keeps the pre-builder order: diagnostic log, the Windows WebView2 guard
(a message box with the download link, then exit 0), the --wait-pid wait
capped at 15 s, GDK_BACKEND=x11 under Wayland when Xwayland is present, and
the single-instance plugin registered first with a no-op callback.

setup() loads the settings, drops positions on missing monitors, reads the
theme, cleans up after earlier updates, starts the scheduler and polls. The
state sits behind one mutex reached only through with_state, so no Tauri call
runs under the lock. The poll worker keeps the in-flight gate, applies the
results, runs the CLI credential refresh and pushes bubble payloads from the
main thread.

Commands: get_bubble_state, get_strings, log_js and bubble_ready. Bubble
windows ignore close requests; Restart saves the settings and exits only once
the new instance spawned. The scaffold window now renders its payload as JSON.

The Win32 app module is removed.
2026-10-21 13:20:15 +07:00
tiennm99 f64d81e6a1 build: scaffold the Tauri v2 crate
Turn the package into a lib plus thin bin on Tauri v2 with a root-level
tauri.conf.json, capabilities, generated icons (keeping the hand-tuned
icon.ico) and a placeholder bubble page. The Win32 modules leave the
module tree until each one is ported; their sources stay on disk.

tauri-build now embeds the icon, a VERSIONINFO from the Cargo version and
a PerMonitorV2 manifest, replacing res/icon.rc and its stale 0.1.0.
2026-10-21 11:45:14 +07:00