Home

mweinbach / agent-coworker

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

refactor(desktop): extract PlatformTopBarChrome and use platform hook

5 months ago

5f0909a
Authored
mweinbach4/30/2026, 2:47:45 PM
Split native topbar chrome into a dedicated component so the shared
AppTopBar no longer branches on raw process.platform strings.

- New PlatformTopBarChrome component renders the macOS
  SidebarCollapseControl, Windows collapsed left rail, or Linux/other
  inline toggle based on topbarControlPlacement from the contract.
- AppTopBar now uses useDesktopPlatform() instead of reading
  document.documentElement.dataset.platform inline.
- Sidebar reads sidebarTitlebandMode === "native" from the hook to
  decide whether to activate Windows-style native titleband drag zones.
- Add platform-top-bar-chrome.test.tsx covering all three placements.

No visual changes; class names and existing topbar/sidebar tests are
preserved so the existing UI contracts still hold.

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

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

Parentcbae1e3

4 files changed
  • apps/desktop/src/ui/Sidebar.tsx+5−3
  • apps/desktop/src/ui/layout/AppTopBar.tsx+12−71
  • apps/desktop/src/ui/layout/PlatformTopBarChrome.tsx+123−0
  • apps/desktop/test/platform-top-bar-chrome.test.tsx+217−0