Skip to content

feat(desktop): full screen over the whole display, with the tabs around the camera - #852

Open
Ark0N wants to merge 5 commits into
masterfrom
feat/desktop-whole-screen
Open

Ark0N wants to merge 5 commits into
masterfrom
feat/desktop-whole-screen

Conversation

@Ark0N

@Ark0N Ark0N commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

What this is

On a MacBook with a camera housing (the notch), full screen in the Mac app leaves a black bar across the top of the display, 32 to 40 points high depending on the model. That is macOS, not the app: every native full-screen Space ends the window below the housing and paints the strip beside it black, and no setting changes it.

This PR adds a second kind of full screen that covers the whole display, the strip beside the camera included, and teaches Codeman's page to lay its header out around the camera. It is on by default on a display with a housing and can be turned off in two places that are the same setting: View > Full Screen Uses the Area Beside the Camera in the app's menu, and App Settings > Appearance > Mac App in Codeman's page.

With it on, Codeman's header moves up into the strip: the tabs go around the camera on both sides, the toolbar stays at the right, and the terminal gains the height of the bar.

How it works

The app (packages/desktop/src/whole_screen.rs, new). The only way to draw beside the housing is the older, non-native full screen that terminals offer for the same reason (Ghostty's macos-non-native-fullscreen, WezTerm's macos_fullscreen_extend_behind_notch): the window loses its title bar, the Dock and menu bar are hidden, and the window gets the display's whole frame.

  • Every request for full screen ends in -[NSWindow toggleFullScreen:]. The app adds an override of that one method to tao's window class and decides there, so the green button, View > Enter Full Screen, ⌃⌘F and the launch into full screen all follow the option without the app owning any of them.
  • It only applies on a display that has a housing. Anywhere else macOS's own full screen already uses every pixel and keeps its Space, so nothing changes there.
  • One more override keeps a window without a title bar usable: ⌘W asks to close as the close button would (AppKit's version only beeps without one).
  • The two kinds of full screen never overlap. AppKit's own notifications say when a window begins and ends a change into or out of macOS's full screen; while one is under way the app neither takes the title bar off nor saves the window's frame.
  • Turning the option on or off while the window is in full screen changes it over: straight away from the whole display into macOS's, and into the whole display once the macOS Space has closed.
  • A window that comes out of a macOS Space is its own first responder and takes no keys, so on the way into the whole display the keys go to the web view. This was found on the MacBook: before the fix the cursor stayed hollow and typing went nowhere until a click.
  • The Dock and menu bar are fully hidden while the pointer is over the page, and only auto-hide once the pointer reaches their edge. Auto-hiding alone, the usual choice for this kind of full screen, breaks the feature on macOS 27: the system keeps an invisible window in the place of an auto-hidden menu bar, as high as the housing, and it takes every click made there. That is the strip this PR puts the tabs and the toolbar in, so a click on a tab in the top row brought the menu bar in and never reached the page, while hovering still worked. A plain AppKit window behaves the same. With the menu bar fully hidden nothing of macOS is left there and the click arrives. A timer looks at the pointer 12 times a second (only while a window is in the mode and the app is in front): when it touches the top edge or the edge the Dock is on, the app switches both bars to auto-hide, so pushing on slides the bar in as in any full screen; when the pointer has moved clear again (72 points from the top, 200 from the Dock's edge) and no menu is open, they are hidden again. The rule is a pure function with unit tests, including that no step sets a combination of options AppKit refuses.
  • The Dock and menu bar are out of the way only while a window is in this mode. What could not be set or taken off because a native Space was in front is done when that changes.
  • Info.plist gets NSPrefersDisplaySafeAreaCompatibilityMode = false, which tells macOS the app handles the housing itself. Without it the system may shrink the display's active area once a window reaches behind the housing.

The page (src/web/public/host-cutout.js, new, plus one rule in styles.css and two calls in app.js). The housing hides whatever is behind it, so the app puts a page there only after the page said it copes:

  • The page calls CodemanHost.cutoutReady(true). The app answers with CodemanHostCutout.apply({ left, width, height }), the housing in CSS pixels.
  • The tabs go around the housing by a margin, not by an element. The module reads the tabs' rectangles, finds the one that would overlap the housing (with 8 px of air on each side) and gives the room to the tab before it in the row as its right margin. The overlapping tab then starts just right of the housing, and if it no longer fits in the row it wraps flush left. Nothing is added to the tab strip and no tab is reordered, so tab order, drag and drop and the key walks see the strip they always saw. It works on rectangles alone, so it holds in the single row, the wrapped strip and the L-shaped one, for every row beside the housing and none below it.
  • The tab strip calls it once its row mode is decided, and once more right before it measures whether one row fits (the gap is part of what a row has to hold). A resize observer follows what happens with no render behind it: a selected tab growing its gear and close button, a reading arriving in the toolbar.
  • The toolbar normally ends well right of the housing and is left alone, the width a user dragged it to included. Only one that would reach the housing gets a box that starts left of the housing and pads its content past it; a solo session window always gets it, because its title shares the row.
  • Until a page has said it is ready, the web view stays below the housing with a black strip above it, exactly what full screen looks like today. That covers a Codeman server from before this change, the connect page and raw files. So nothing regresses for an older server.
  • With the tabs grouped by state, by case or as a ledger in the header strip, the rows follow layout rules a margin cannot open a gap in. For those the page answers cutoutReady(false) and stays below the housing.
  • Only Codeman's own app shell may send these messages (policy::parse_ipc), so a rendered HTML file or a web tab can neither get the page drawn behind the camera nor change the app's setting.

The switch in App Settings. The setting lives in the app (desktop.json, wholeScreen, on when absent), never in the server's settings or the page's stored ones. The app tells each page what the switch shows (CodemanHostCutout.option({ available, enabled })) on every page load and whenever it changes; the group only shows inside the Mac app on a Mac whose display has a housing. Saving the settings sends a changed switch to the app (CodemanHost.setWholeScreen), and the menu item and every open page follow.

What it trades

It is not a Space. The window covers the desktop it is on, there is no slide animation, and a three-finger swipe does not lead to it. Turning the option off gives macOS's own full screen back.

A row of tabs beside the housing loses the width of the housing plus 8 px on each side. On the MacBook Pro this was tested on that is 75 of 1512 points.

Turning the option on while the window is in macOS's full screen shows the normal window for under a second, between the Space closing and the window covering the display.

Once the pointer has touched the top edge, the top row belongs to the menu bar until the pointer is 72 points below the edge again. Reaching for a tab and overshooting to the very edge therefore brings the menu bar in, as it does in any full-screen window.

Tested

On a MacBook Pro with a camera housing (Mac17,13, macOS 27.2.1, built-in display, 1512 x 993 points, housing 59 points wide in a strip 40 points high), in three rounds with three builds, with screenshots, window and menu readings through the accessibility API, and the text that arrived in the test server's shell:

  • First build (the option turned on by hand), driven by a second session on that Mac and looked at by the owner: the window came up over the whole display with no black bar, the header at the very top edge and nothing inside the housing's rectangle; typing worked; ⌃⌘F returned to the saved window size and position twice, identically, and entered again without a new Space; unticking the option went to macOS's full screen in about 0.8 s and ticking it came back in about 1.5 s; two relaunches came back in the mode by themselves; ⌘W closed the window and the app exited. The owner's look at the real display with tabs on both sides of the housing: "Nothing hidden". That run found the first-responder bug described above.
  • Second build (default on, the switch, the first-responder fix): with no wholeScreen key stored the app came up over the whole display and the View item was ticked. With tabs 1, 4, 5 and 9 selected in turn nothing was inside the housing's rectangle plus 8 points (0 bright pixels there in every screenshot), and the first tab right of the housing started 8 points after it. The group "Mac App" showed in App Settings with the switch on; switching it off and saving unticked the View item within 0.2 s, put the window into macOS's full screen and stored wholeScreen: false; the reopened settings showed it off; switching it on brought the whole display back and stored true. Typing with no click arrived right after the change into the whole display, from the View menu and from the switch (the round 1 bug).
  • That round found the click problem described above: every pointer click in the top 45 points opened the menu bar instead of reaching the page. A small native probe window on the same Mac showed the cause (the invisible window is there with auto-hide and gone with a hidden menu bar).
  • Third build (this head): a pointer click on a tab in the top row selected it, on either side of the housing; a click on the settings button in the top row opened App Settings; pushing against the top edge slid the menu bar in, and it left again when the pointer moved away, after which the top row took clicks again; pushing against the bottom edge slid the Dock in and it left again; the View menu opened by pointer stayed open with its menu bar while the pointer moved 260 points down, and the bar left when the menu closed. The same held after the option was turned off and on, after another app had been in front, and after a relaunch. ⌘W closed the window and the app exited in about 0.2 s. The app wrote nothing to stderr in any round, and the Dock and menu bar were back every time it left the mode, lost focus or quit.
  • The pointer in rounds two and three was driven by synthetic events posted where hardware events enter the system, not by a hand on the trackpad.

Elsewhere:

  • Rust: 306 tests pass on a Mac mini (macOS 27.2), cargo fmt --check and cargo clippy -D warnings clean, universal DMG builds. The decisions (which toggle does what, which presentation options are set, when the web view goes behind the housing) are pure functions with unit tests.
  • The native code was reviewed independently against the tao, wry, muda and objc2 sources before the first push; its findings are in.
  • Page: test/host-cutout.test.ts (40 tests, in the gate, with a row model of the tab strip) and test/host-cutout.browser.test.ts (18 tests in real Chromium, browser suite): nothing ends up behind the housing at five display sizes, in a single row, a wrapped strip, a strip tall enough to scroll, with a tab that grows or is added with no render behind it, and with a toolbar too wide for the room beside the housing; taking the housing away puts the header back exactly.
  • Also checked against a running server at the MacBook's size with a tab selected on each side of the housing, tall tabs, the sidebar and the rail.
  • npm test, typecheck, lint, format and the frontend checks pass.

Not tested

A second display, closing the lid, a Dock at the left or right edge (the app reads which edge it is on; only the bottom was seen), and a MacBook with the wider housing of earlier models (those sizes were checked in Chromium only).

Seen along the way, not part of this PR

After App Settings (or any dialog) is opened with a pointer click and closed again, the terminal has no focus until it is clicked: WebKit moves focus off the terminal when a button is clicked, and the dialog restores what had focus when it opened. It happens with no full-screen change involved and in macOS's own full screen too, so it is its own change: #857.

…he camera included

On a MacBook with a camera housing (the notch), macOS's full screen ends the
window below the housing and paints the strip beside it black. No setting
changes that, so the Mac app gets a second kind of full screen, off by default:
View > Full Screen Uses the Area Beside the Camera.

The app (packages/desktop/src/whole_screen.rs):
- The window loses its title bar, the Dock and the menu bar auto-hide, and the
  window gets the display's whole frame, which reaches behind the housing.
- An override of toggleFullScreen: on tao's window class decides per request,
  so the green button, the menu item, its shortcut and the launch into full
  screen all follow the option. It only applies on a display with a housing.
- performClose: asks the delegate while the window has no close button.
- Changes into and out of macOS's own full screen are tracked from AppKit's
  notifications: while one is under way the window is not restyled and its
  frame is not saved. The Dock and menu-bar options are reconciled, so what a
  native Space in front kept from being set or taken off is done afterwards.
- Info.plist: NSPrefersDisplaySafeAreaCompatibilityMode = false.

The page (src/web/public/host-cutout.js, styles.css):
- A page is drawn behind the housing only after it said it copes
  (CodemanHost.cutoutReady); the app answers with where the housing is, and
  the toolbar's box starts left of it and pads its content past it, so the
  tabs end before the housing and the toolbar begins after it.
- Until then the web view stays below the housing with a black strip above it,
  which is what full screen looked like before: an older server, the connect
  page and a raw file are unchanged.
- With the tabs grouped by state, by case or as a ledger in the header strip
  the page says no: ending every row at the housing costs more height than the
  strip gives.

Not yet seen on a MacBook with a housing: the AppKit path was type-checked,
unit-tested where it is pure and reviewed, on a Mac mini without one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…switch in App Settings, and the tabs go around the camera

Three things the owner asked for after seeing the first build on a MacBook
Pro with a camera housing, and one bug that run found.

On by default. `wholeScreen` in desktop.json now reads as on when it is
absent. The View menu item shows only while a display with a housing is
connected, since the option's own value no longer says anything about the Mac.

A switch in App Settings (Appearance > Mac App). The setting stays the app's:
the app tells each page what the switch shows
(`CodemanHostCutout.option({ available, enabled })`, on every page load and
whenever it changes), the group shows only inside the app on a Mac with such a
display, and saving sends a changed switch back through
`CodemanHost.setWholeScreen` (IPC `wholeScreen`, trusted frames only). The
menu item and every open page follow. It is never a key of the settings the
page stores or the server keeps.

Tabs on both sides of the camera. The toolbar's box used to start left of the
housing, so the first row of tabs ended there and the room up to the toolbar
stayed empty: three of ten tabs in the first row on that display. Now
`fitTabs()` reads the tabs' rectangles, finds the one that would overlap the
housing and gives the room to the tab before it as its right margin, so the
row carries on right of the housing (five of ten there, same header height).
Nothing is added to the strip and no tab is reordered. The tab strip calls it
once its row mode is decided and before it measures one row; a resize observer
follows a tab that grows or is added with no render behind it. The toolbar
keeps its own box, a user-chosen width included, and takes the covering box
(`html.host-cutout-toolbar`) only when it would reach the housing, and in a
solo window.

The bug: a window that comes out of a macOS Space is its own first responder
and takes no keys. Ticking the option while in macOS's full screen left the
terminal with a hollow cursor until a click. The web view now gets the keys
when nothing else had them.

Seen on the MacBook with the first build: launch into the mode, typing, the
menu bar sliding in over the header, leaving and entering, both change-overs,
relaunch, command+W, Dock and menu bar never stuck. Not yet seen there: this
commit's default, switch and focus fix (the Mac went to sleep before the
second round).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… MacBook Pro

The Known limits said it had not been seen on a real MacBook. It has: one
MacBook Pro, the first build, and what that run did not cover is listed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Ark0N Ark0N changed the title feat(desktop): full screen over the whole display, the strip beside the camera included feat(desktop): full screen over the whole display, with the tabs around the camera Nov 24, 2026
…ay full screen

On macOS 27 an auto-hidden menu bar leaves an invisible window in its place,
as high as the camera housing, and that window takes every click made there.
The strip beside the housing is that place, so a click on a tab or a toolbar
button in the top row brought the menu bar in and never reached the page.
Hovering still worked. Seen on a MacBook Pro (Mac17,13, macOS 27.2.1), with a
plain AppKit window as much as with the app.

The Dock and the menu bar are now fully hidden while the pointer is over the
page, which leaves nothing of macOS at the top, and only auto-hide once the
pointer touches the top edge of the display or the edge the Dock is on, so
pushing against an edge still slides the bar in. They go back to hidden when
the pointer has moved clear of the bar, and never while a menu is open. A
timer follows the pointer while a window is in the mode and the app is in
front: the app gets no mouse events over the menu bar, the Dock or macOS's
own window.

The rule is a pure function (`reach`, `hiding`, `presentation_step`) with
unit tests, among them that no step sets a combination AppKit refuses.

Seen on that MacBook with this build: pointer clicks on tabs and on the
settings button in the top row, the menu bar and the Dock sliding in at their
edges and leaving again, a menu staying open while the pointer moves down it,
and the same after the option was turned off and on, after another app was in
front, and after a relaunch. The pointer was driven by synthetic events.

The same round covered what the second build still owed: the option on with
no setting stored, the switch in App Settings both ways, and typing right
after the change into the whole display from the View menu and from the
switch. All held.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d 0 or 1

The test server for this branch runs from this worktree, and master gained
babb55e after the branch was cut. Nothing else is on master since then.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.

2 participants