Skip to content

feat: unread badges in the rail (ADR-0020, Proposed) - #45

Merged
bketelsen merged 3 commits into
mainfrom
irulan/rail-badges
Nov 3, 2026
Merged

bketelsen merged 3 commits into
mainfrom
irulan/rail-badges

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What

Unread counts on the rail, lodge's side only (night shift 2026-11-02, line 10; Brian's pick, T721a).

  • ADR-0020 (Proposed): an app reports badge, a whole number from 0, in the /health answer lodge already polls. Merging this PR accepts the ADR; a follow-up docs PR then sets its Status to Accepted.
  • App contract (additive, major 1): the optional badge member, the app's count and never a caller's. lodge reads it only from an ok answer, ignores a bad value, caps it at 99999, and never changes the app's state for it.
  • /lodge/apps: each app gets badge (0 when none).
  • Shell: a count on the rail button and in the switcher row (99+ above 99), with , N unread in the accessible name and tooltip. The narrow bar shows the sum of the other apps' counts. The home-screen icon gets the total through navigator.setAppBadge / clearAppBadge, only when it changes, where the browser has them.
  • Kit: lodgeapp.Health.Badge (badge, omitted at 0); kittest refuses a negative badge.
  • Dev: lodge-fakeapp --badge N; dev/e2e.sh gives app one a count of 3.

After merge

  • The kit changes. Brian must tag a kit release (proposed kit/v0.4.0, an additive minor) before any app can set badge. The app PRs (frostmail first, then frostread) follow in PRs of their own, after the tag.
  • No client or UI package change. lodge's own release (make bump) and the sysext follow as usual.

Checks

  • make check: pass (Go, both modules, the e2e tag, repocheck on the docs).
  • The shell's tests run in CI (make shell-check).

Coder model: deepseek/deepseek-flash (code and tests). ADR and docs: Irulan (claude-opus-5.5).

Cross-review

  • Reviewer openai/gpt-6.1-sol; coder deepseek/deepseek-flash; ADR, docs and the F3 fix by Irulan (claude-opus-5.5).
  • Initial review (2 batches, all 25 files) at 2651b15: F1 (a fraction that a float rounds to a whole number became a count) and F2 (switcher rows had no count tooltip), both blocking, both fixed in 7921a81.
  • Re-review 1 at 7921a81: F3 (a positive out-of-range exponent on a fraction gave 0, not the cap), blocking, fixed in c746620.
  • Re-review 2 at c746620: Ready, Blocking: none. Base 7ec9bca.

All CI jobs pass at c746620.

An app may add `badge`, a whole number from 0, to its /health answer.
lodge reads it with the state it already polls (only from an up answer,
leniently, capped at 99999), and /lodge/apps carries it. The shell draws
the count on the rail button, in the switcher row and, on the narrow bar,
as the sum of the other apps' counts. It sets the home-screen icon's
count with navigator.setAppBadge when the total changes.

The kit's lodgeapp.Health gains Badge (omitted at 0), and kittest refuses
a negative badge. The development fake app takes --badge, and dev/e2e.sh
gives app one a count of 3.

Docs: ADR-0020 (Proposed), app-contract.md, lodge-http.md, shell.md
(Badges), the overview, the roadmap's later ideas and the index.
…oss-review)

badge() reads the JSON number's text, so no float rounding turns a
fraction into a count, and an exponent beyond a million cannot overflow
the shift. A switcher row with a count sets title as well as aria-label.
A positive exponent past the clamp caps the count before the fraction
check, so 1.5e1000001 is 99999, not 0.
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 3, 2026
@bketelsen
bketelsen merged commit 58cd0c5 into main Nov 3, 2026
7 checks passed
@bketelsen
bketelsen deleted the irulan/rail-badges branch November 3, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants