feat(ai-partner): first-use privacy opt-in flow (#1458)#1487
Merged
Conversation
Test Results✅ All tests passed
Coverage
⏱️ Duration: 78.2s |
5d392e4 to
2f5d1e2
Compare
Before the first Amicus query, users now see a one-time modal that clearly discloses what leaves the device. The modal is backed by a React context so any caller can `await requestAmicusConsent()` before hitting the proxy. New files: - components/amicus/AmicusFirstUseModal.tsx — the modal. Cinzel title, EB Garamond body, two CTAs + privacy-policy link. Android hardware back triggers decline. - services/amicus/consent.tsx — storage helpers (hasAccepted / accept / reset) + AmicusConsentProvider context + useAmicusConsent hook. Pending requests resolve true on accept, false on decline. Wired: - App.tsx — provider mounted above AppShell so every screen sees the context. - screens/AmicusThreadScreen — handleSend now awaits consent before streaming. Declining aborts the send without writing the pref, so the user can try again later. 9 new tests cover: modal copy + primary / secondary tap, hidden state when visible=false, hasAcceptedAmicusOptIn with valid / missing / empty values, accept writes a timestamp, reset writes empty string. Full suite 3,317 / 3,317 passing; tsc clean. https://claude.ai/code/session_01Pht3kzgdvkn81DDfL9SnFe
2f5d1e2 to
795d32e
Compare
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.
Closes #1458. Phase 2 of epic #1446.
Summary
AmicusFirstUseModal— one-time disclosure matching the spec copy verbatim. Cinzel header, EB Garamond body, "I understand, let's begin" + "Not now" actions, privacy-policy link.AmicusConsentProvider— context exposingrequestAmicusConsent(): Promise<boolean>. Accept writesamicus_opt_in_accepted_at; decline resolves false without writing (user can try again later, as spec requires).App.tsx(aboveAppShell) andAmicusThreadScreen.handleSend(awaits consent before streaming).Test plan
npx tsc --noEmitcleanOut of scope
logger.info; real wiring in ai-partner: aggregate privacy-safe analytics #1469.https://claude.ai/code/session_01Pht3kzgdvkn81DDfL9SnFe