feat: settings modal + profile box redesign, neo switch, toggle cache invalidation - #136
Merged
Merged
Conversation
… cache invalidation Settings/profile UI: - Merge the profile-status box and Settings button into one long box on the dashboard; profile status (Public/Private badge + /u/ link) now updates live via a hoisted isPublic Alpine state (no page reload). Settings button is pink. Update Bibliotype stays as its own box. - Settings modal: wider (max-w-2xl), title moved inside the card with a corner-overlapping pink X (matching the instructions modal), so it fits on screen without scrolling. - New reusable neobrutalist toggle switch (partials/neo_switch.html) with a rectangular thumb; both visibility toggles now use it with clearer one-line labels + descriptions. Security: - Remove the in-app email-change feature entirely (view, URL, form, export, tests). It set the new email with no re-auth and no verification; since login is email-based this was an account-takeover vector. Caching: - Invalidate recommendation-pool caches on toggle-off. Opting out of recs now also drops recommendations_pool_count; going private drops public_users_for_recs_sample (both gate those pools). Added tests. Claude-Session: https://claude.ai/code/session_01ShoZQjFpF3LxP9tEwmabRn
…e direction The earlier _invalidate_recs_pool_caches helper cleared public_users_for_recs_sample on every recs/privacy toggle, including opt-IN and go-public. That broke the intended contract (test_invisible_to_visible_preserves_candidate_pool): the shared sample is only flushed when a user LEAVES a candidate pool (opts out / goes private); the positive direction refreshes lazily on TTL. Inlined the per-direction logic and dropped the helper.
…ing-audit # Conflicts: # core/forms.py # core/templates/core/partials/settings_modal.html # core/tests/test_settings.py # core/views/profile.py
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
Redesigns the dashboard settings UI, adds a reusable neobrutalist toggle switch, removes the in-app email-change feature (security), and fixes recommendation-pool cache invalidation on privacy/recs toggles.
Settings / profile UI
/u/link left, pink Settings button right).Update Bibliotypestays as its own box. The Public/Private badge +/u/link update live via a hoistedisPublicAlpine state — no page reload.max-w-2xl), title moved inside the card with a corner-overlapping pink X (matching the instructions modal), so it fits on screen without scrolling.core/templates/core/partials/neo_switch.htmlwith a rectangular thumb; both visibility toggles use it with clearer one-line labels + descriptions.Security
Caching
recommendations_pool_count; going private dropspublic_users_for_recs_sample(both gate those pools). Added tests.Testing
core.tests.test_settings— 25 tests pass (email tests removed, 3 cache-invalidation tests added).https://claude.ai/code/session_01ShoZQjFpF3LxP9tEwmabRn