-
Notifications
You must be signed in to change notification settings - Fork 1.2k
shell: Show some pages in fullscreen #21670
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
Draft
mvollmer
wants to merge
1
commit into
cockpit-project:main
Choose a base branch
from
mvollmer:shell-fullscreen
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
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
ed77057
to
918cc5b
Compare
cockpituous
reviewed
Mar 6, 2025
let fs = this.current_manifest.fullscreen; | ||
const path_prefix = location.path.split("/", 1)[0]; | ||
if (Array.isArray(fs)) | ||
fs = { "": fs }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
if (Array.isArray(fs)) | ||
fs = { "": fs }; | ||
for (const path_suffix in fs) { | ||
if ((path_suffix == "" && path_prefix == location.path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This added line is not executed by any test.
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.
The Machines application of Cockpit lets people interact with the graphical console of a virtual machine. This is useful for baby sitting a VM through its boot process or doing the occasional rescue work, but it might also be used to do real day-to-day work in a graphical desktop environment that runs in the VM.
The graphical console in Cockpit Machines is fundamentally limited by having to run in a browser. The browser might eat some keys, for example, and serious work might thus require a external viewer application such as GNOME Connections, TigerVNC, or virt-viewer. Nevertheless, we should make Cockpit's own viewer work as well as possible.
One aspect of improving our own viewer is to give more space to the actual console, and less to Cockpit's own UI. Cockpit Machines can already "expand" the console to fill most of the content iframe.
Purpose
The purpose of this task is to make it possible to remove as much of the Shell UI elements that normally surround the content iframe as possible when people are interacting with the expanded view of a VM console.
Demo: https://youtu.be/9kDEZkvI2eo
This needs a change to the cockpit-machines manifest to recreate the demo. There is also a new "fullscreen" playground.
Some questions:
Should every page be able to go fullscreen? Then we need a reliable way to get out of fullscreen again, and can't rely on the page to offer it itself. We always need to show a little bit of Shell UI with a "go back to normal" action in it. We of course also need to find a place for the "go fullscreen" action.
Should fullscreen-ness be part of the navigation state? If you click on something that make the shell go fullscreen, and then you click on the Browser back button, do you go back to normal mode?
If we have a "go fullscreen" action in the Shell itself and you activate that on the details page for a VM, should the page automatically switch to showing only the console? I don't think we can do that since people might want to use all of Machines fullscreen, including the details page. So we would have two "go fullscreen" actions that behave differently. (One in the Shell, one in the Console card.) I think that can be ok.
Likewise, we would have two "go normal" buttons when the console has been expanded: the one in the Shell would just add the Shell chrome back around the expanded console, the one in the expanded console would also navigate back to the details page. This gets confusing, no?
To avoid answering these questions, the current code here does not add a general "any page can be fullscreen" feature to the Shell. Only specific pages will (always) be fullscreen, and those pages are expected to have a "back to normal" action.