Skip to content

feat(settings): add Start on system startup toggle - #1799

Open
MoriDanWork wants to merge 1 commit into
tashfeenahmed:mainfrom
MoriDanWork:feat/settings-start-on-startup
Open

MoriDanWork wants to merge 1 commit into
tashfeenahmed:mainfrom
MoriDanWork:feat/settings-start-on-startup

Conversation

@MoriDanWork

Copy link
Copy Markdown
Contributor

Summary

Adds a Start on system startup toggle to the dashboard Settings → General dialog. When enabled in a desktop build, FreeLLMAPI launches automatically when the user signs into the OS — the same "open at login" flag the tray popover already controls, now reachable from the Settings UI.

What changed

Area Change
desktop/src/main.ts New freeapi:get-login-item IPC handler mirroring the existing set-login-item; both read/write app.getLoginItemSettings().
desktop/src/preload.ts New __FREEAPI_LOGIN_ITEM__ preload bridge (get / set) so the dashboard renderer can read and flip the OS flag.
client/src/lib/desktop-login-item.ts New useDesktopLoginItem() hook: resolves the current state once, toggles optimistically, and rolls back if the shell rejects the change.
client/src/components/settings-dialog.tsx New row in the General section using the shared Row + Switch pattern (label + info hint on the left, switch on the right). Hidden in a plain browser where there is no desktop shell.
client/src/i18n/locales/*.json startAtLogin / startAtLoginHelp strings added to all 60 locales.
client/src/components/settings-start-at-login.test.tsx New tests: row only renders with the desktop bridge, hidden in browser, toggling calls the shell, rollback on rejection.

Design

Follows the existing Settings dialog conventions exactly: the shared Row layout, the Switch control, an InfoHint tooltip, and the same t('settings.…') i18n keys as every other row. The row appears under General, after language and theme.

Testing

  • npm test -w client — 440 tests pass, i18n validation passes for all 60 locales.
  • npm test (desktop) — 76 tests pass.
  • tsc -b, vite build, and the desktop build:main + build:preload all succeed.

…ettings dialog

Adds an autostart switch to the General section of the dashboard Settings
dialog. In a desktop build it reads and writes the OS-level "open at
login" flag through the preload bridge, mirroring the tray popover's
existing login-item toggle; in a plain browser the row is hidden.

- desktop: expose freeapi:get-login-item IPC and a __FREEAPI_LOGIN_ITEM__
  preload bridge (get/set) for the dashboard renderer
- client: useDesktopLoginItem hook + Settings row with an optimistic toggle
  that rolls back if the shell rejects the change
- i18n: add startAtLogin / startAtLoginHelp to all 60 locales
- tests: settings-start-at-login.test.tsx covering render, hide, toggle and
  rollback

This branch has not been deployed

No deployments
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