Skip to content

Studio: toggle desktop fullscreen with F11 - #17213

Merged
wasimysaid merged 15 commits into
unslothai:mainfrom
Aafimalek:feat/issue-17016-fullscreen
Nov 12, 2026
Merged

wasimysaid merged 15 commits into
unslothai:mainfrom
Aafimalek:feat/issue-17016-fullscreen

Conversation

@Aafimalek

@Aafimalek Aafimalek commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Toggle the Studio desktop window's fullscreen mode with F11. Press F11 again to return to the previous window state.
  • Keep the browser shortcut unchanged and grant only the native fullscreen permission needed by the desktop window.

Closes #17016

Verification

  • 99 focused fullscreen and keyboard shortcut tests passed on Windows, using a controlled Tauri window boundary. The test covers repeated and modified keys and an in-progress transition.
  • Frontend typecheck, ESLint on the new files, Prettier on the new files, and production build passed.
  • cargo check --locked --manifest-path studio/src-tauri/Cargo.toml passed on Windows with 19 warnings.
  • The Tauri desktop app itself was not launched, so native window-manager behavior remains to be verified.

@danielhanchen

Copy link
Copy Markdown
Member

The PR's new test fails in CI on both Linux (Frontend build + bundle sanity) and Windows (Frontend unit tests (Windows)). This is not a main-wide failure:

not ok 4071 - F11 enters and leaves the desktop window's fullscreen mode
  location: studio/frontend/tests/desktop-fullscreen.test.ts:10:1
  Expected values to be strictly deep-equal:
  + []
  - [
  -   true
  - ]
  at desktop-fullscreen.test.ts:42:10

So after the first F11, nothing reached the window stub within one setImmediate. It passes in isolation but not inside the full npm test run, which suggests the handler's lazy import of the Tauri window module takes more than one tick there. The same job also logs Tauri app version read failed; showing it as unavailable Error: Tauri app API unavailable, so the import may be landing on a different stub. Waiting until fullscreenChanges has the expected length, with a bounded poll, would make the test independent of how many ticks the import takes.

The Uploads (windows-latest) red is in the browsers stage of tests/studio/rag_upload_ci.py. Every case the log prints passed, so I would rerun that one once the test above is fixed before reading anything into it.

@danielhanchen

Copy link
Copy Markdown
Member

Following up on the current head (760712fed9): the F11 unit test now passes, but Chat UI Tests (extra) is red on this PR and green on main. Two gates fail:

  • Tool activity collapse regression (Playwright)
  • the long-thread restyle gate: appearance mode liquid-3d makes area message_menu cost 4,765 elements restyled against 184 in the default appearance at 200 turns = 25.9x (limit 10.0x), and the same area grows 28.9x from 40 to 200 turns (limit 2.0x).

The main.tsx change is the only shared code path both gates load, so I would check whether the fullscreen watcher or its window listener now triggers a document-wide style change, for example by toggling a class on the root element.

@Aafimalek

Copy link
Copy Markdown
Contributor Author

Thanks, I checked the suggested path against head 760712fed9 and its exact base 4a45dbd03e.

  • The tauri root class is already present in the base's startup code. The new watcher does not change any document class or style, and is registered only inside if (isTauri).
  • playwright_tool_activity.py loads smoke-tool-activity.html and smoke-tool-activity-main.tsx, which do not import main.tsx. All 13 collapse scenes passed on both commits locally with Windows Chromium / Playwright 1.64.1.
  • Both production builds emitted the same five CSS files, with identical SHA-256 hashes. Loading each built app under Linux Chromium with the area-matrix API fixture also showed isTauri false, no F11 window listener, and the same root classes.

I have not reproduced the restyle verdict locally. The area fixture waits for all message rows, but only 16 of the expected 80 rows mounted on both Linux builds in my check. I stopped the full local measurement without changing its assertions, so this is not a passing performance-gate result.

Could you rerun the collapse and long-thread jobs on this head? The evidence so far does not identify a fullscreen code change that would fix these failures. If the restyle verdict repeats, the mutation/trace around message_menu would help narrow it down.

danielhanchen added a commit that referenced this pull request Nov 9, 2026
… a fixed sleep (#17234)

## Summary

`tests/studio/playwright_tool_activity.py` scene 3 clicks the controlled
and uncontrolled tool cards back to back, sleeps a fixed 600 ms, then
reads `aria-expanded`. On a loaded runner the second click is sometimes
lost: the first card's 200 ms Radix expansion is still moving the second
trigger, so the gate reports

```
PROBLEMS (chromium):
  - 3: uncontrolled did not open on click
```

while the controlled card opened fine. It has turned `Chat UI Tests
(extra)` red on unrelated PRs three times since yesterday:

- #17118 (staging run, Nov 8)
- #17213 (Nov 9)
- #17178 (staging run, Nov 9, a backend-only int8 change)

No frontend file changed on `main` between the last green run of that
job and those failures.

The fix opens each card in turn and waits, bounded at 5 s, until its
trigger reports `aria-expanded="true"` before clicking the next one. The
scene still reads `aria-expanded` afterwards and records the same
problem, so a card that really does not open on click still fails the
gate.

## Changes

- `tests/studio/playwright_tool_activity.py`: new `click_open(page,
name)` helper, used for the two scene 3 clicks. Every other scene is
unchanged.

## Testing

- Three local runs of the gate on Chromium: `problems == []` each time.
- Sabotage: with a capture-phase listener that swallows clicks on the
uncontrolled trigger, the gate still fails with `3: uncontrolled did not
open on click`.
- The 22 test files that read the Playwright drivers or
`_playwright_robust` pass (714 passed), and ruff and the exec-literal
lint are clean.
The fullscreen watcher only runs inside the desktop app, so the browser
build the gate measures is unchanged (identical CSS, only the entry
chunk gains the isTauri-gated listener). The harness change belongs in
its own PR if the gate needs it.

[skip ci]
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T12:57:49.051493Z 5b8b8d1 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dfce012aa6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

)
return;

event.preventDefault();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor existing F11 bindings before preventing the event

For Windows/Linux desktop users who bind an action such as New Chat to F11 in Settings, this listener silently disables that shortcut. main.tsx installs it before React mounts, whereas useShortcut adds its window listeners later and returns immediately when event.defaultPrevented is true (features/settings/hooks/use-shortcut.ts:255-256). Consequently F11 now toggles fullscreen rather than invoking the saved action, even though the editor still accepts F11 as a valid binding. Consult the shortcut ownership registry before consuming F11, or register fullscreen through the shared shortcut-dispatch path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 85d076b: the watcher now steps aside when a Settings shortcut owns bare F11 (same ownership rule useShortcut uses), with a test.

Bare function keys are bindable in Settings > Keyboard shortcuts. The
fullscreen watcher registers before React mounts, so it consumed F11 and
useShortcut skipped the defaultPrevented event, silently disabling a
user's F11 binding. Defer to the shortcut registry's owner of F11.
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 85d076b8ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

