Theme IPC Broadcasting & V5 Client Shell Interoperability

Theme IPC Broadcasting & V5 Client Shell Interoperability

Creating an immersive publishing workstation requires seamless aesthetic unity between the application canvas and the operating system window. When a user switches themes in Open Publisher, changes should not be confined solely to web buttons and ribbon headers: the native OS window frame, title bar border, system tray icon, and developer diagnostics HUD should immediately reflect the active color palette. Version 4.19.8 introduced an Inter-Process Communication (IPC) theme broadcasting engine using standardized message payloads, laying the foundational bridge for the V5 client shell.

🎨
[Screenshot: Native Desktop Window Synchronizing Title Bar Accent with In-App Theme (700 x 360)]

Native OS window borders, title bar headers, and developer panels dynamically update whenever the in-app theme changes.

The postMessage Broadcast Architecture

Version 4.19.8 implemented real-time theme broadcasting in ui/themes.js:

  • Broadcasting Hook: Whenever a theme is selected or switched in the UI, the web application actively emits an OP_THEME_UPDATE message via window.postMessage().

  • Standardized Color Payload: The broadcast payload delivers complete color specifications:

    • themeName: The unique identifier of the active theme (e.g. "teal", "slate", "crimson", "dark").
    • hex: The exact primary hex color value (e.g. #007670).
    • hue: The HSL hue degree for dynamic UI lighting calculations.
    • isDark: Boolean flag signaling dark mode activation.

Native Desktop Shell Interoperability

External desktop wrappers listen for these broadcast events to synchronize native controls:

  • Window Frame Synchronization: In native desktop builds (such as Electron or NW.js), host scripts capture OP_THEME_UPDATE and restyle native title bars, window borders, and window control buttons.

  • Developer HUD Integration: Tearaway developer HUD popouts, memory charts, and IPC traffic sniffers dynamically update their accent lines and borders to match the user's active theme.

  • Instant Frame-Zero Updates: Color transitions take effect on the same animation frame with zero perceptible delay.

Tip: You can customize your UI theme anytime in the Options dialog; native desktop client borders will mirror your selection immediately.