Skip to content

refactor(consent): fold cookie preferences into General > Privacy - #6837

Merged
waleedlatif1 merged 3 commits into
stagingfrom
feat/consent-in-general-settings
Aug 19, 2026
Merged

refactor(consent): fold cookie preferences into General > Privacy#6837
waleedlatif1 merged 3 commits into
stagingfrom
feat/consent-in-general-settings

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

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

  • Removed the top-level privacy settings section (nav entry, section switch, page component).
  • Added General → Privacy as a detail sub-view, following the same SettingsPanel back={{…}} pattern as Browser → Passwords.
  • Moved the telemetry toggle out of General's inline Privacy section into the sub-view; General now shows a one-line Privacy row with a Manage chip.
  • Cookies render only when isHosted — the only deployment that sets them. Telemetry renders everywhere, so the sub-view is useful on a self-hosted deployment too.
  • The open sub-view lives in the URL (?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') reads selectedConsents from the store at call time, and the switch's setSelectedConsent write 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

  • Refactor
  • New feature

Testing

  • type-check, lint:check, all 29 check:audits, and 193 tests pass.
  • The settings surface needs auth, so the behavior I invented — commit-on-toggle — is covered by a unit test rather than a click-through.
  • Reviewers should focus on the telemetry toggle move: the handler (mutation plus the enable_from_settings telemetry 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.

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.
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 19, 2026 2:59am

Request Review

@cursor

cursor Bot commented Aug 19, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches consent persistence and telemetry opt-in flows in settings; behavior is intentional but reviewers should verify the moved telemetry handler and commit-on-toggle cookie saves.

Overview
Removes the standalone Privacy settings tab and consolidates telemetry and cookie controls under General → Privacy, opened via a Manage chip and linkable with ?view=privacy (nuqs). Old /settings/privacy URLs redirect to general?view=privacy.

PrivacyView holds the anonymous telemetry switch (same mutation and enable_from_settings telemetry event as before) and, on hosted only, CookiePreferences. ConsentPreferences now accepts optional onChange and disabled so settings can save each cookie category on toggle (aligned with telemetry), lock switches while a save runs, and revert on failure; the consent banner still stages and commits from its footer.

Navigation catalogs and tests drop the privacy entry; the removed save/discard privacy page and its tests are replaced by cookie-preferences.test.tsx for commit-on-toggle behavior.

Reviewed by Cursor Bugbot for commit 88cffc3. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR moves cookie and telemetry controls into a URL-addressable General → Privacy sub-view while preserving the former privacy route through a redirect.

  • Removes the top-level Privacy navigation section and legacy page component.
  • Adds immediate cookie-consent commits with in-flight locking and rollback on failure.
  • Moves telemetry controls into the new Privacy detail view.
  • Preserves old privacy links by redirecting them to settings/general?view=privacy.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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"]
Loading

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.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@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.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@waleedlatif1
waleedlatif1 merged commit f82085a into staging Aug 19, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/consent-in-general-settings branch August 19, 2026 03:16
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