Skip to content

refactor: inline syncSubPreferences into master change handler#198

Closed
chriscarrollsmith wants to merge 1 commit into
mainfrom
refactor/drop-sync-subprefs
Closed

refactor: inline syncSubPreferences into master change handler#198
chriscarrollsmith wants to merge 1 commit into
mainfrom
refactor/drop-sync-subprefs

Conversation

@chriscarrollsmith

Copy link
Copy Markdown
Contributor

Summary

  • The syncSubPreferences helper in communication_preferences_fields.html was only ever called from the master checkbox's change handler (the disable branch) and was never invoked on page load — initial sub-preference visibility is already set server-side via the Jinja style="display: none;" guard.
  • Inlining it removes the indirection and the asymmetry between the enable and disable paths.
  • Behavior is preserved exactly: enabling the master reveals the sub-preferences and checks comm_updates; disabling hides them and clears both comm_updates and comm_marketing.

Test plan

  • uv run pytest tests/test_templates.py (30 passed)
  • uv run ty check . clean

Made with Cursor

The syncSubPreferences helper was only invoked from the master
checkbox's change handler (disable branch) and never on init, where
initial visibility is already set server-side via Jinja. Inlining it
removes the indirection and the asymmetry between the enable and
disable paths while preserving behavior: enabling reveals the
sub-preferences and checks updates; disabling hides them and clears
both sub-preferences.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chriscarrollsmith

Copy link
Copy Markdown
Contributor Author

Consolidated into #197 to avoid a second CI run.

@chriscarrollsmith chriscarrollsmith deleted the refactor/drop-sync-subprefs branch June 23, 2026 15:14
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