fix(update): keep restart notice and brew upgrades clear of the live session - #174
Conversation
…session Two update-flow UX fixes reported together. - TUI: the persistent "Restart to apply" / "Update available" footer line rendered directly under the input box. It now renders as the last footer row, below the status/clock line, in both toolbar layouts, clear of the input. - Homebrew: a silent self-upgrade ran `brew upgrade` in place mid-session, where brew's cleanup can delete the in-use Cellar version the running process resolves through. The upgrade now runs with HOMEBREW_NO_INSTALL_CLEANUP and HOMEBREW_NO_AUTO_UPDATE, so the new build installs side-by-side and goes live on restart without touching the live session.
CI runners export HOMEBREW_NO_AUTO_UPDATE (and sometimes HOMEBREW_NO_INSTALL_CLEANUP), which leaked into the inherited subprocess env and made the non-brew assertions fail. Clear them up front so the test asserts the guard delta the code adds, not ambient state.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
📝 WalkthroughWalkthroughRepositions the "Restart to apply" / "Update available" footer notice to render as the final row in both standard and card toolbar layouts by relocating ChangesUpdate notice footer reflow
Homebrew self-upgrade guard
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 docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
What & why
Two update-flow UX fixes reported together.
1. Restart notice no longer crowds the prompt
The persistent "Restart to apply" / "Update available" footer line rendered directly under the input box (between the input and the status line). It now renders as the last footer row — below the status/clock line — in both toolbar layouts (
_render_bottom_toolbarand_render_card_bottom_toolbar), so it stays clear of the input area. The notice reflows in at the very bottom, leaving the input and status line visually stable when it appears._append_update_noticenow prepends its own newline and adds no trailing one (no blank bottom row), and is called last in both renderers.2. Homebrew self-upgrade can't disrupt the live session
A silent startup self-upgrade ran
brew upgradein place mid-session.brewinstalls side-by-side, but its post-upgrade cleanup can delete the in-use Cellar version that the running process resolvessys.executablethrough — risking a crash before the user restarts. The upgrade now runs withHOMEBREW_NO_INSTALL_CLEANUP=1andHOMEBREW_NO_AUTO_UPDATE=1(gated tobrewcommands in the single_run_upgrade_commandchokepoint), so the new build installs side-by-side and goes live on restart without touching the live session. The redundant implicitbrew updateis skipped (_refresh_brew_metadataalready refreshes the tap explicitly).Changes
src/pythinker_code/ui/shell/prompt.py— move notice to last footer rowsrc/pythinker_code/ui/shell/update.py— brew self-upgrade env guardstests/ui_and_conv/test_prompt_tips.py— pin new notice positiontests/ui_and_conv/test_shell_update.py— pin brew guard env (and that non-brew upgrades are untouched)CHANGELOG.md+ synceddocs/en/release-notes/changelog.md— two## UnreleasedentriesVerification
make check-pythinker-code(ruff + format + pyright + ty) — greenmake test-pythinker-code(tests+tests_e2e) — greenSummary by CodeRabbit
New Features
Bug Fixes