refactor(consent): fold cookie preferences into General > Privacy - #6837
Conversation
The consent settings were a top-level tab of their own, which is the wrong
weight for something a user opens once. They are now a sub-view of General,
reached from the Privacy section that already held the telemetry toggle, and
that toggle moves with them so one page owns everything Sim collects.
Cookies render only on the hosted service, the only deployment that sets them;
telemetry renders everywhere, so the sub-view is useful on a self-hosted
deployment too. Each cookie switch commits on change rather than staging behind
a Save, matching the telemetry switch directly above it -- one interaction
model per page, and no unsaved-consent state. saveConsents('custom') reads
selectedConsents from the store at call time and the switch's write is
synchronous, so the value a toggle stages is the value it commits.
The open sub-view lives in the URL, so it is linkable and Back closes it.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview
Navigation catalogs and tests drop the Reviewed by Cursor Bugbot for commit 88cffc3. Configure here. |
Greptile SummaryThe PR moves cookie and telemetry controls into a URL-addressable General → Privacy sub-view while preserving the former privacy route through a redirect.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/settings/[section]/page.tsx | Adds the legacy privacy-route redirect before section validation, preserving links to the removed top-level section. |
| apps/sim/app/workspace/[workspaceId]/settings/components/general/general.tsx | Replaces inline telemetry controls with URL-backed navigation to the Privacy detail view. |
| apps/sim/app/workspace/[workspaceId]/settings/components/general/components/privacy-view.tsx | Introduces the consolidated telemetry and hosted cookie-preferences surface. |
| apps/sim/app/workspace/[workspaceId]/settings/components/general/components/cookie-preferences.tsx | Implements per-toggle consent commits with serialization, error rollback, and user feedback. |
| apps/sim/app/_shell/consent/consent-preferences.tsx | Extends shared consent switches with optional commit callbacks and external disabled state. |
| apps/sim/components/settings/navigation.ts | Removes Privacy from the unified top-level settings registry. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A["Legacy /settings/privacy"] --> B["Redirect"]
B --> C["/settings/general?view=privacy"]
D["General Privacy row"] --> C
C --> E["Privacy detail view"]
E --> F["Telemetry toggle"]
E --> G{"Hosted deployment?"}
G -->|Yes| H["Cookie preferences"]
G -->|No| I["Telemetry only"]
E --> J["Back to General"]
Reviews (3): Last reviewed commit: "fix(consent): stop two cookie toggles fr..." | Re-trigger Greptile
The section moved into General, so the path no longer resolves. Redirect it to the replacement view through TOP_LEVEL_REDIRECTS, which the route already uses for the integrations and skills moves.
|
@cursor review |
…d one Each save sends the whole selectedConsents snapshot, so two quick toggles could finish out of order and land the older choice. The switches now lock while a commit is in flight, exactly as the telemetry switch does on its own mutation, and a failed commit puts the switch back instead of showing a preference that was never recorded. Also stop the General blurb promising cookie controls on a self-hosted deployment, where the sub-view only carries telemetry.
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 88cffc3. Configure here.
Summary
Follow-up to #6835. Cookie preferences were a top-level settings tab of their own, which is the wrong weight for something a user opens once and rarely returns to. They are now a sub-view of General → Privacy, reached from the section that already held the telemetry toggle — and that toggle moves with them, so one page owns everything Sim collects about you.
This is the shape the guidance recommends for authenticated surfaces: manage consent from account settings rather than a banner or a dedicated tab inside the product.
What changed
privacysettings section (nav entry, section switch, page component).General → Privacyas a detail sub-view, following the sameSettingsPanel back={{…}}pattern as Browser → Passwords.isHosted— the only deployment that sets them. Telemetry renders everywhere, so the sub-view is useful on a self-hosted deployment too.?view=privacy) via nuqs, so it is linkable and Back closes it.One deliberate behavior choice
Each cookie switch commits on change rather than staging behind a Save, matching the telemetry switch directly above it. One interaction model per page, and no "unsaved consent" state to reason about.
That is safe:
saveConsents('custom')readsselectedConsentsfrom the store at call time, and the switch'ssetSelectedConsentwrite is synchronous, so the value a toggle stages is the value it commits. Verified against the vendored source, and covered by a test. The banner still stages, because its footer owns the commit.Type of Change
Testing
type-check,lint:check, all 29check:audits, and 193 tests pass.enable_from_settingstelemetry event) moved verbatim into the sub-view, and that is the piece most worth a second read.Known gap (unchanged)
Prior blocking is still not implemented — GTM, GA, and PostHog load before consent. Tracked separately.