tui: persist the update notice, right-aligned and concise#367
Merged
Conversation
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.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
statusslot, which a tick handler clears after 5 seconds — so it flashed at startup and disappeared. It now lives in a dedicatedApp.update_noticefield that is never tick-cleared, so it stays until the user upgrades (at which pointcached_update_notice()returnsNoneand it goes away on its own).AGENTD_NO_UPDATE_CHECK=1opt-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
statusmessages 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 --checkconsole output, which is a different context.)Tests
notice_only_when_a_newer_version_existsupdated for the new string.update_notice_renders_right_aligned_in_modeline— aTestBackendrender test asserting the notice sits at the right edge and in the right half of the modeline.cargo test -p agentd-cli: 243 passed.Where the code lives
Only touches
crates/cli→ relevant binary isagent.🤖 Generated with Claude Code