fix: preserve episode tracker after tracking updates #2

Merged
exler merged 1 commit from fix/episode-tracker-status-update into main 2026-09-13 10:29:40 +02:00
Collaborator

Root cause

The HTMX tracking form re-rendered entities_detail.html after a status, rating, or notes update with only object and tracking_obj. For Shows, the episode tracker also requires episode_grid and selected_season, leaving Alpine's x-data invalid until a full refresh.

Fix

  • Add shared entity_detail_context() for all detail renders.
  • Use it from the normal entity-detail page, valid/invalid tracking form responses, and delete responses.
  • Preserve the default useful season after an update, skipping completed seasons and specials when possible.

Validation

  • manage.py test tracking.tests — 25 tests passed
  • manage.py check
  • manage.py makemigrations --check --dry-run
  • Ruff for changed modules
  • git diff --check

Regression coverage

A new test posts a Show status update and asserts that the returned HTMX response contains a valid episode tracker, populated grid, and Alpine selected-season value.

## Root cause The HTMX tracking form re-rendered `entities_detail.html` after a status, rating, or notes update with only `object` and `tracking_obj`. For Shows, the episode tracker also requires `episode_grid` and `selected_season`, leaving Alpine's `x-data` invalid until a full refresh. ## Fix - Add shared `entity_detail_context()` for all detail renders. - Use it from the normal entity-detail page, valid/invalid tracking form responses, and delete responses. - Preserve the default useful season after an update, skipping completed seasons and specials when possible. ## Validation - `manage.py test tracking.tests` — 25 tests passed - `manage.py check` - `manage.py makemigrations --check --dry-run` - Ruff for changed modules - `git diff --check` ## Regression coverage A new test posts a Show status update and asserts that the returned HTMX response contains a valid episode tracker, populated grid, and Alpine selected-season value.
fix: preserve episode tracker after tracking updates
All checks were successful
Push Docker Image / push (push) Successful in -18s
1902f67d94
exler approved these changes 2026-09-13 10:29:32 +02:00
exler merged commit 1902f67d94 into main 2026-09-13 10:29:40 +02:00
exler deleted branch fix/episode-tracker-status-update 2026-09-13 10:29:40 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
exler/dome!2
No description provided.