✨ Add dynamic dirty-state tracking to preferences save bar (#796) - #799
Merged
Conversation
added 2 commits
August 16, 2026 00:23
* Replace static unsaved changes copy with dynamic dirty tracking component * Add accessible theme status tokens and live-region announcements * Add regression test coverage for save bar rendering and accessibility Fixes #796
* Wait for episode save HTTP response before page reload and assertions * Prevent flaky failures under parallel test execution in CI
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.
Summary
Fixes #796.
This pull request fixes the preferences save bar which previously displayed a false "Unsaved changes" warning when the form was unmodified. It also resolves a race condition in the season progress integration test.
Post-Mortem 1: Preferences Action Bar False Dirty State (#796)
/settings/preferences, the page immediately shows "Unsaved changes. You have made changes to your preferences." before any user edits.src/templates/users/preferences.html. It had no client-side dirty-state logic.formDirtyTracker) that dynamically updates the save bar between clean and dirty states.Post-Mortem 2: Season Progress Integration Test Race Condition
test_season_progress_editinsrc/app/tests/test_integration.pyoccasionally failed to find the updated episode tracking button locator after reloading.with self.page.expect_request(...)context manager to wait for the HTTP response before asserting and reloading.Changes Made
src/templates/users/components/form_save_bar.html:isDirtystate comparing live inputs with initial values.<div aria-live="polite" aria-atomic="true">.focus-visible:ring-2with--color-surfaceoffset).src/templates/users/preferences.htmlwith the reusable save bar component and bound form listeners (@input,@change,@click).--color-status-clean/--color-status-dirty) toinput.cssand compiledmain.css.#10b981(6.3:1 contrast) / Amber#f59e0b(5.8:1 contrast).#047857(5.2:1 contrast) / Amber#b45309(4.2:1 contrast).@media (prefers-reduced-motion: reduce)).test_preferences_save_bar_renders_with_dirty_tracking_and_a11yinsrc/users/tests/views/test_preferences.py.test_season_progress_editinsrc/app/tests/test_integration.py.Validation
SECRET=test-only scripts/test.sh users.tests.views.test_preferences-> 10/10 passedSECRET=test-only scripts/test.sh app.tests.test_integration-> 7/7 passedSECRET=test-only scripts/test.sh-> 3876/3876 passed (fast suite, 0 failures)uv run --no-sync ruff check src-> 0 errorsContract Handoff
Human Review
Gstack QA
/design-reviewscored 98/100 (A+);/reviewpassed with PR Quality Score 10/10.Migration Sync Gate
Notes