Skip to content

Merge toto/main and preserve local changes (window controls, extensio…#29

Closed
Toto672 wants to merge 2 commits into
thibautrey:mainfrom
Toto672:main
Closed

Merge toto/main and preserve local changes (window controls, extensio…#29
Toto672 wants to merge 2 commits into
thibautrey:mainfrom
Toto672:main

Conversation

@Toto672
Copy link
Copy Markdown

@Toto672 Toto672 commented Apr 3, 2026

Custom enhancements: System tray, pre-installed extensions, window controls

Summary

Custom additions to the Chatons fork for better Windows/Linux support and extension UX.

Changes

1. System Tray Support (Windows/Linux)

Files: electron/main.ts

  • Added Tray, Menu, nativeImage from Electron
  • Created createSystemTray() function
  • System tray icon with French context menu (Afficher Chatons / Quitter)
  • Click tray to toggle window visibility
  • Close minimizes to tray instead of quitting (macOS uses standard close)

2. Pre-installed Extensions

Files: electron/extensions/manager.ts, electron/ipc/workspace-handlers.ts

  • Added PREINSTALLED_EXTENSION_IDS array
  • Created preInstallExtensions() function
  • Auto-installs at startup (background, non-blocking):
    • GitHub, HomeAssistant, Telegram, WhatsApp, Signal, Discord, Usage Tracker

3. Enhanced Window Controls

Files: src/components/shell/WindowControls.tsx, src/App.tsx

  • Rewrote with SVG icons (close, minimize, maximize/restore)
  • Added maximize state tracking and toggle
  • Shows on all platforms (not just macOS)

4. UI Layout

Files: src/styles/components/layout.css

  • Window controls styling adjustments

Files Changed

File + -
electron/main.ts +324 -25
electron/extensions/manager.ts +56
electron/ipc/workspace-handlers.ts +5
src/components/shell/WindowControls.tsx +46 -26
src/App.tsx +2
src/styles/components/layout.css +36

Testing

  • System tray appears on Windows/Linux startup
  • Tray click toggles window visibility
  • Close button minimizes to tray (Win/Linux) or quits (macOS)
  • Pre-installed extensions appear after first launch
  • Window controls work on all platforms

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 3, 2026

@Toto672 is attempting to deploy a commit to the Thibaut Rey's projects Team on Vercel.

A member of the Team first needs to authorize it.

@thibautrey
Copy link
Copy Markdown
Owner

Review notes from maintainer pass:

  1. Regression: custom chaton-extension:// protocol handling appears to be removed from electron/main.ts.
    The base branch registers the privileged scheme and serves packaged extension assets through protocol.handle(...), but this PR deletes that block entirely. Per the project architecture, packaged extension web apps and topbar widgets rely on chaton-extension://<extension-id>/... asset serving. Without it, extension UIs can silently stop loading.

  2. Regression: cloud deep-link handling was removed from electron/main.ts.
    The PR removes support for chatons://cloud/connect?... and chatons://cloud/auth/callback?.... That breaks the documented cloud onboarding/auth flow.

  3. Bug: ipcMain.handle(...) registration was moved inside createWindow().
    Those handlers are now re-registered every time a window is recreated. Electron only allows one handler per channel, so after closing/reopening the window, window:isFocused, window:showNotification, etc. can throw duplicate-handler errors.

  4. Security / product concern: startup now silently installs multiple npm extensions.
    preInstallExtensions() triggers background installs for several external packages on startup. Even if the package IDs are allowlisted, this is still automatic network retrieval and local installation of executable third-party code without an explicit user opt-in. That materially expands supply-chain risk, startup side effects, and the default attack surface. At minimum this should be behind a first-run consent flow or limited to truly bundled/builtin extensions instead of npm installs.

Because of the first three points, I would not merge this PR as-is.

@thibautrey thibautrey closed this Apr 22, 2026
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.

2 participants