feat(shell): faster auto-update detection, persistent update notice, compact-terminal robot - #146
Conversation
…ottle Background startup auto-update was throttled to once per 24h, so a freshly published release could go unnoticed for up to a day after the last check. Lower the interval to 30 minutes. Also stop marking the throttle before the network call in the silent path: a transient startup error now returns FAILED and is retried on the next launch instead of suppressing updates for the whole window (mirrors the notice-only refresh path). Add a focused test pinning that the throttle is marked only after a non-FAILED run.
Below ~68 content columns the robot mark could not sit beside the welcome copy, so it was dropped entirely. Stack it centered above the copy instead, so the mark stays visible at any width that can render its Unicode glyphs. ASCII-only terminals are unchanged (no robot). The boot antenna blink now fires on the stacked logo too, still gated by the existing on-screen height guard.
|
Warning Review limit reached
More reviews will be available in 30 minutes and 51 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughTwo startup UX fixes: ChangesStartup UX: auto-update throttle and compact welcome banner
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/ui_and_conv/test_shell_welcome_info.py`:
- Around line 158-160: The assertion at line 160 checks for the Unicode glyph
"▛" but the test does not pin the ascii_glyphs_enabled() setting, causing the
test to flake when running in ASCII mode. Ensure the test deterministically uses
Unicode glyph rendering by either pinning ascii_glyphs_enabled() to return False
before the assertion, or by making the assertion conditional based on the glyph
rendering mode (checking ascii_glyphs_enabled() and asserting the appropriate
character for that mode).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 9279d6c7-37ab-4042-9012-0904ad8a39be
📒 Files selected for processing (5)
CHANGELOG.mdsrc/pythinker_code/ui/shell/__init__.pysrc/pythinker_code/ui/shell/update.pytests/ui_and_conv/test_shell_welcome_info.pytests/ui_and_conv/test_silent_auto_update.py
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
When a newer release is available the footer now renders a yellow "↑ Update available — vX · /update" line directly under the input, so the hint persists instead of only flashing as a transient toast. It renders above the separator in both the legacy and card footer layouts. The text is state-aware: after a release is installed in the background this session the cache still reports a newer version, so the line switches to the restart-to-apply message (agreeing with the install toast) instead of pointing at /update, and clears once the user restarts onto the new version. Sourced from welcome_update_target(), so it is suppressed for dismissed versions, disabled auto-update, and source checkouts. The cache read is memoized on a 5s TTL to keep it off the hot toolbar render path.
The matrix test asserts the robot mark ("▛") renders at every width but
relied on the ambient glyph mode; pin ascii_glyphs_enabled to False so the
assertion is deterministic regardless of locale/stdout encoding, matching
test_welcome_two_column_layout_when_wide.
Summary
Startup/auto-update experience fixes prompted by "auto-update doesn't sense new release tags," the welcome robot disappearing in narrow terminals, and wanting the update hint to persist.
1. Faster auto-update detection (
update.py,ui/shell/__init__.py)auto_updatedefaults to on and silently installs new releases at startup, but two gates delayed detection:AUTO_UPDATE_CHECK_INTERVAL_SECONDS), so a release published shortly after the last check went unnoticed for a full day. Lowered to 30 minutes._silent_auto_updatestamped the throttle file before the network round-trip, so an offline/slow startup burned the whole window with zero work done. It now marks only after a non-FAILEDrun — a transient error returnsFAILEDand retries next launch (mirrors_refresh_update_cache).2. Keep the welcome robot visible in compact terminals (
ui/shell/__init__.py)Below ~68 content columns the robot mark could not sit beside the welcome copy, so it was dropped entirely. It now stacks centered above the copy, staying visible at any width that can render its Unicode glyphs. ASCII-only terminals are unchanged; the boot antenna blink fires on the stacked logo too (still gated by the on-screen height guard).
3. Persistent update notice under the prompt input (
ui/shell/prompt.py,ui/shell/__init__.py)When a newer release is available the footer now renders a yellow
↑ Update available — vX · /updateline directly under the input (above the separator, in both legacy and card layouts), so the hint persists instead of only flashing as a transient toast./update, and clears once the user restarts onto the new version.welcome_update_target(), so it's suppressed for dismissed versions, disabled auto-update, and source checkouts. Cache read is memoized on a 5s TTL (mirrors the footer's git-branch TTL) to stay off the hot render path.Design notes
/releases/latest, which excludes prereleases by design. The pipeline holds each release asprerelease: trueuntil all assets upload andpromote-release.ymlpromotes it — so the exclusion is the intended "assets ready" gate, not a bug (verified vs GitHub REST docs + Context7). No endpoint/fallback change.ClientErrorfails safe. (304-not-modified is only rate-limit-free when authenticated, so the ETag cache saves bandwidth, not quota.)Tests
test_silent_update_marks_throttle_only_after_non_failed_run— throttle marked only after a non-FAILEDrun.test_welcome_compact_terminal_stacks_robot_above_copy+ matrix updated to expect the robot at all widths.test_update_notice_*— available→/update, installed-this-session→restart, smoke-failed→fallback, none-when-up-to-date, 5s TTL memo; plus_prepend_update_noticeinsert/no-op tests.make check-pythinker-code✅ (ruff + format + pyright, 0 errors); focused suites green.