Skip to content

fix: hide window controls in web runtime#430

Open
ShowhyT wants to merge 2 commits into
ZenNotes:mainfrom
ShowhyT:fix/hide-window-controls-web-runtime
Open

fix: hide window controls in web runtime#430
ShowhyT wants to merge 2 commits into
ZenNotes:mainfrom
ShowhyT:fix/hide-window-controls-web-runtime

Conversation

@ShowhyT

@ShowhyT ShowhyT commented Jul 20, 2026

Copy link
Copy Markdown

Problem

TitleBar rendered native window control buttons (minimize / maximize
/ close) unconditionally on non-mac platforms. The buttons rendered
correctly with no visual issues, but they were non-functional when the
app is accessed as a web page served by the server: the click handlers
call Electron-only APIs (windowMinimize, windowToggleMaximize,
windowClose), and there is no native window to control in that
context.

Fix

  • Added shouldShowWindowControls(platform, runtime), a pure function
    that returns whether the controls should render (hidden on mac and
    in the web runtime).
  • TitleBar now uses window.zen.getAppInfo().runtime to detect the
    web runtime, passed into shouldShowWindowControls alongside the
    existing mac check.
  • Added unit tests for shouldShowWindowControls covering desktop
    (win/linux), web runtime, and mac.

Testing

  • npm test — new unit tests pass.
  • Desktop app (local build): controls render and work as before.
  • Web-served UI (browser): controls are hidden, no other change in
    behavior.

Scope

Limited to TitleBar.tsx and its new test file; no other behavior
changed.

Window control icons (minimize/maximize/close) rendered in the web
runtime; now hidden there.

Extract the visibility check into shouldShowWindowControls(), which
uses window.zen.getAppInfo().runtime to detect web vs desktop, and
add unit tests covering desktop, web, and mac.
@ShowhyT
ShowhyT requested a review from adibhanna as a code owner July 20, 2026 00:00
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.

1 participant