Skip to content

feat(companion): add browsing context consent prompt#5841

Open
capJavert wants to merge 3 commits intomainfrom
eng-1231-add-companion-consent-prompt-for-browsing-based
Open

feat(companion): add browsing context consent prompt#5841
capJavert wants to merge 3 commits intomainfrom
eng-1231-add-companion-consent-prompt-for-browsing-based

Conversation

@capJavert
Copy link
Copy Markdown
Contributor

@capJavert capJavert commented Apr 8, 2026

Summary

  • Add browsingContextEnabled to frontend SettingsFlags type and SidebarSettingsFlags enum
  • Add companion_browsing_consent GrowthBook feature flag for A/B testing
  • Add analytics events: browsing consent prompt show, accept, decline
  • Create useCompanionBrowsingConsent hook (follows useNoAiFeed pattern) that shows a one-time showPrompt() modal in the companion widget
  • Integrate the hook into the Companion component

Basically collect permission for now, collection implemented later if enough users are interested. (API side flag merged already)

Key decisions

  • Opt-in only: absence of browsingContextEnabled flag = no consent; declining does not write false
  • One-time prompt: dismiss state persisted in flags.prompt.browsing_context_consent_prompt, never re-triggers
  • Zero migration: stored in existing JSONB flags column
  • Instant rollback: GrowthBook flag can disable without deploy

Test plan

  • Unit tests for all hook branches (accept, decline, feature-off, already-consented, already-dismissed, settings-not-loaded) — 7/7 pass
  • Manual: enable companion_browsing_consent in GrowthBook, open companion on any page, verify prompt appears once
  • Manual: accept → verify browsingContextEnabled: true in settings flags
  • Manual: decline → verify flag absent, prompt never re-appears
image image

Closes ENG-1231


Created by Huginn 🐦‍⬛

Preview domain

https://eng-1231-add-companion-consent-p.preview.app.daily.dev

Add one-time consent prompt in the companion widget asking whether
browsing context can be used for personalized content recommendations.

- Add browsingContextEnabled to frontend SettingsFlags type and enum
- Add companion_browsing_consent GrowthBook feature flag
- Add analytics events: show, accept, decline
- Create useCompanionBrowsingConsent hook following useNoAiFeed pattern
- Integrate hook into Companion component
- Opt-in only: absence of flag = no consent, decline persists dismiss
  state via flags.prompt without writing false
- GrowthBook gated for A/B testing before full rollout

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-webapp Ready Ready Preview Apr 8, 2026 3:21pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
storybook Ignored Ignored Apr 8, 2026 3:21pm

Request Review

showPrompt() modals are not visible inside the companion shadow DOM.
Replace with an inline CompanionBrowsingConsentBanner rendered directly
in CompanionContent so the consent prompt is visible to users.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…adge

Pass loadedSettings and updateSettings to companion SettingsContextProvider
so the browsing consent hook can read and write flags. Lift consent hook to
Companion component and add a purple notification dot on the toggle icon
when the banner is pending (hidden on hover).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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