feat(update): add interactive menu to /update with auto-update toggle - #134
Conversation
Make the auto-update toggle discoverable from the bare `/update` command instead of requiring the `auto` subcommand: - `/update` now opens a top-level menu — "Check for updates now" (the default, so a bare `/update` + Enter still checks immediately) or "Auto-update on startup" with its current state, which jumps to the On/Off picker. - `/update auto` with no value opens an interactive On/Off picker, cursor defaulted to the current setting, instead of only printing status. - `/update auto on|off` still sets it directly; when an external override is active the setting is read-only, so `/update auto` reports that state rather than popping a no-op picker. Update slash-command docs and add focused tests for the menu routing and the picker path.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR makes ChangesUpdate command flow
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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)
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_update_auto_slash.py`:
- Around line 147-151: Replace the private-helper monkeypatching in
test_update_auto_slash behavior tests with assertions against observable
outcomes: stop patching _prompt_update_action, _auto_update_toggle, and
_prompt_auto_update_selection directly, and instead drive the flow through
run_update_prompt, shell_slash, and the config/user-facing output so the tests
verify interactive choice boundaries, persisted settings, and visible results
rather than internal wiring.
🪄 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: b3028a3d-e3a5-48a2-813e-6f106bde3ea6
⛔ Files ignored due to path filters (1)
docs/en/reference/slash-commands.mdis excluded by!docs/**
📒 Files selected for processing (3)
CHANGELOG.mdsrc/pythinker_code/ui/shell/slash.pytests/ui_and_conv/test_update_auto_slash.py
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…helpers Address review: the /update menu and auto-update picker tests patched the private _prompt_update_action / _auto_update_toggle / _prompt_auto_update_selection helpers and asserted internal call wiring. Drive the real helpers by faking only the interactive ChoiceInput boundary (and stubbing the public run_update_prompt seam), and assert observable results — persisted/unchanged config, the update flow running or being skipped, and the picker's default cursor reflecting the current state.
Summary
Makes the auto-update toggle discoverable from the bare
/updatecommand instead of requiring a subcommand. Builds on the/update autotoggle from #133./updatenow opens a top-level menu:/update+ Enter still goes straight to the check/install flow (one keypress, no regression). "Auto-update on startup" shows the current state and jumps to the On/Off picker./update autowith no value now opens an interactive On/Off picker (cursor defaulted to the current setting) instead of only printing status./update auto on|offstill sets it directly. When an external override is active (PYTHINKER_CLI_NO_AUTO_UPDATEor a source checkout), the setting is read-only, so/update autoreports that read-only state rather than popping a no-op picker — preserving the "never a silent no-op" rule.No change to the
auto_updatedefault (still on) andrun_update_promptis untouched — this is additive UI only.Changes
src/pythinker_code/ui/shell/slash.py—update_commandroutes bare invocations through a new_prompt_update_action()menu;_auto_update_toggleopens the picker on no-args (non-override); added_prompt_auto_update_selection()reusing the existingChoiceInputwidget.tests/ui_and_conv/test_update_auto_slash.py— menu routing (check / auto / cancel) and picker path (persist + cancel-is-noop). 11 passed.CHANGELOG.md(Unreleased) +docs/en/reference/slash-commands.md.Verification
make check-pythinker-code— ruff + format + pyright clean.uv run pytest tests/ui_and_conv/test_update_auto_slash.py— 11 passed.Summary by CodeRabbit
Release Notes
New Features
/updatecommand now opens an interactive menu to choose between checking for updates or managing the auto-update toggle./update autonow supports interactive On/Off selection when run without arguments.Improvements