Skip to content

feat(ai-partner): first-use privacy opt-in flow (#1458)#1487

Merged
CraigBuckmaster merged 1 commit into
masterfrom
claude/issue-1458-privacy-optin
Apr 17, 2026
Merged

feat(ai-partner): first-use privacy opt-in flow (#1458)#1487
CraigBuckmaster merged 1 commit into
masterfrom
claude/issue-1458-privacy-optin

Conversation

@CraigBuckmaster
Copy link
Copy Markdown
Owner

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 exposing requestAmicusConsent(): Promise<boolean>. Accept writes amicus_opt_in_accepted_at; decline resolves false without writing (user can try again later, as spec requires).
  • Android hardware back cancels the modal the same as "Not now".
  • Wired into App.tsx (above AppShell) and AmicusThreadScreen.handleSend (awaits consent before streaming).

Test plan

  • npx tsc --noEmit clean
  • 9 new tests (copy, actions, hidden state, storage helpers)
  • Full suite 3,317 / 3,317 passing
  • Coverage thresholds green
  • Reviewer: verify decline → re-open → modal shows again on a dev build.

Out of scope

https://claude.ai/code/session_01Pht3kzgdvkn81DDfL9SnFe

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 17, 2026

Test Results

✅ All tests passed

Passed Failed Total
Tests ✅ 3317 ❌ 0 3317
Suites ✅ 447 ❌ 0 447

Coverage

Statements Branches Functions Lines

⏱️ Duration: 78.2s

@CraigBuckmaster CraigBuckmaster force-pushed the claude/issue-1458-privacy-optin branch from 5d392e4 to 2f5d1e2 Compare April 17, 2026 14:12
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
@CraigBuckmaster CraigBuckmaster force-pushed the claude/issue-1458-privacy-optin branch from 2f5d1e2 to 795d32e Compare April 17, 2026 14:50
@CraigBuckmaster CraigBuckmaster merged commit c479360 into master Apr 17, 2026
6 checks passed
@CraigBuckmaster CraigBuckmaster deleted the claude/issue-1458-privacy-optin branch April 17, 2026 15:07
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.

ai-partner: first-use privacy opt-in flow

2 participants