Skip to content

feat: add summary section to workspace create/edit#966

Open
paulovmr wants to merge 1 commit intokubeflow:notebooks-v2from
paulovmr:workspace-create-summary
Open

feat: add summary section to workspace create/edit#966
paulovmr wants to merge 1 commit intokubeflow:notebooks-v2from
paulovmr:workspace-create-summary

Conversation

@paulovmr
Copy link

closes #959

demo-summary.webm

Signed-off-by: paulovmr <832830+paulovmr@users.noreply.github.com>
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from paulovmr. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot added the area/frontend area - related to frontend components label Mar 12, 2026
@google-oss-prow google-oss-prow bot added area/v2 area - version - kubeflow notebooks v2 size/XXL labels Mar 12, 2026
@caponetto
Copy link

/assign

@paulovmr
Copy link
Author

/ok-to-test

Copy link

@caponetto caponetto left a comment

Choose a reason for hiding this comment

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

Left a few comments inline, please check if they make sense. :)
Here are some things I noticed and wrote down to consider as FUP:

  1. When navigating back to the Workspace Kind selection step after completing subsequent steps, consider showing a confirmation dialog warning that changing the kind will reset all previous selections (image, pod config, properties). This would prevent accidental data loss. Only applicable to create mode though, since workspace kind cannot be changed in edit mode.

  2. The delayed hide on the summary redirect popover is a nice touch. It allows users to copy text and interact with the "Switch to" button. Two suggestions:

    1. Consider applying the same delayed-hide behavior to the redirect popovers on the Image and Pod Config selection cards in the grid view, for consistency.
    2. Extend the hover-sensitive area to cover the entire popover (including the header and close button). Currently, the popover can be dismissed before the cursor reaches those areas.
  3. Not blocking, but something to consider for a follow-up: the pencil (edit) icon on each summary card suggests inline editing, when it actually navigates to the corresponding wizard step. This could be slightly misleading, especially in edit mode for the Workspace Kind card, where clicking the icon navigates to a step where no change is allowed. A different icon (e.g., an arrow or "go to" indicator) or disabling the button for non-editable sections in edit mode might better communicate the intended action.


const DEFAULT_NAMESPACE = 'default';

describe.skip('Summary Redirect Popover - Delayed Hide Behavior', () => {

Choose a reason for hiding this comment

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

Can we add a ticket reference associated with the reason for skipping the entire test so we don't lose track of it?

createWorkspace.clickNext(); // Properties

// Find redirect icon in summary
cy.get('[data-testid="redirect-icon-1-new"]').should('exist');

Choose a reason for hiding this comment

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

Please replace all occurrences of cy.get('[data-testid=" with cy.findByTestId(.


// Hover to show popover
cy.get('[data-testid="redirect-icon-1-new"]').trigger('mouseenter');
cy.get('.pf-v6-c-popover').should('be.visible');

Choose a reason for hiding this comment

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

Can we use data-testid instead of cy.get('.pf-v6-c-popover') (this could match with unwanted other things)?

it('should apply workspace-option-card__header--with-icons class to cards with hidden flag', () => {
createWorkspace.checkExtraFilter('showHidden');

cy.get('#hidden-image .pf-v6-c-card__header').should(

Choose a reason for hiding this comment

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

Consider using data-testid (entire file)

Comment on lines +125 to +138
it('should hide popover after 1 second if mouse does not enter popover', () => {
createWorkspace.clickNext(); // Pod config
createWorkspace.clickNext(); // Properties

// Hover to show popover
cy.get('[data-testid="redirect-icon-1-new"]').trigger('mouseenter');
cy.get('.pf-v6-c-popover').should('be.visible');

// Move mouse away from icon
cy.get('[data-testid="redirect-icon-1-new"]').trigger('mouseleave');

// Popover should be hidden after delay (using clock.tick would require cy.clock() setup)
cy.get('.pf-v6-c-popover', { timeout: 2000 }).should('not.be.visible');
});

Choose a reason for hiding this comment

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

This is maybe a nitpick but I believe tests should tell a story that is simple to read. Complexity should be moved to page objects. It also avoids the need to add comments on every line.

Example:

createWorkspace.hoverPopover...
createWorkspace.assertPopoverVisible(true)
createWorkspace.moveMouseAway...
createWorkspace.assertPopoverVisible(false)

@@ -0,0 +1,654 @@
import React, { useCallback, useState, useRef, useEffect } from 'react';

Choose a reason for hiding this comment

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

Consider extracting the diff rendering, the properties section, and the normalizeLabels helper into separate components or utility functions to improve readability and testability.

};
onClickTarget: () => void;
}) => React.ReactNode;
hideTimeoutRef: React.MutableRefObject<NodeJS.Timeout | null>;

Choose a reason for hiding this comment

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

There are 6 occurrences of // eslint-disable-next-line no-param-reassign to mutate ref .current values. While mutating refs is legitimate in React, the pattern of passing refs as props and mutating them from a child component is unusual. Consider managing the hideTimeoutRef and isHoveringPopoverRef state internally within WorkspaceFormSummaryPanel (where the refs are owned) and passing down only the necessary callbacks, which would eliminate the need for these lint suppressions entirely.

Copy link

@thaorell thaorell left a comment

Choose a reason for hiding this comment

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

Hi Paulo, thank you for the work. The summary section is very helpful to recap information. There are two issues I want to highlight:

  • The right side panel could contain a lot of information that needs to be displayed (For example, an Image that has a very long description about the image, or PodConfig with a lot of hardware information). We could make Summary an additional step in the WorkspaceForm component (at least for Workspace Create), and the cards should be clickable card that navigates the user back to the Step they click on. That way, there is more real estate on the Summary page (maybe even a YAML view in the future)
  • The OLD vs NEW section is very valuable on Edit, but comparisons are usually done side by side. We could consider a Split layout for better comparison view


return (
<StackItem key={step}>
<Card isCompact>

Choose a reason for hiding this comment

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

Consider a clickable card instead of the Pencil Icon button

</StackItem>
<Divider />
{/* OLD section */}
<StackItem>

Choose a reason for hiding this comment

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

For a side-by-side comparison, consider using Split instead of Stack, because it is easier to translate and compare the information.

{/* OLD section */}
<StackItem>
<Content component={ContentVariants.p}>
<strong>OLD:</strong>

Choose a reason for hiding this comment

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

<strong>Current:</strong>

{/* NEW section */}
<StackItem>
<Content component={ContentVariants.p}>
<strong>NEW:</strong>

Choose a reason for hiding this comment

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

<strong>Current:</strong>

</StackItem>
{redirect.message?.text && <StackItem>{redirect.message.text}</StackItem>}
<StackItem>
<Button

Choose a reason for hiding this comment

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

I would consider not having the Button in the Popover, actions should be performed after the user navigates back to the Step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/frontend area - related to frontend components area/v2 area - version - kubeflow notebooks v2 ok-to-test size/XXL

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

3 participants