keyTaken: () => boolean = () => false,
): void {
let changing = false;
target.addEventListener("keydown", (event) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle F11 while an embedded browser view has focus

On Windows/Linux desktop, the built-in browser focuses a separate child webview (studio/src-tauri/src/browser_webview.rs:1499-1500), and the main document loses keyboard focus to it (studio/frontend/src/features/browser/native-view.ts:849-851). Keydown events in that webview do not reach this main-renderer listener, and a search of the native and frame shortcut handlers found no F11 relay or accelerator. Consequently, entering fullscreen and then clicking a browser page makes F11-to-exit stop working until focus is moved back to Studio. Handle F11 at the native window level or relay it from the child views.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing this here: on Windows and Linux no Studio shortcut reaches the app while a browser page view has focus (page views are untrusted content with no key relay, and the native menus are macOS-only), so F11 matches every other app shortcut. Clicking anywhere in Studio's own UI brings it back. A relay out of page views would be its own change.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 85d076b8ac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

In fullscreen the custom Windows/Linux titlebar no longer takes a band:
content fills the screen and the bar slides back in over it when the
pointer touches the top edge (or focus moves into it), hiding again
once the pointer leaves. While fullscreen the bar cannot drag or
maximize the window, resize edges are dropped, and the maximize button
becomes Restore, leaving fullscreen.
@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e9f8517744

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +331 to +334
const reveal = useCallback(() => {
cancelHide();
setRevealed(true);
}, [cancelHide]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Hide the titlebar after an edge-only reveal

In desktop fullscreen, if the pointer grazes the 3px reveal edge and moves away before entering the sliding header—for example, onto a monitor above—this callback sets revealed to true without scheduling a hide. Neither hide trigger, the header's onPointerLeave or onBlur, runs in that sequence. The titlebar therefore stays open indefinitely over the top row of content until the user enters and leaves it again. Give edge-triggered reveals an initial hide timer, cancelling it when the header is actually hovered or focused.

Useful? React with 👍 / 👎.

@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4a0726b1d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +337 to +339
hideTimer.current = window.setTimeout(() => {
hideTimer.current = null;
setRevealed(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the fullscreen titlebar visible while it retains focus

On Windows/Linux fullscreen, moving the pointer out of the titlebar while one of its buttons retains keyboard focus calls scheduleHide() and unconditionally hides the bar after 400 ms. No blur or subsequent focus event occurs to cancel that timer, so the focused restore/close controls disappear offscreen despite the focus-triggered reveal behavior. Only hide the titlebar when neither hover nor focus remains inside it, checking those conditions again when the timer fires.

Useful? React with 👍 / 👎.

@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a710716ee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@wasimysaid

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 5b8b8d120e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@wasimysaid
wasimysaid merged commit e25b5d1 into unslothai:main Nov 12, 2026
danielhanchen added a commit that referenced this pull request Nov 12, 2026
…#17592)

## Summary

`Repo tests (CPU, studio)` fails on main since #17213, and on every PR
based on it (seen in staging runs for #17496 and #17557):

```
tests/studio/test_desktop_reliability_frontend_contract.py::test_fixed_sheets_start_below_the_custom_titlebar
E   assert 'set("--studio-custom-titlebar-height", usesCustomTitlebar ? "34px" : null)' in '...'
```

#17213 (F11 fullscreen) hides the custom titlebar in fullscreen, so the
`<html>` mirror in `provider.tsx` now reads:

```ts
const customTop = customTitlebarHidden ? "0px" : "34px";
set("--studio-custom-titlebar-height", usesCustomTitlebar ? customTop : null);
```

That is correct: in fullscreen the titlebar band is gone, and portalled
sheets should start at the top edge. The test pinned the old line
character for character, so it failed on a change that keeps everything
it was written to protect. The mirror is still there, and it still gives
34px whenever the titlebar shows.

## Change

`tests/studio/test_desktop_reliability_frontend_contract.py`:

- `_mirrored_titlebar_heights()` finds the
`set("--studio-custom-titlebar-height", usesCustomTitlebar ? <value> :
null)` call and resolves `<value>`. A string literal is read directly; a
local such as `customTop` is read from its `const` declaration.
- `test_fixed_sheets_start_below_the_custom_titlebar` now asserts that
the mirror exists, that it yields `34px`, and that it yields nothing
other than `34px` or the fullscreen `0px`. The rest of the test is
unchanged.
- `test_the_titlebar_mirror_reader_follows_a_local` covers the reader:
the old literal form, the new local form, and a different property that
must not match.

No app code changes.

## Testing

- `tests/studio/test_desktop_reliability_frontend_contract.py`: 46
passed (1 failed on main).
- With the mirror line removed from `provider.tsx`, the test fails. With
the shown height changed from `34px` to `30px`, it also fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Add a fullscreen mode on the desktop software.

3 participants