Repository navigation
Conversation
…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>
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'smacos-non-native-fullscreen, WezTerm'smacos_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.-[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,⌃⌘Fand the launch into full screen all follow the option without the app owning any of them.⌘Wasks to close as the close button would (AppKit's version only beeps without one).Info.plistgetsNSPrefersDisplaySafeAreaCompatibilityMode = 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 instyles.cssand two calls inapp.js). The housing hides whatever is behind it, so the app puts a page there only after the page said it copes:CodemanHost.cutoutReady(true). The app answers withCodemanHostCutout.apply({ left, width, height }), the housing in CSS pixels.cutoutReady(false)and stays below the housing.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:
⌃⌘Freturned 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;⌘Wclosed 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.wholeScreenkey 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 storedwholeScreen: false; the reopened settings showed it off; switching it on brought the whole display back and storedtrue. 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).⌘Wclosed 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.Elsewhere:
cargo fmt --checkandcargo clippy -D warningsclean, 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.test/host-cutout.test.ts(40 tests, in the gate, with a row model of the tab strip) andtest/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.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.