feat(desktop): add PostHog feature flag to gate auth requirement

Merged
SA
1y ago
+135-12

Summary

  • Add PostHog feature flag support to desktop app for controlling auth requirement
  • require-desktop-auth flag gates whether users must sign in to use the app
  • Fix dev/prod singleton lock conflict allowing both to run simultaneously

Changes

  • Add posthog-js and create PostHogProvider for feature flag support
  • Update CSP to allow PostHog connections (https://*.posthog.com)
  • Add app.setName("Superset Dev") in dev mode to prevent singleton lock conflicts
  • Centralize feature flags in packages/shared/src/constants.ts

Test plan

  • Verify feature flag loads correctly on app start
  • Test flag enabled → auth screen shown
  • Test flag disabled → no auth required
  • Verify dev and prod apps can run simultaneously

šŸ¤– Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Integrated analytics tracking capability for the desktop application
    • Introduced feature flag system to control app functionality
    • Added configurable authentication requirement for desktop app access
    • Development builds now display as "Superset Dev"
  • Chores

    • Added new analytics dependency

āœļø Tip: You can customize this high-level summary in your review settings.