Skip to content

Fix edit-cancelled crash + add resume (r) action (0.4.1)#15

Merged
kenrinzero merged 1 commit into
mainfrom
claude/edit-cancelled-resume
May 30, 2026
Merged

Fix edit-cancelled crash + add resume (r) action (0.4.1)#15
kenrinzero merged 1 commit into
mainfrom
claude/edit-cancelled-resume

Conversation

@kenrinzero

Copy link
Copy Markdown
Owner

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' at subscription_modal.py on_mount.

Root cause: the status Select's options deliberately exclude "cancelled" (you cancel a sub via delete, not the dropdown). But on_mount then sets Select.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 dedicated r Resume action un-cancels the highlighted sub (status → active); it's a no-op on a sub that isn't cancelled. Typical flow: v to surface the archive, highlight a dimmed cancelled row, r to bring it back. Added to the footer, the n tutorial, help text, and EN/JA strings.

Tests & verification

  • tests/test_subscription_modal.py — regression guard: _status_options hides cancelled for new/active subs and includes it for a cancelled one.
  • 60 tests pass (was 57); compile + i18n parity clean.
  • A headless Textual pilot mounts the edit modal on the exact cancelled row from the bug report (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

…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>
@kenrinzero kenrinzero merged commit 7d25c42 into main May 30, 2026
4 checks passed
@kenrinzero kenrinzero deleted the claude/edit-cancelled-resume branch May 30, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant