Skip to content

Add launch-on-startup toggle to settings#17

Open
mvanhorn wants to merge 1 commit into
video-db:mainfrom
mvanhorn:feat/auto-start-login
Open

Add launch-on-startup toggle to settings#17
mvanhorn wants to merge 1 commit into
video-db:mainfrom
mvanhorn:feat/auto-start-login

Conversation

@mvanhorn
Copy link
Copy Markdown

@mvanhorn mvanhorn commented Apr 8, 2026

Summary

Adds a "Launch on startup" toggle to the Library settings popover. Uses Electron's app.setLoginItemSettings() and app.getLoginItemSettings() APIs to register the app as a login item on macOS and Windows.

Changes

  • src/main/ipc/config.js: Import app from electron. The get-settings handler now reads app.getLoginItemSettings().openAtLogin and returns it alongside other config. The save-settings handler calls app.setLoginItemSettings() when openAtLogin changes.
  • src/renderer/history.html: New toggle switch row in the settings popover (between Theme and Shortcut). Uses the orange accent color (#EC5B16) to match the existing VideoDB palette. CSS-only toggle, no external dependencies.
  • src/renderer/history.js: Syncs the checkbox state when the popover opens, and calls configAPI.saveConfig({ openAtLogin }) on change.

The setting is managed by Electron directly (not persisted in the config JSON file), so it survives app reinstalls and works across both macOS login items and the Windows startup registry.

Default is off (opt-in).

This contribution was developed with AI assistance (Claude Code).

- Use Electron's app.setLoginItemSettings() / app.getLoginItemSettings()
  to register/unregister the app as a login item
- Add toggle switch in the Library settings popover
- Sync toggle state when opening settings
- Works on macOS (login items) and Windows (registry)
- Default is off (opt-in)

This contribution was developed with AI assistance (Claude Code).
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