Skip to content

feat: add visual indicator for resources pending deletion#4704

Open
kajal-jotwani wants to merge 1 commit intokubernetes-sigs:mainfrom
kajal-jotwani:feat/show-deleting-resource-indicator
Open

feat: add visual indicator for resources pending deletion#4704
kajal-jotwani wants to merge 1 commit intokubernetes-sigs:mainfrom
kajal-jotwani:feat/show-deleting-resource-indicator

Conversation

@kajal-jotwani
Copy link

Summary

This PR adds a visual indicator for resources that are pending deletion. A red trash icon is shown next to resources that have a deletionTimestamp, making it clear they are in the process of being deleted.

Related Issue

Fixes #4573

Changes

  • Updated ResourceTable to detect deletionTimestamp
  • Added a red trash icon next to resources pending deletion
  • Ensured visibility works in both light and dark themes

Steps to Test

  1. Create a resource (e.g., a Service).
  2. Delete it while it has a finalizer (or simulate a delayed deletion).
  3. Return to the list view.
  4. Verify that a red trash icon appears next to the resource name while it is pending deletion.

Screenshots (if applicable)

image image

Notes for the Reviewer

  • [e.g., This touches the i18n layer, so please check language consistency.]

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kajal-jotwani
Once this PR has been reviewed and has the lgtm label, please assign joaquimrocha for approval. For more information see the 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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 13, 2026
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 13, 2026
@illume illume requested a review from Copilot February 13, 2026 18:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a UI affordance in the resource list table to make “pending deletion” resources (those with metadata.deletionTimestamp) visually distinct.

Changes:

  • Detects metadata.deletionTimestamp for each row in the name column.
  • Renders a trash-can icon (with tooltip) next to the resource name when deletion is pending.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +458 to +465
<LightTooltip title={t('translation|Deleting')}>
<Box component="span" sx={{ display: 'flex', color: 'text.secondary' }}>
<Icon
icon="mdi:trash-can-outline"
width="1rem"
height="1rem"
color={theme.palette.error.main}
/>
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

The columns are built inside a useMemo, but the memo dependency list doesn’t include theme (and the tooltip uses t(...)). This can cause the icon color / translated strings to stay stale when the user switches between light/dark theme or changes language. Include theme and the i18n dependency (e.g., t or i18n.language) in the useMemo deps so the column definitions recompute on those changes.

Copilot uses AI. Check for mistakes.
return (
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
{isDeleting && (
<LightTooltip title={t('translation|Deleting')}>
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

t('translation|Deleting') appears to rely on a "Deleting" translation key, but frontend/src/i18n/locales/*/translation.json don’t define a plain "Deleting" entry (only longer strings like "Deleting item {{ itemName }}…"). This will likely show the raw key in non-English locales. Reuse an existing translated string (e.g., "Deleting item…" with itemName) or add a dedicated key (e.g., "Deleting"/"Pending deletion") to the locale files.

Suggested change
<LightTooltip title={t('translation|Deleting')}>
<LightTooltip
title={t('translation|Deleting item {{ itemName }}…', {
itemName: row.original.metadata?.name ?? '',
})}
>

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

Thanks this.

Can you please check the git commit guidelines in the contributing guide and update the git commit message? See git log for examples.

I think the test failure is fixed in main branch. Can you please rebase against main?

@illume
Copy link
Contributor

illume commented Feb 13, 2026

@kajal-jotwani left a comment in the issue for your consideration

@kajal-jotwani kajal-jotwani force-pushed the feat/show-deleting-resource-indicator branch from 9d4ba7d to 500092e Compare February 13, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visual distinction for resources pending deletion

3 participants