Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

Implementation Complete ✅

This PR implements a privacy-focused browser data cleanup feature for CLI account deletion.

All PR Feedback Addressed

File Naming ✅

  • Renamed browserCleanup.util.tsbrowser.cleanup.util.ts
  • Renamed browserCleanup.util.test.tsbrowser.cleanup.util.test.ts
  • Updated all imports to use new file names

UI Updates ✅

  • Removed all emojis from Cleanup component
  • Removed styled.ts and replaced styled-components with Tailwind CSS classes
  • Updated Cleanup.tsx to use inline Tailwind classes
  • Removed redundant "block" class from div

Component Import Pattern ✅

  • Removed index.ts file from Cleanup view
  • Updated router to import directly from Cleanup.tsx component file
  • Follows same pattern as Now, Day, and Onboarding views

CLI Environment Handling ✅

  • Removed hardcoded fallbacks from getCleanupUrl()
  • Imported CLI_ENV and ENVIRONMENT constants
  • Used strongly-typed Environment_Cli type
  • Simplified environment checks with early error throwing
  • Added specific error messages for each missing environment variable

Key Features

  • Smooth UX: Simple prompt with clear instructions, minimal user feedback required
  • Privacy-focused: Complete data cleanup including session, localStorage, and IndexedDB
  • Cross-environment: Works for local, staging, and production environments
  • Accessible: Text-based output for screen reader compatibility
  • Well-tested: 9 unit tests covering all cleanup utilities, all passing
  • Secure: No security vulnerabilities detected by CodeQL

Testing & Quality Assurance

  • ✅ All 9 cleanup utility tests passing
  • ✅ All 59 CLI tests passing
  • ✅ Web package builds successfully
  • ✅ ESLint validation passed
  • ✅ No emojis in cleanup-related code

What Gets Cleaned Up

  1. Session: SuperTokens session cookies (via session.signOut())
  2. LocalStorage: All keys starting with compass. or compass.today.tasks.*
  3. IndexedDB: The compass-local database

Ready for review and merge.

Original prompt

This section details on the original issue you should resolve

<issue_title>Feature Request: Option for CLI Account Deletion to Trigger Browser Data Cleanup</issue_title>
<issue_description>### Priority

High (would significantly improve my experience)

Feature Description

Improving privacy and user experience, Compass should ensure that when a user deletes their account via the CLI, local authentication/data artifacts (such as the Google auth key and any other storage tokens) are also optionally cleared from their browsers. Currently, browser localStorage and IndexedDB remain after CLI account deletion, causing continued use of the remote backend—even if the user tries to re-onboard. The CLI should offer users the option to trigger a browser-side storage cleanup to avoid stale state persistence and potential confusion.

Use Case

This feature gives users a complete, privacy-centered account deletion flow. It ensures no trace of their Compass/Google credentials are left behind in the browser, prevents confusing stale onboarding states, and streamlines the process for users who want a true 'fresh start' with Compass. The flow is both user-friendly and security-minded, reducing risk from outdated tokens or cached states.

It also makes it easier for local developers to "start fresh" during testing

Additional Context

Proposed Implementation:

  1. After CLI account deletion, the CLI should prompt the user to approve a browser data cleanup, including the details of the browser data that'll be removed and from which browser.
  2. Upon confirming, the CLI triggers the browser data to be deleted for the user's browser of choice.
  3. This approach avoids insecure attempts at browser automation from the CLI and makes the process cross-device friendly.

Technical Notes:

  • CLI and web client coordination required to keep flows intuitive.
  • Include a README doc that explains how this works. The doc will be added to our doc site manually after the PR.
  • Related user feedback: confusion after CLI deletes but browser stays in remote state.

Things to clear out
Session: Log the user out of their current (Supertokens) session. Users can currently manually do this by typing z and then the logout button, but we should automate this
LocalStorage: Clear their localstorage for the site (localhost)
Cookie: Used by the sessioni
IndexedDB: Delete the compass-local database to remove any stale tables and lingering data

/cc @tyler-dane</issue_description>

<agent_instructions>Optimize for a smooth UX when using from the CLI that requires minimal user feedback</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot remove emojis

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Removed emojis and replaced with plain text in commit 8569d07.

Copy link
Contributor

Choose a reason for hiding this comment

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

use tailwind, not styled-components @copilot

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Removed styled-components file and replaced with Tailwind CSS classes in commit 8569d07.

Copilot AI changed the title [WIP] Add CLI option for account deletion to trigger browser data cleanup Add browser data cleanup flow for CLI account deletion Feb 1, 2026
Copilot AI requested a review from tyler-dane February 1, 2026 00:12
Copy link
Contributor

@tyler-dane tyler-dane left a comment

Choose a reason for hiding this comment

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

remove all emojis

include tests to validate it works

@copilot

Copy link
Contributor

Choose a reason for hiding this comment

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

remove index file and just use the original component like the others

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Removed index.ts and updated router to import directly from Cleanup.tsx component file in commit 7457970.

Copy link
Contributor Author

Copilot AI commented Feb 1, 2026

remove all emojis

include tests to validate it works...

Done. All emojis have been removed from cleanup-related code. Tests are already included and passing (9 unit tests covering the cleanup utility). Changes in commit 7457970.

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.

Feature Request: Option for CLI Account Deletion to Trigger Browser Data Cleanup

2 participants