Skip to content

feat: add startup for desktop app#1276

Merged
MODSetter merged 4 commits intodevfrom
dev_mod
Apr 21, 2026
Merged

feat: add startup for desktop app#1276
MODSetter merged 4 commits intodevfrom
dev_mod

Conversation

@MODSetter
Copy link
Copy Markdown
Owner

@MODSetter MODSetter commented Apr 21, 2026

Description

Motivation and Context

FIX #

Screenshots

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR adds launch on startup functionality to the desktop app, allowing users to configure SurfSense to open automatically when they log in to their computer (with an option to start minimized to the tray). The implementation includes cross-platform support (macOS, Windows, and Linux), a UI toggle in the desktop settings panel, first-launch opt-in defaults, and comprehensive analytics tracking. The PR also significantly enhances PostHog analytics integration across both the desktop app and web UI, including unified identity tracking between Electron main process and renderer, connector lifecycle telemetry improvements, and anonymous chat tracking. Minor changes include database migration version renumbering and UI updates to the purchase history table to support multiple product types.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_desktop/src/modules/auto-launch.ts
2 surfsense_desktop/src/ipc/channels.ts
3 surfsense_desktop/src/ipc/handlers.ts
4 surfsense_desktop/src/main.ts
5 surfsense_desktop/src/modules/window.ts
6 surfsense_desktop/src/preload.ts
7 surfsense_web/types/window.d.ts
8 surfsense_web/app/dashboard/[search_space_id]/user-settings/components/DesktopContent.tsx
9 surfsense_desktop/src/modules/analytics.ts
10 surfsense_web/instrumentation-client.ts
11 surfsense_web/lib/posthog/events.ts
12 surfsense_desktop/src/modules/deep-links.ts
13 surfsense_desktop/src/modules/auto-updater.ts
14 surfsense_desktop/src/modules/folder-watcher.ts
15 surfsense_desktop/src/modules/tray.ts
16 surfsense_web/components/assistant-ui/connector-popup/constants/connector-constants.ts
17 surfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.ts
18 surfsense_web/components/free-chat/anonymous-chat.tsx
19 surfsense_web/components/free-chat/free-chat-page.tsx
20 surfsense_web/app/dashboard/[search_space_id]/user-settings/components/PurchaseHistoryContent.tsx
21 surfsense_web/contracts/types/stripe.types.ts
22 surfsense_backend/alembic/versions/127_add_report_content_type.py
23 surfsense_backend/alembic/versions/128_seed_build_resume_prompt.py
⚠️ Inconsistent Changes Detected
File Path Warning
surfsense_backend/alembic/versions/127_add_report_content_type.py Database migration revision renumbering appears unrelated to desktop startup functionality
surfsense_backend/alembic/versions/128_seed_build_resume_prompt.py Database migration revision renumbering appears unrelated to desktop startup functionality
surfsense_web/app/dashboard/[search_space_id]/user-settings/components/PurchaseHistoryContent.tsx Purchase history UI changes for displaying token purchases alongside page purchases are unrelated to desktop startup feature
surfsense_web/contracts/types/stripe.types.ts Stripe type updates for token purchase status enums are unrelated to desktop startup feature

Need help? Join our Discord

Analyze latest changes

- Added event tracking for desktop app activation and quitting.
- Introduced analytics bridge in preload script to handle user identification and event capturing.
- Updated IPC channels to support analytics-related actions.
- Enhanced analytics functionality in the main process to track user interactions and application updates.
- Integrated analytics tracking for folder watching and deep link handling.
- Improved connector setup tracking in the web application.

This commit enhances the overall analytics capabilities of the application, ensuring better user behavior insights and event tracking across both desktop and web environments.
- Implemented IPC channels for managing auto-launch settings.
- Enhanced main process to handle auto-launch behavior on startup.
- Updated UI components to allow users to configure launch options.
- Integrated analytics tracking for auto-launch events.

This commit introduces the ability for users to enable or disable the application launching at system startup, along with options for starting minimized to the tray.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

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

Project Deployment Actions Updated (UTC)
surf-sense-frontend Ready Ready Preview, Comment Apr 21, 2026 4:04am

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8069cc91-97bc-4e8a-84d1-ce6cf6d44fbe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev_mod

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@recurseml recurseml Bot left a comment

Choose a reason for hiding this comment

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

Review by RecurseML

🔍 Review performed on f2bb6db..24383a3

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (23)

surfsense_backend/alembic/versions/127_add_report_content_type.py
surfsense_backend/alembic/versions/128_seed_build_resume_prompt.py
surfsense_desktop/src/ipc/channels.ts
surfsense_desktop/src/ipc/handlers.ts
surfsense_desktop/src/main.ts
surfsense_desktop/src/modules/analytics.ts
surfsense_desktop/src/modules/auto-launch.ts
surfsense_desktop/src/modules/auto-updater.ts
surfsense_desktop/src/modules/deep-links.ts
surfsense_desktop/src/modules/folder-watcher.ts
surfsense_desktop/src/modules/tray.ts
surfsense_desktop/src/modules/window.ts
surfsense_desktop/src/preload.ts
surfsense_web/app/dashboard/[search_space_id]/user-settings/components/DesktopContent.tsx
surfsense_web/app/dashboard/[search_space_id]/user-settings/components/PurchaseHistoryContent.tsx
surfsense_web/components/assistant-ui/connector-popup/constants/connector-constants.ts
surfsense_web/components/assistant-ui/connector-popup/hooks/use-connector-dialog.ts
surfsense_web/components/free-chat/anonymous-chat.tsx
surfsense_web/components/free-chat/free-chat-page.tsx
surfsense_web/contracts/types/stripe.types.ts
surfsense_web/instrumentation-client.ts
surfsense_web/lib/posthog/events.ts
surfsense_web/types/window.d.ts

@MODSetter MODSetter merged commit 1919150 into dev Apr 21, 2026
8 of 12 checks passed
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