Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

feat(desktop): expose platform chrome to renderer via IPC

5 months ago

cbae1e3
Authored
mweinbach4/30/2026, 2:47:37 PM
Wire the platform chrome contract through the WebSocket-first IPC layer
so the renderer can read normalized platform info without hardcoding
process.platform checks.

- Add DESKTOP_IPC_CHANNELS.getPlatformChrome returning a
  PlatformChromeInfo snapshot.
- Expose getPlatformChrome() on the preload bridge and
  desktopCommands.ts.
- In App.tsx, write contract values onto document.documentElement as
  CSS variables (--platform-titlebar-height, etc.) and data-attrs
  (data-sidebar-titleband-mode, data-topbar-control-placement,
  data-uses-native-glass, data-disable-css-blur).
- Add src/lib/desktopPlatform.ts + useDesktopPlatform() hook for
  components to consume normalized platform info.
- Backfill getPlatformChrome() on the web adapter with a sensible
  web-mode default.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Parent19e1698

9 files changed
  • apps/desktop/electron/ipc/window.ts+18−0
  • apps/desktop/electron/preload.ts+6−0
  • apps/desktop/src/App.tsx+18−0
  • apps/desktop/src/lib/desktopApi.ts+15−0
  • apps/desktop/src/lib/desktopCommands.ts+5−0
  • apps/desktop/src/lib/desktopPlatform.ts+107−0
  • apps/desktop/src/lib/useDesktopPlatform.ts+44−0
  • apps/desktop/src/lib/webAdapter.ts
+15
−0
  • apps/desktop/test/desktop-platform.test.ts+44−0