Say how long is left, not that the window is five hours

The bar read "31% of 5h", which is the one thing about the window a
reader already knows. What decides whether to start something now is how
long what is left has to last: 80% with twenty minutes to go and 80%
with four hours to go are opposite answers, and the second number was a
screen away on the usage screen.

It now reads "31% - 2h 36m left", and the countdown is driven by a clock
the refresh loop advances rather than computed at draw time. A
percentage that comes back unchanged is an equal value, so Compose skips
the recomposition -- a "left" recomputed only when the quota happens to
move would have sat at a stale figure for hours while looking live.

A window can arrive with no reset time, so that keeps its own wording:
"reset time unknown" rather than "refresh soon", which would be a
recommendation nothing measured. Under a minute, including past the end,
is "refresh soon" -- "0m left" reads as a measurement.

The span arithmetic was already on the usage screen, so it moves into
`ResetCountdown.kt` and both callers supply their own sentence. That
screen still reads "resets in 2h 37m" and "resets in 5d 21h", checked on
the emulator alongside the bar it was not part of changing.

The fill is blue rather than the scheme's primary: the bar sits under
every session header, on a screen somebody opened to do something else,
and it reports a quantity rather than a verdict. The usage screen is
still where the same number turns yellow and then red, for a reader who
went there to be told where the limits are.

Also declares this project's resources for Dev Updater, whose
declaration schema changed in d27b5a3: `resources.ron` says ai-app keeps
its state as `ai-app`, so the Uninstall dialog offers the real
directories instead of saying it cannot tell where they are. Only the
name, because both XDG places are the conventional ones. What that
dialog's config toggle would delete includes the CA under `certs`, which
strands every phone running an APK pinned to it -- noted where somebody
would be standing when it matters.
This commit is contained in:
iris committed 2026-08-29 20:54:55 -04:00
1 parent 894180de77
commit a50d72960c
7 files changed
+126 -16

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
// This project's own resources: where ai-app keeps what it accumulates
// and what somebody configured.
//
// Structured as the body of the struct, with no outer parentheses, which
// is the house rule every RON file here follows -- `wg_app_link::format`
// is the only thing that knows it, so both this project's code and Dev
// Updater read the file the same way.
//
// Dev Updater reads the keys it understands (`name`, `data`, `config`)
// and ignores the rest, so anything else this project needs to keep in
// one place belongs here too.
// What this project calls itself for the purpose of keeping state, and
// where `~/.local/share/ai-app` and `~/.config/ai-app` come from. Not the
// crate name -- that is `ai-server`, which answers to the binary it
// produces -- and not the label, which is "AI Sessions" because that is
// what a person reads on a card.
//
// No `data` or `config` key: both are the conventional XDG places, and
// writing them out would be a second copy of what the server already
// derives from this same name.
//
// Worth knowing before using the Uninstall dialog's config toggle:
// `$XDG_CONFIG_HOME/ai-app/certs` is in there, and the CA is the one-way
// door -- deleting it strands every phone that has this server's app
// installed until the app is rebuilt against a new CA and reinstalled.
name: "ai-app",