Skip to content

feat: add activity warning indicators and toast notifications - #1338

Open
thaorell wants to merge 1 commit into
kubeflow:notebooks-v2from
thaorell:1203_culling_notifications
Open

feat: add activity warning indicators and toast notifications#1338
thaorell wants to merge 1 commit into
kubeflow:notebooks-v2from
thaorell:1203_culling_notifications

Conversation

@thaorell

Copy link
Copy Markdown

Add warning/critical visual indicators on workspace table rows when a workspace approaches its auto-pause threshold, plus toast notifications on state transitions. Warnings clear automatically when the next data refresh shows updated activity.

closes: #1203
Screenshot 2026-08-19 at 3 24 23 PM
Screenshot 2026-08-19 at 2 19 54 PM

@github-project-automation github-project-automation Bot moved this to Needs Triage in Kubeflow Notebooks Aug 20, 2026
@google-oss-prow google-oss-prow Bot added the area/frontend area - related to frontend components label Aug 20, 2026
@google-oss-prow

Copy link
Copy Markdown

[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 the area/v2 area - version - kubeflow notebooks v2 label Aug 20, 2026
@thaorell thaorell changed the title feat(frontend): add activity warning indicators and toast notificatio… feat(frontend): add activity warning indicators and toast notifications Aug 20, 2026

@christian-heusel christian-heusel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@thaorell I think you need to drop the conventional commit scope from the title to make the action happy 😅

-feat(frontend): add activity warning indicators and toast notifications
+feat: add activity warning indicators and toast notifications

@thaorell thaorell changed the title feat(frontend): add activity warning indicators and toast notifications feat: add activity warning indicators and toast notifications Aug 20, 2026
…ns (kubeflow#1203)

Add warning/critical visual indicators on workspace table rows when a
workspace approaches its auto-pause threshold, plus toast notifications
on state transitions. Warnings clear automatically when the next data
refresh shows updated activity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Charles Thao <cthao@redhat.com>
@thaorell
thaorell force-pushed the 1203_culling_notifications branch from c0afa79 to 2af876b Compare August 20, 2026 15:54
@christian-heusel christian-heusel added this to the v2.0.0-beta.1 milestone Aug 25, 2026

@christian-heusel christian-heusel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This already looks quite good, I gave it a quick review 😊

Comment on lines +159 to +160
const ACTIVITY_WARNING_THRESHOLD_MS = 15 * 60 * 1000;
const ACTIVITY_CRITICAL_THRESHOLD_MS = 5 * 60 * 1000;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not sure whether we can actually make this warning fixed given the potentially quite different horizons on the activityRules side 🤔

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

is there a planned task to provide some kind of threshold in the API return data? These limits are detailed in #1203

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Then disregard the comment, I'll re-start the discussion in case this actually becomes an error.

Comment on lines +198 to +200
if (ms <= 0) {
return 'less than a minute';
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do not understand what the logic in this code snipping is doing 😅

Comment on lines +31 to +52
if (!isFirstRenderRef.current) {
for (const ws of workspaces) {
const key = workspaceKey(ws);
const status = statusByKey.get(key)!;
const currentLevel = currentLevels.get(key) ?? ActivityWarningLevel.None;
const prevLevel = prevLevelsRef.current.get(key) ?? ActivityWarningLevel.None;

if (currentLevel === ActivityWarningLevel.None || currentLevel === prevLevel) {
continue;
}

const isEscalation =
prevLevel === ActivityWarningLevel.None || prevLevel === ActivityWarningLevel.Warning;

if (isEscalation) {
const timeStr =
status.timeRemainingMs != null ? formatTimeRemaining(status.timeRemainingMs) : 'soon';
const action = status.actionMessage ?? 'paused';
notification.warning(`Workspace "${ws.name}" will be ${action} in ${timeStr}`);
}
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do I understand correctly that in order for this to fire the page has to stay open? 🤔

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/XL

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

2 participants