Commit 22651a6
feat: show update-available indicator in TUI footer (#175)
* feat: show update-available indicator in TUI footer
Add a persistent, subtle upgrade indicator in both the home page and
session footers. When a newer version of Altimate Code is available,
the footer shows `current → latest · altimate upgrade` in muted/accent
colors instead of just the version number.
- Add `UpgradeIndicator` component and `getAvailableVersion` utility
- Store available version in KV on `UpdateAvailable` event for persistence
- Show indicator in both home and session footers
- Fix toast message to say `altimate upgrade` instead of `opencode upgrade`
- Add 24 tests covering version comparison, KV integration, and event flow
Closes #173
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address bot review findings for upgrade indicator
- F1: Clear KV on `Updated` event — set `update_available_version` to
current `VERSION` after autoupgrade so indicator hides immediately
- F2: Add semver comparison via `isNewer()` — prevents downgrade arrow
when user upgrades externally past the stored version
- F3: Reject empty string as invalid version in `getAvailableVersion()`
- Update tests to cover all three fixes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address code review findings for upgrade indicator
- Replace custom `isNewer` with `semver.gt()` — `semver` is already a
dependency; handles prerelease tags and rejects corrupted KV values
- Use `UPGRADE_KV_KEY` constant in `app.tsx` instead of magic string
- Add `fallback` prop to `UpgradeIndicator` — eliminates duplicate
`getAvailableVersion` call in `home.tsx` (Gemini design suggestion)
- Remove unused `UPGRADE_KV_KEY` re-export from `upgrade-indicator.tsx`
- Add conditional check before `kv.set` on `Updated` event to avoid
unnecessary file writes
- Fix tautological test, add tests for corrupted/prerelease versions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: add e2e tests for upgrade indicator lifecycle
Add 21 end-to-end tests covering the full upgrade indicator flow:
- Full lifecycle: fresh install → UpdateAvailable → indicator shown →
Updated → indicator hidden
- F1 regression: stale indicator after autoupgrade is cleared
- F2 regression: downgrade arrow prevention with `semver.gt()`
- F3 regression: empty/corrupted/non-string KV values rejected
- Semver integration: prerelease, build metadata, v-prefix handling
- Edge cases: rapid events, Updated without UpdateAvailable, same
version available as current
Uses mock KV store pattern consistent with codebase test conventions
(algorithm extraction, no Solid.js context required).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: clarify upgrade indicator wording
Change "available" to "update available" so users clearly understand
a new version upgrade is pending, not just that a version exists.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: make upgrade indicator responsive for small screens
On narrow terminals (<100 cols), hide "update available ·" text and
show only the essential: ↑ 0.6.0 altimate upgrade
Wide (100+): ↑ 0.6.0 update available · altimate upgrade
Narrow (<100): ↑ 0.6.0 altimate upgrade
Uses useTerminalDimensions() for reactive width detection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent df24e73 commit 22651a6
File tree
8 files changed
+614
-1
lines changed- packages/opencode
- src/cli/cmd/tui
- component
- routes
- session
- test/cli
- tui
8 files changed
+614
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
842 | 843 | | |
843 | 844 | | |
844 | 845 | | |
| 846 | + | |
845 | 847 | | |
846 | 848 | | |
847 | 849 | | |
848 | 850 | | |
849 | 851 | | |
850 | 852 | | |
851 | 853 | | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
852 | 860 | | |
853 | 861 | | |
854 | 862 | | |
| |||
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
155 | | - | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
| |||
0 commit comments