Fix edit-cancelled crash + add resume (r) action (0.4.1)#15
Merged
Conversation
…0 -> 0.4.1 - subscription_modal: the status Select excluded 'cancelled' (you cancel via delete), so editing an archived sub set Select.value to an option that wasn't there and raised InvalidSelectValueError on mount. Extracted _status_options(sub, lang); it now includes 'cancelled' only when the edited sub is already cancelled — fixing the crash and letting the user switch it back to active/paused from the form. - main_screen: new `r` Resume action un-cancels the highlighted sub (status -> active), a no-op otherwise. + EN/JA strings, help text, and the `n` tutorial row. - tests/test_subscription_modal.py: regression guard on _status_options. - docs (CLAUDE.md / README / docs/index.html) updated. Verified: 60 tests pass; a headless Textual pilot mounts the edit modal on the exact cancelled row from the bug report without crashing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Fix: editing a cancelled subscription crashes + add a resume action (0.4.1)
The bug
Editing an archived (cancelled) subscription crashed on open:
InvalidSelectValueError: Illegal select value 'cancelled'atsubscription_modal.pyon_mount.Root cause: the status
Select's options deliberately exclude"cancelled"(you cancel a sub via delete, not the dropdown). Buton_mountthen setsSelect.value = s.status, and for an archived sub that value ("cancelled") isn't among the options, so Textual rejects it.The fix
Extracted
_status_options(sub, lang)— it includes"cancelled"only when the sub being edited is already cancelled. New/active subs still hide it (cancellation stays a delete-flow concern), but an archived sub can now be opened, and its status switched back to active/paused right from the form.New: resume (
r)Paralleling undo (
u), a dedicatedrResume action un-cancels the highlighted sub (status →active); it's a no-op on a sub that isn't cancelled. Typical flow:vto surface the archive, highlight a dimmed cancelled row,rto bring it back. Added to the footer, thentutorial, help text, and EN/JA strings.Tests & verification
tests/test_subscription_modal.py— regression guard:_status_optionshidescancelledfor new/active subs and includes it for a cancelled one.ChatGPT Plus, HUF,status='cancelled') — no crash; the Select correctly holds'cancelled'.Bumps 0.4.0 → 0.4.1 (also so
pip install --upgrade git+…actually picks up the fix). Docs (CLAUDE.md / README / landing page) updated.🤖 Generated with Claude Code