Skip to content

feat(tui): show when a newer kite release exists - #15

Merged
mr-karan merged 4 commits into
mainfrom
feat/tui-update-notice
Nov 17, 2026
Merged

mr-karan merged 4 commits into
mainfrom
feat/tui-update-notice

Conversation

@mr-karan

Copy link
Copy Markdown
Member

Why

TUI users only find out about a new kite release if they run kite upgrade --check or kite doctor. The TUI now tells them.

What changed

  • Update notice. At startup a background task looks up the latest release, the same lookup upgrade --check makes. When it's newer than the running binary, the header status line shows update vX.Y.Z in the warning colour, and a toast names the command to run. Startup and sign-in never wait for the lookup, and nothing upgrades on its own.
  • Cache. The result is kept in ~/.cache/kite/update.json for 24 hours, so several open windows share one request. The toast fires once per release, and later sessions show only the header item. A failed lookup shows nothing and is not cached.
  • Package managers. When the binary runs from a Nix store or Homebrew Cellar path, the toast says to upgrade with your package manager instead of kite upgrade.
  • Opt-out. "update_check": false in tui.json, or KITE_NO_UPDATE_CHECK=1.
  • Docs. Two docs-only commits ride along. One regenerates CLI_REFERENCE.md, which missed the --iceberg-quantity help change in 2d8143d. The other adds a "Running more than one window" note to the TUI guide covering the ticker connection cap, per-window polling and unshared local state.

Reviewer notes

  • The header item is the last and lowest-priority status field, so it's the first to drop on a narrow terminal.
  • The lookup sends one unauthenticated request to github.com and no user or session data. The TUI guide says so next to the opt-out.

Verification

  • Unit tests drive the cache logic with a fake lookup:
    • a release is announced once;
    • a second window reuses the cached result;
    • the lookup repeats after a day;
    • an up-to-date or upgraded install gets no notice;
    • a failed lookup stays silent and uncached;
    • a corrupt cache file falls back to a fresh lookup.
  • Header tests check the item's text and colour, and that it drops on a narrow strip. An app test feeds the event through the real handler and checks that it toasts only when the release is announced.
  • just lint and cargo test --workspace pass locally (with a real TERM; three theme tests fail under TERM=dumb on main too).

Not checked by hand: the notice on screen in a live TUI session.

The --iceberg-quantity help text changed in 2d8143d but the generated
reference still showed the old text.
Each instance opens its own ticker connection and runs its own pollers,
and instances do not share local state. Say so, and point at the ticker
connection cap and poll_secs.
TUI users only learned about a release by running kite upgrade --check
or kite doctor. The TUI now checks GitHub in the background at startup
and, when a newer release exists, shows update vX.Y.Z in the header and
a toast naming the command to run.

The lookup is the one upgrade --check already makes. Its result is
cached in ~/.cache/kite/update.json for a day so several windows share
one request, and the toast fires once per release. A failed lookup is
silent. Installs under a Nix store or Homebrew Cellar path are told to
use their package manager. "update_check": false in tui.json or
KITE_NO_UPDATE_CHECK=1 turns it off.
From review: a failed lookup hid a newer release the cache already knew
about, a cache dated in the future stayed fresh, an unwritable cache
toasted on every launch, and the package-manager hint missed symlinked
installs that kite upgrade refuses. The hint now asks kite upgrade's own
install check, and the tests clean up their temp directories.
@mr-karan
mr-karan merged commit cd855b2 into main Nov 17, 2026
3 checks passed
@mr-karan
mr-karan deleted the feat/tui-update-notice branch November 17, 2026 07:40
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.

1 participant