Skip to content

fix: persist privacy state to avoid repeated prompt and Settings Switch flash#1457

Closed
4pmtong wants to merge 2 commits intomainfrom
fix/privacy-persistence-and-ui-consistency
Closed

fix: persist privacy state to avoid repeated prompt and Settings Switch flash#1457
4pmtong wants to merge 2 commits intomainfrom
fix/privacy-persistence-and-ui-consistency

Conversation

@4pmtong
Copy link
Copy Markdown
Collaborator

@4pmtong 4pmtong commented Mar 5, 2026

Description

Related

Summary

Fix two privacy UX issues:

  1. Repeated privacy prompt – "By messaging Eigent, you agree..." kept appearing on new project and when returning to chat
  2. Settings Switch flash – Privacy Switch briefly showed wrong state (off↔on) when opening Settings

Changes

  • localStorage persistence: Store privacy in eigent_privacy_enabled and eigent_privacy_enabled_${email} so ChatBox and Settings can show a cached state until the API loads
  • Shared helpers in src/lib/privacy.ts: getStoredPrivacyEnabled(), setStoredPrivacyEnabled(), isPrivacyAllEnabled()
  • Backend compatibility: Prefer res.all_required_granted when present, otherwise fall back to isPrivacyAllEnabled(res)
  • ChatBox & Settings: Both use localStorage for init and update it on API responses and user actions

Testing Evidence

  1. Enable privacy on home → create new project → prompt should not reappear
  2. Open Settings → Privacy → Switch should not flash
  3. Toggle privacy in Settings → return to ChatBox → state should stay in sync
  4. Disable privacy → open Settings → Switch should show disabled without flashing
  • I have included human-verified testing evidence in this PR.
  • This PR includes frontend/UI changes, and I attached screenshot(s) or screen recording(s).
  • No frontend/UI changes in this PR.

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Contribution Guidelines Acknowledgement

@a7m-1st
Copy link
Copy Markdown
Collaborator

a7m-1st commented Mar 5, 2026

Hi there @4pmtong thanks for the PR, we are actually removing the privacy consent from frontend in #1239 .
Looking forward to hear back!

@4pmtong 4pmtong closed this Mar 16, 2026
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.

2 participants