Skip to content

fix: confirm delete on Enter in DeleteModal (#918) and cleanup MUI theme logic#970

Open
Snehadas2005 wants to merge 2 commits intokubeflow:notebooks-v2from
Snehadas2005:pf-ui-fix-v2
Open

fix: confirm delete on Enter in DeleteModal (#918) and cleanup MUI theme logic#970
Snehadas2005 wants to merge 2 commits intokubeflow:notebooks-v2from
Snehadas2005:pf-ui-fix-v2

Conversation

@Snehadas2005
Copy link

Description
This PR addresses the bug reported in issue #918 regarding the workspace deletion workflow and completes a comprehensive cleanup of defunct MUI theme logic as requested during previous review cycles.

Key Fixes

  • Fix for Issue Workspace delete modal: pressing Enter causes full page refresh instead of deleting #918: Resolved the bug where pressing the "Enter" key in the Delete Modal's confirmation input caused a full page refresh. Added an onSubmit handler with e.preventDefault() to the form, ensuring that hitting Enter triggers the deletion logic directly.
  • MUI Theme & Dark Mode Removal: Following feedback, I have removed all local MUI theme logic, isMUITheme conditionals, and associated styling overrides. These are now handled via mod-arch libraries.

Why this new branch (pf-ui-fix-v2)?
This branch provides a clean, consolidated state for these changes. The previous PR (on the temp3 branch) had a complex history due to theme experiments and DCO fix attempts. Starting fresh ensures a clean git history with no lingering merge artefacts or unrelated file changes (fixing the "133 files changed" issue).

Detailed Changes

  • DeleteModal.tsx: Added onSubmit to prevent refresh; removed useThemeContext.
  • NavBar.tsx: Reverted ToolbarGroup order and removed MUI dependencies.
  • NavSidebar.tsx: Removed conditional MUI logo rendering.
  • SecretsCreateModal.tsx: Removed MUI-specific classes from MenuToggle.
  • WorkspaceKindFormResource.tsx: Cleaned up MUI layout classes.
  • ThemeAware wrappers: Simplified to always render standard PatternFly components.
  • app.css: Removed all .mui-theme selectors and overrides.
  • File Cleanups: Deleted MUI-theme.scss, ThemeContext.tsx, useThemeContext.ts, and EditableLabels.tsx.

How to Test

  1. Delete Modal: Open the delete workspace modal, type the resource name, and press Enter. It should initiate deletion without a page refresh.
  2. UI Verification: Verify Navbar, Sidebar, and Forms render correctly using standard PatternFly.
  3. Clean DOM: Confirm no .mui-theme classes are applied in the inspector.

Checklist

…and cleanup MUI theme logic

Signed-off-by: Sneha Das <154408198+Snehadas2005@users.noreply.github.com>
@github-project-automation github-project-automation bot moved this to Needs Triage in Kubeflow Notebooks Mar 18, 2026
@google-oss-prow google-oss-prow bot added the area/frontend area - related to frontend components label Mar 18, 2026
@google-oss-prow google-oss-prow bot requested review from ederign and paulovmr March 18, 2026 04:58
@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 assign paulovmr for approval. 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 area/v2 area - version - kubeflow notebooks v2 size/L labels Mar 18, 2026
@Snehadas2005 Snehadas2005 changed the title fix(frontend): confirm delete on Enter in DeleteModal (#918) and cleanup MUI theme logic fix: confirm delete on Enter in DeleteModal (#918) and cleanup MUI theme logic Mar 18, 2026
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 @Snehadas2005,
what issues are you experiencing with Material UI? As part of the larger Kubeflow community, we are expected to apply Material UI theme to be compliant when it comes to integrating to the Dashboard. Additionally, the MUI changes are breaking our tests. For these reasons, we kindly ask you open an issue and extract all the MUI related code to another PR.

We can keep the e.preventDefault() in the DeleteModal, however.

<Form>
<Form
onSubmit={(e) => {
e.preventDefault();

Choose a reason for hiding this comment

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

Like this

@Snehadas2005
Copy link
Author

Hi @thaorell, thank you for the feedback! I understand the requirement for MUI compliance with the Dashboard.

I will revert the MUI/Theme cleanup from this branch and keep only the e.preventDefault() fix for the DeleteModal as requested. I will open a separate issue/PR to discuss the MUI integration further so we can ensure the tests pass and the theme stays compliant.

I will update this PR shortly with only the fix for #918.

Signed-off-by: Sneha Das <154408198+Snehadas2005@users.noreply.github.com>
@google-oss-prow google-oss-prow bot added size/S and removed size/L labels Mar 20, 2026
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.

Hey @Snehadas2005, some of the MUI changes are still present. Please consider removing them from the modal

import { FlexItem } from '@patternfly/react-core/dist/esm/layouts/Flex';
import { HelperText, HelperTextItem } from '@patternfly/react-core/dist/esm/components/HelperText';
import { default as ExclamationCircleIcon } from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
import { useThemeContext } from 'mod-arch-kubeflow';

Choose a reason for hiding this comment

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

Can you revert this change?

const [inputValue, setInputValue] = useState('');
const [isDeleting, setIsDeleting] = useState(false);
const [error, setError] = useState<string | ApiErrorEnvelope | null>(null);
const { isMUITheme } = useThemeContext();

Choose a reason for hiding this comment

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

This as well

<ModalHeader title={title} titleIconVariant="warning" />
<ModalBody>
<Stack hasGutter={!isMUITheme}>
<Stack hasGutter>

Choose a reason for hiding this comment

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

Same here

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 size/S

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants