open-design/apps/web/tests
lefarcen 9596a0ccd5
feat(privacy): collapse first-run consent banner to a single "I get it" button (#2202)
* feat(privacy): collapse first-run banner to a single "I get it" button

Replaces the first-run privacy disclosure's two-button decision picker
("Share usage data" / "Don't share") with a single "I get it"
acknowledgement. Clicking it accepts the same default telemetry surface
the previous "Share usage data" path enabled — the banner shifts from
binary consent picker to informed disclosure.

To keep the surface honest, the banner footer is rewritten to spell out
the new default and point at the off switch:

  "Data sharing is on by default. You can turn it off any time in
   Settings → Privacy. We never upload the contents of your generated
   artifact files."

Settings → Privacy (PrivacySection.tsx) is unchanged — that surface still
exposes both Share and Don't share buttons so users who arrive there
later (or come back to flip the choice) keep the explicit picker.

Mechanics:

* `PrivacyConsentModal.tsx`: drop `onDecline` prop and the second button;
  rename `onShare` → `onAccept` to match the new semantic. Footer hint
  now reads from `settings.privacyConsentBannerFooter` (new key) so the
  banner copy can speak in single-button voice without disturbing the
  reused `settings.privacyConsentFooter` that PrivacySection still
  displays.

* `App.tsx`: drop the `onDecline` handler. Single `onAccept` handler
  applies the same opt-in payload as the previous `onShare` branch
  (`telemetry.metrics = true`, `telemetry.content = true`, fresh
  `installationId`), so the wire format daemon-side is unchanged.

* `i18n/types.ts` + `locales/en.ts`: two new keys —
  `settings.privacyConsentAccept` ("I get it") and
  `settings.privacyConsentBannerFooter` (the default-on disclosure copy).

* `i18n/locales/*.ts` (all 18 non-en dictionaries): added the two new
  keys. zh-CN and zh-TW are translated; the remaining 16 locales follow
  the project convention of leaving the EN string as a fallback for
  later contributor passes (same shape used by privacyConsentShare /
  Decline today).

* `tests/components/PrivacyConsentModal.test.tsx`: rewritten. The four
  new tests lock the new contract — single "I get it" button, no
  Share/Decline labels, default-on disclosure text in the footer, the
  external privacy-policy link, and onAccept firing on click. Replaces
  the prior "equal-prominence" tests, which only made sense for the
  two-button shape.

Validation:

* `pnpm --filter @open-design/web exec vitest run tests/components/PrivacyConsentModal.test.tsx`
  → 4/4 passed
* `pnpm --filter @open-design/web exec vitest run tests/i18n/locales.test.ts`
  → 5/5 passed (every locale aligned with English keys + placeholders;
  the new keys ship to all 19 dictionaries)
* `pnpm --filter @open-design/web typecheck` clean

* test(privacy): update App.connectors fixture to match single-button banner

`App.connectors.test.tsx > does not show first-run privacy consent until
daemon config hydration finishes` hardcoded the previous "Share usage
data" affirmative button label. The single-button banner now renders
"I get it", so the assertion was looking for a button that no longer
exists.

CI signal: 26081467446 → Web workspace tests → `× does not show
first-run privacy consent until daemon config hydration finishes`. The
App workspace tests + Validate workspace failures cascaded from this
one — both are aggregator jobs.

Local: vitest run tests/components/App.connectors.test.tsx → 5/5 passed.
2026-05-19 15:26:56 +08:00
..
artifacts Fix pointer HTML artifact previews (#2075) 2026-05-18 18:28:28 +08:00
components feat(privacy): collapse first-run consent banner to a single "I get it" button (#2202) 2026-05-19 15:26:56 +08:00
edit-mode Implement manual edit inspector (#1448) 2026-05-13 13:25:58 +08:00
hooks Fix finalize provider routing for Gemini BYOK (#1964) 2026-05-18 18:03:44 +08:00
i18n feat: add Italian (it) locale support (#1323) 2026-05-15 16:38:55 +08:00
lib feat(web): add manual removal for captured Pod components (#1951) 2026-05-17 20:13:56 +08:00
providers [codex] Land design system GitHub intake handoff (#2187) 2026-05-19 14:30:17 +08:00
runtime test(e2e): align entry coverage with redesigned flows (#2101) 2026-05-19 11:26:40 +08:00
state fix: support CODEX_API_KEY for Codex CLI (#1880) 2026-05-18 14:29:23 +08:00
styles fix(web): keep filter pill hover labels readable (#1828) 2026-05-15 23:07:43 +08:00
utils fix(web): unbreak Create button on plain HTTP / LAN-IP deployments (#849) (#900) 2026-05-08 16:50:59 +08:00
analytics-identity.test.ts feat(analytics): PostHog product analytics (P0 events, consent-gated, packaged) (#1428) 2026-05-12 22:32:42 +08:00
analytics-scrub.test.ts feat(analytics): PostHog product analytics (P0 events, consent-gated, packaged) (#1428) 2026-05-12 22:32:42 +08:00
api-attachment-context.test.ts Inline attached file context for BYOK chats (#1730) 2026-05-15 15:52:15 +08:00
App.test.ts fix(web): suppress autosave indicator for draft-only Connector key edits (#1232) 2026-05-11 20:52:45 +08:00
comments.test.ts [codex] Add visual draw annotation context (#1547) 2026-05-13 20:02:19 +08:00
quickSwitcherRecents.test.ts feat(web): add Cmd/Ctrl+P quick file switcher (#556) 2026-05-06 10:31:50 +08:00
router-marketplace.test.ts Garnet hemisphere (#1702) 2026-05-14 21:12:50 +08:00
router.test.ts Garnet hemisphere (#1702) 2026-05-14 21:12:50 +08:00
sidecar-proxy.test.ts Migrate beta release publishing to R2 (#805) 2026-05-07 19:13:52 +08:00