Skip to content

feat: settings modal + profile box redesign, neo switch, toggle cache invalidation - #136

Merged
vanajmoorthy merged 4 commits into
mainfrom
fix/methodology-sourcing-audit
Jul 31, 2026
Merged

feat: settings modal + profile box redesign, neo switch, toggle cache invalidation#136
vanajmoorthy merged 4 commits into
mainfrom
fix/methodology-sourcing-audit

Conversation

@vanajmoorthy

Copy link
Copy Markdown
Owner

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.

Note: branch name is fix/methodology-sourcing-audit for incidental reasons — the actual change is the settings/profile redesign described below.

Settings / profile UI

  • Merged profile box: the profile-status box and Settings button are now one long box (status + /u/ link left, pink Settings button right). Update Bibliotype stays as its own box. The Public/Private badge + /u/ link update live via a hoisted isPublic Alpine state — no page reload.
  • 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.
  • Neo switch: new reusable core/templates/core/partials/neo_switch.html with a rectangular thumb; both visibility toggles use it with clearer one-line labels + descriptions.

Security

  • Removed the in-app email-change feature (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.

Testing

  • core.tests.test_settings — 25 tests pass (email tests removed, 3 cache-invalidation tests added).
  • Full suite run locally.

https://claude.ai/code/session_01ShoZQjFpF3LxP9tEwmabRn

… 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
@vanajmoorthy
vanajmoorthy merged commit 6c73b0c into main Jul 31, 2026
1 check passed
@vanajmoorthy
vanajmoorthy deleted the fix/methodology-sourcing-audit branch July 31, 2026 12:50
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