Skip to content
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

consoles: Redesign #2008

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Conversation

mvollmer
Copy link
Member

@mvollmer mvollmer commented Jan 30, 2025

Design: #2074

Demo: https://www.youtube.com/watch?v=Y3Q3QcBU8vs

Questions:

  • Where should the "send key" and "disconnect" actions go?
  • Is the (?) button plus popover ok?
  • Is it ok to completely ignore spice when there is vnc?
  • How should the expanded view look?

The demo has outdated placements of some UI elements to get more space for the expanded console (and to follow the original mockup more closely):

  • Toggle buttons are left aligned now.
  • Kebab is at the top next to toggle buttons now.
  • "Launch viewer" button is at the right now.
  • Expanded view has no "Launch viewer" button now

Up-to-date screenshots:

image

image

image

image

@mvollmer mvollmer force-pushed the console-redesign branch 2 times, most recently from f65bf5f to ace6a87 Compare February 14, 2025 10:27
@mvollmer mvollmer removed the blocked label Feb 14, 2025
@mvollmer mvollmer force-pushed the console-redesign branch 3 times, most recently from 165110f to 4f73613 Compare February 17, 2025 14:05
@mvollmer mvollmer force-pushed the console-redesign branch 2 times, most recently from 5137d12 to 8128512 Compare February 17, 2025 14:34
@mvollmer mvollmer force-pushed the console-redesign branch 2 times, most recently from a363668 to ae64118 Compare February 18, 2025 08:24
@mvollmer mvollmer force-pushed the console-redesign branch 2 times, most recently from 5c2254e to caadd56 Compare March 6, 2025 14:51
@mvollmer mvollmer force-pushed the console-redesign branch 5 times, most recently from a192cf0 to 5c63980 Compare March 24, 2025 12:22
@mvollmer
Copy link
Member Author

We should build this all up from scratch without react-console. This means writing our own NoVNC React wrapper. That's very feasible and worth it, IMO, but can be done separately.

The move to PF6 makes this more important. React-console 6.0.0 uses inline CSS and generated class names, both of which is problematic for us.

@mvollmer mvollmer mentioned this pull request Mar 27, 2025
@mvollmer mvollmer removed the no-test label Mar 27, 2025
// a pending shutdown.
//
if (inactive_vnc.port != -1 && active_vnc.port != inactive_vnc.port)
return true;
Copy link
Contributor

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.

return true;

if (active_vnc.password != inactive_vnc.password)
return true;
Copy link
Contributor

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.

Comment on lines +35 to +36
if (app.startsWith("cockpit+=")) {
address = app.substr(9);
Copy link
Contributor

Choose a reason for hiding this comment

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

These 2 added lines are not executed by any test.

Comment on lines +176 to +179
.catch(ex => onAddErrorNotification({
text: cockpit.format(_("Failed to add text console to VM $0"), vm.name),
detail: ex.message,
resourceId: vm.id,
Copy link
Contributor

Choose a reason for hiding this comment

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

These 4 added lines are not executed by any test.

}

export function useStateObject(constructor, deps, comps) {
const state = useObject(constructor, obj => obj.close(), deps || [], comps);
Copy link
Contributor

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.

{ applyError &&
<ModalError dialogError={applyError} dialogErrorDetail={applyErrorDetail} />
}
<Form onSubmit={e => e.preventDefault()} isHorizontal>
Copy link
Contributor

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.

Comment on lines +224 to +229
.catch(ex => onAddErrorNotification({
text: cockpit.format(_("Failed to send key Ctrl+Alt+$0 to VM $1"), keyName, vm.name),
detail: ex.message,
resourceId: vm.id,
Copy link
Contributor

Choose a reason for hiding this comment

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

These 4 added lines are not executed by any test.

{ state.connected
? <VncConsole
host={window.location.hostname}
port={window.location.port || (encrypt ? '443' : '80')}
Copy link
Contributor

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.

encrypt={encrypt}
shared
credentials={this.credentials}
vncLogging={ window.debugging?.includes("vnc") ? 'debug' : 'warn' }
Copy link
Contributor

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.

Comment on lines +449 to +451
.catch(ex => onAddErrorNotification({
text: cockpit.format(_("Failed to add VNC to VM $0"), vm.name),
detail: ex.message,
resourceId: vm.id,
Copy link
Contributor

Choose a reason for hiding this comment

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

These 4 added lines are not executed by any test.

mvollmer and others added 10 commits March 28, 2025 14:41
Except the console.
- Remove "isClickable" and "isSelectable" from all Cards.

  Only two of our cards are actually clickable, and they contain
  buttons which conflicts with the "isClickable" property.  For those,
  we remove all card clickability and force people to click on the
  buttons only.

  This gives all Cards a border.

- Remove the border of the "main" Cards of a page by making them
  "plain".  This is the lists of VMs, storage pools, and networks.
This is unsatisfying because of the way react-console styles
itself now:

 - It generates class names at run time.

 - It inserts <style> elements into the DOM, which would force us to
   open up our Content-Security-Policy via "style-src-elem
   'unsafe-inline'".  Instead, we have a copy of their CSS in our
   code.  That way, we can also apply some bug fixes more cleanly.

We should stop using react-console eventually.
So that we have a single place to style them.
They should extend to the edges of the card, not have a line after the
last row, but do have a line after the header.
@mvollmer mvollmer force-pushed the console-redesign branch 3 times, most recently from 45f1f50 to cf185c5 Compare March 28, 2025 15:44
- A ToggleGroup in the Card header is used to switch consoles

- The console switcher is also there for shut-off machines. This gives
  us a place for type-specific actions that also make sense for a
  shut-off machine, like editing VNC server settings.

- The DesktopViewer is gone, but there is a footer with a "Launch
  viewer" button and a "How to connect" popover.

- Actions for the Graphics and Serial consoles are collected into
  kebab menus.

- The expanded console has less UI around it, and it keeps the type
  that was active in the collapsed view. Instead of the breadcrumb it
  has a "Collapse" button.

- When there is no actual console for a given type, there is now a
  EmptyState component where you can enable it.

- It is possible to change VNC server settings via the "How to
  connect" popup.

- The SPICE console invites you to replace it with VNC.

- The size of the expanded console is now always controlled by the
  browser window and never overflows in height.

- The VncConsole has been imported from @patternfly/react-console and
  stripped down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants