Repository navigation
Description
Goal
Extend FloCafe's Electron UI into the OS title-bar area (Discord/Claude-Desktop style polish) while retaining native window controls and never degrading the browser/LAN experience. Planning phase complete: two research passes done (codebase evidence audit + Electron API/platform research). Implementation not started - this issue is the reviewed plan.
Verified current state (codebase audit, file:line evidence in scout report)
- Electron 43.4.0 (
package.json:201) - every API we need is supported:titleBarStyle hidden/hiddenInset,titleBarOverlay,trafficLightPosition, runtimesetTitleBarOverlay(), renderer Window-Controls-Overlay geometry APIs. No version bump needed for capability. - Main window:
main/index.ts:259-270- no title-bar options today; OS draws the frame. - Close-to-tray on all platforms (
main/index.ts:316-320), renderer crash recovery recreates the window (:326-341), Linux tray recall is the only window-recall path - all must keep working unchanged. - Exactly three window classes: main POS window, KDS window (security-hardened, no preload, GHSA-hardened with enforced tests), print popups (renderer
window.open). Only the main window gets custom chrome initially; KDS/print/dialog stay stock. - Preload (
main/preload.ts): rich existing IPC incl.platform; no window-control bridge (unnecessary if overlay is used).frontend/src/types/electron.d.tsalready lags the preload by ~7 members and must be synced in the same change. - Browser/LAN detection is exclusively
window.electronAPI?.presence checks (no UA sniffing anywhere) - title-bar gating must follow the same pattern so LAN/browser clients render exactly today's layout. - Reusable bar content already exists: server-status pill (
StatusBar.tsx), update badge (UpdateBadge.tsx), printer status (PrinterStatus.tsx), tenant/staff (auth store). No clock or cloud-sync indicator exists yet. - Surprises found: dark mode is configured but inert (nothing applies
.dark- bar ships light-only unless theming lands); Persian (fa) RTL is fully live so the bar needs logical CSS properties; KDS hardening is test-enforced; min window 1024x768 gives generous layout room; macOS traffic lights never mirror in RTL (anchor content to physical edges, use logical properties for content).
Verified platform facts (Electron API research, current docs + release notes)
| Capability | Windows | macOS | Linux |
|---|---|---|---|
hidden + titleBarOverlay |
E14+ | E14+ (colors N/A; height honored) | E30/33+ only |
| Snap Layouts hover on overlay maximize | works (native buttons) | N/A | N/A |
env(titlebar-area-*) + getTitlebarAreaRect() |
E14+ | E14+ | E30/33+ |
Key pitfalls (full list in research report): drag regions swallow pointer events (interactive children need app-region: no-drag); Windows DPI overlay-height bugs (#52208 open) - set explicit integer heights and test 125-175%; dark-mode overlay color bugs (#45958) - set color/symbolColor from theme explicitly, never defaults; Linux below E33 has no working overlay (HTML-control fallback required); E43+ Linux respects DE button layout/RTL (GNOME shows close-only by default); frame: false is rejected - it forfeits Snap Layouts, native accessibility, and DPI correctness (VS Code converged on native WCO for exactly these reasons; Discord/Slack-style hand-drawn controls are the anti-pattern).
Recommended architecture (smallest safe change)
titleBarStyle: darwin ? 'hiddenInset' : 'hidden'
titleBarOverlay: { color/symbolColor from theme, height: 40 }
- Single
<TitleBar>client component mounted in(dashboard)/layout.tsx, gated onwindow.electronAPI?.presence; browser/LAN clients render today's layout unchanged (Playwright-asserted). - Bar content = persistent app context (store, staff, connection pill, printer pill, update badge) reused from existing components; interactive segments
no-drag; drag region styled with logical CSS properties; double-click-maximize via IPC honoringAppleActionOnDoubleClickon macOS (DOM dblclick in drag regions is unreliable). - Overlay colors driven from the theme via
nativeThemelistener +setTitleBarOverlay(); opaque v1 (vibrancy deferred behindprefersReducedTransparency). - Linux fallback when overlay unavailable: HTML-drawn controls over a narrow
window-actionIPC; neverhidden-with-no-controls. - Security boundary unchanged: contextIsolation stays on; no new broad IPC - only narrow capability/window-action methods if the fallback is used.
Sub-issues
- Phase 1: window options + platform branches in
createWindow()(main/index.ts) - Phase 1:
<TitleBar>component - safe areas, drag/no-drag, reused status pills, RTL logical properties - Phase 1: preload capability bridge + sync the lagging
electron.d.ts - Phase 2: Linux fallback controls + Electron version gating
- Phase 2: regression tests - static-analysis window-options test, Playwright browser-mode assertion, manual platform matrix (Win 11 at 100-175% scaling, macOS fullscreen + kiosk, Linux GNOME/KDE X11+Wayland packaged AppImage, LTR+RTL, browser-over-LAN)
Full scout reports (codebase audit with file:line citations; Electron API/platform research with sources) are archived in the firstmate home: data/nm-titlebar-codebase-scout/report.md, data/nm-titlebar-electron-scout/report.md.
Activity
khaira777 commentedon Aug 23, 2026
Phase 1 implementation is in #486. The PR is open with 4 checks passed and Greptile review pending; GitHub currently reports a merge conflict, which the implementation worker is reconciling before merge. This issue remains open until the PR lands.
feat(desktop): add native-controls title bar foundation
khaira777 commentedon Aug 23, 2026
Follow-up: #486 has all 13 checks passing, but its Greptile P1 task-local-port finding remains unresolved and the validation branch has a protected pipeline-custody divergence. It is not ready to merge; no local history was discarded.
khaira777 commentedon Aug 23, 2026
Phase 2 validation status: the NoMachine host is verified as GNOME 48.7 on X11 at 1920x1080/96 DPI, and a remote Electron 43.4.0 WCO smoke rendered the native close-only caption plus a 968x40 safe area. This is only a conditional GNOME X11 environment smoke: the exact FloCafe Phase 1 AppImage, real pointer drag, edge resize, close-to-tray, RTL, Wayland, KDE, and non-100% DPI rows remain untested. macOS and Windows native acceptance rows are also not run. Full evidence: data/flocafe-457-remote-gnome-smoke/report.md; Phase 2 matrix: data/flocafe-457-phase2-linux-scout/report.md. The epic remains open pending PR #486 review/custody resolution and packaged cross-platform validation.
feat(desktop): add native-controls title bar foundation
feat(main): add native-controls title bar foundation (#486)
khaira777 commentedon Aug 23, 2026
Phase 1 is now merged via #486. The final head passed all 13 checks, and the Greptile task-local URL/port finding was resolved. Phase 2 remains intentionally deferred per the PR scope; this epic stays open for that follow-up.
khaira777 commentedon Aug 23, 2026
Verification correction: PR #486 landed the native window options, capability-gated TitleBar/drag surfaces, focused tests, and documentation, but it did not complete every Phase 1 checklist item.
frontend/src/types/electron.d.tsstill omits seven APIs exposed bymain/preload.ts(getSettings,setSetting,getKdsInfo,openKdsWindow,getPrinters,savePrinter, andgetDailySummary). The new title bar currently shows store/staff context plus the update badge; the planned server/printer status pills are not yet included. Phase 2 remains deferred, but this Phase 1 follow-up is still outstanding.khaira777 commentedon Aug 23, 2026
Phase 1 completion follow-up is now underway: the remaining preload/type contract sync and evidence-backed title-bar status-content reconciliation will be implemented and validated through a separate no-mistakes PR. Phase 2 remains deferred.
fix(main): add Linux title-bar fallback controls (#509)