Skip to content

tui: persist the update notice, right-aligned and concise#367

Merged
edwin-zvs merged 2 commits into
mainfrom
tui-persist-update-notice
Jun 6, 2026
Merged

tui: persist the update notice, right-aligned and concise#367
edwin-zvs merged 2 commits into
mainfrom
tui-persist-update-notice

Conversation

@edwin-zvs

@edwin-zvs edwin-zvs commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Improves how the TUI surfaces the "update available" advisory. Three related changes:

1. Persist until upgrade (was: vanished after ~5s)

The notice was set through the transient status slot, which a tick handler clears after 5 seconds — so it flashed at startup and disappeared. It now lives in a dedicated App.update_notice field that is never tick-cleared, so it stays until the user upgrades (at which point cached_update_notice() returns None and it goes away on its own). AGENTD_NO_UPDATE_CHECK=1 opt-out is unaffected.

2. Right-aligned in the status bar

Rendered in its own sub-rect at the far-right edge of the modeline rather than inline, so it doesn't crowd the left-aligned modeline. Transient status messages keep their inline spot on the left, so the two coexist.

3. Concise message

Before: agentd 0.2.0 available (you have 0.1.0) — run \agent upgrade`After: ↑ agentd 0.2.0 · agent upgrade`

(The verbose form is kept for the one-off agent upgrade --check console output, which is a different context.)

Tests

  • notice_only_when_a_newer_version_exists updated for the new string.
  • New update_notice_renders_right_aligned_in_modeline — a TestBackend render test asserting the notice sits at the right edge and in the right half of the modeline.
  • Full cargo test -p agentd-cli: 243 passed.

Where the code lives

Only touches crates/cli → relevant binary is agent.

🤖 Generated with Claude Code

edwin-zvs added 2 commits June 6, 2026 06:51
The upgrade notice was pushed through the transient `status` slot, which a
tick handler clears after 5 seconds — so it flashed briefly at startup and
vanished. Give it a dedicated `update_notice` field that the modeline shows
whenever no transient status is active, so it persists until the user upgrades
(at which point `cached_update_notice()` returns None and it disappears on its
own). Transient status messages still take precedence while shown.
Render the persistent "update available" notice right-aligned at the far edge
of the modeline (its own sub-rect) instead of inline in the transient status
slot, so it no longer crowds the left-aligned modeline and transient status
messages keep their inline spot.

Shorten the message from
  "agentd 0.2.0 available (you have 0.1.0) — run `agent upgrade`"
to
  "↑ agentd 0.2.0 · agent upgrade"

Add a TestBackend render test asserting the notice sits at the right edge and
in the right half of the modeline.
@edwin-zvs edwin-zvs changed the title tui: keep the "update available" notice visible until upgrade tui: persist the update notice, right-aligned and concise Jun 6, 2026
@edwin-zvs
edwin-zvs merged commit 8224be7 into main Jun 6, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the tui-persist-update-notice branch June 6, 2026 14:06
@edwin-zvs edwin-zvs mentioned this pull request Jun 6, 2026
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