-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PWA] Make use of the Window Controls Overlay feature to display menus in the title bar area #140694
Comments
Pinging @digitarald who, I think, is looking at the PWA features right now. |
Fyi @sbatten |
Very much aligned with @sbatten's work of adding UI to the titlebar; and eventually optimizing that work for PWA. |
Any new information about this? WCO support would be amazing! |
Related: #127449 |
I did a quick test. With only a little code change it already looks and works great. It really gives the feeling of native applications, if ignoring the two extra buttons at top-right added by the browser. One remaining issue is that the title bar height is hardcoded now, it needs to be retrieved at runtime but I don't know how. EDIT: also need to add support for old browsers without WCO. |
Wow nice 👏 |
You can use the new CSS environment variables for this. In particular In fact, if you use these variables, you'll be able to position your menubar and other elements correctly across operating systems (including on Mac where the close/min/max buttons are on the left side).
Yeah, these buttons are annoying when you want to achieve a "native" look. There's work going on right now about this. @diekus will surely be interested in this feedback as I know he's thinking about ways to get rid of the "chevron" icon. |
I know how to use WCO in general. The issue is integrating it with vscode. Code has its own layout system in JavaScript, so the title bar height must be known in code. I can get it from On contrast, Code already has support for self-rendered window controls and Electron's WCO integration. In both modes the window controls region size won't change (except by using built-in commands like My current changes are here: https://github.com/microsoft/vscode/compare/main...yume-chan:pwa-wco?expand=1, the solution I'm thinking is adding all the |
WCO also needs to be enabled in the browser. At least in edge, they are disabled by default. |
It's coming very soon. Hope to have some news to share in some days! Once we have a timeframe, I am more than happy to help in any way to bring WCO to the the code PWA. |
@yume-chan curious, what was the change you did in #140694 (comment) to make it work? |
My branch is at https://github.com/yume-chan/vscode/tree/pwa-wco (it's now conflicting with main). |
This is now enabled on https://insiders.vscode.dev. In Edge, make sure you enable the Desktop PWA Window Controls Overlay flag by visiting @sbatten Should this look a little bit better? |
That's incredible news! Window Controls Overlay is now on by default in Chromium 105, so no flag needed! Congratulations @joaomoreno and team! |
@joaomoreno, yep, I thought I resolved this but I will force the title bar on and move the compact menu when in PWA mode as mentioned here |
This is great to see! Amazing progress. Just one detail: |
@captainbrosset i have a fix going in today that should move the banner below the titlebar (like it is in desktop) when the WCO are shown. |
While this is generally done, macos web still has issues, so moving to December to resolve |
Loving the work on this feature. I'm running into some issues on the latest Insider Preview Running on Chrome/ChromeOS 107.0.5304.110 |
What happened to this issue? It looked close to shipping but never did? |
It's live for me! On Chrome, look for an "up" Chevron near the window controls |
Oh, I do see it in Edge on Windows 11. Must be a local configuration difference! |
Ok, I see the difference. I'm using Mine (
What I'd expect: vscode/resources/server/manifest.json Lines 6 to 8 in 10b819f
Do we know why the build it downloads has the older manifest.json? |
you have to zoom in to make it look even |
@leifwalsh this is a very good catch, looks like we are missing to set |
Awesome, thank you! Looking forward to the extra couple lines of editor space! :) |
@leifwalsh with todays insider, this landed. Can you maybe verify? |
yep, we see it, thank you! |
The Window Controls Overlay PWA feature is coming out of origin trial and is shipping with Chrome/Edge 98.
To learn more about it, here are a few resources:
In short, it allows PWAs installed on desktop OSes to regain control of the area normally reserved for the standard title bar. With it, the maximize/minimize/close/pwa buttons appear as overlays on top of the web content, and the rest of the title bar is gone.
It comes with a JS API and some CSS variables that help PWA make efficient use of the regained space.
Using this, the VS Code PWA could display its title bar at the top of the window, just like in its native version.
The hamburger menu version of it could still be used when the title bar area is too narrow (which is easy to detect with the ongeometrychange event).
The text was updated successfully, but these errors were encountered: