Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ table in [Console dynamic plugins README](./README.md).
## 4.23.0-prerelease.3 - TBD

- Added `@openshift/api-types` as a dependency and replaced `K8sResourceCommon` and depdendent types with imports from that package ([CONSOLE-5355], [#16585])
- Add optional `drawerGroup`, `skipOverflow`, and `persistInDrawer` fields to `ToastOptions` ([CONSOLE-5361], [#16636])

## 4.23.0-prerelease.2 - 2026-05-27

Expand Down Expand Up @@ -231,6 +232,7 @@ table in [Console dynamic plugins README](./README.md).
[CONSOLE-5108]: https://issues.redhat.com/browse/CONSOLE-5108
[CONSOLE-5273]: https://issues.redhat.com/browse/CONSOLE-5273
[CONSOLE-5355]: https://issues.redhat.com/browse/CONSOLE-5355
[CONSOLE-5361]: https://issues.redhat.com/browse/CONSOLE-5361
[OCPBUGS-19048]: https://issues.redhat.com/browse/OCPBUGS-19048
[OCPBUGS-30077]: https://issues.redhat.com/browse/OCPBUGS-30077
[OCPBUGS-31355]: https://issues.redhat.com/browse/OCPBUGS-31355
Expand Down Expand Up @@ -316,3 +318,4 @@ table in [Console dynamic plugins README](./README.md).
[#16400]: https://github.com/openshift/console/pull/16400
[#16491]: https://github.com/openshift/console/pull/16491
[#16585]: https://github.com/openshift/console/pull/16585
[#16636]: https://github.com/openshift/console/pull/16636
3 changes: 2 additions & 1 deletion frontend/packages/console-dynamic-plugin-sdk/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3183,7 +3183,8 @@ const Component: React.FC = (props) => {
addToast({
title: 'Success',
variant: 'success',
content: 'Operation completed successfully.'
content: 'Operation completed successfully.',
drawerGroup: 'Operations',
});
};
return <button onClick={handleClick}>Show Toast</button>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,23 @@ The UI displays tabs in priority order from highest to lowest. Default built-in

## Changes to shared modules and API

This release introduces no changes to shared modules.
- Console caps visible toast alerts (default 3) with an overflow link to the notification drawer. Toast history is persisted in the drawer with read/unread state and management actions. ([CONSOLE-5361])
- `ToastOptions` accepts optional `drawerGroup` string to group toast notifications into named sections in the notification drawer. When omitted, toasts appear in the built-in default group, displayed as **Other Alerts** (translated by Console). Custom `drawerGroup` values are shown as-is; plugins are responsible for translating their own group names if needed. ([CONSOLE-5361])
- `ToastOptions` accepts optional `skipOverflow` (default `false`) to exclude a toast from the visible toast cap and overflow link. ([CONSOLE-5361])
- `ToastOptions` accepts optional `persistInDrawer` (default `true`) to show a toast on screen only without persisting it in the notification drawer when set to `false`. Setting `persistInDrawer` to `false` implies `skipOverflow: true`. ([CONSOLE-5361])

### Example: grouping toasts in the notification drawer

```tsx
const { addToast } = useToast();

addToast({
title: 'Upload complete',
variant: 'success',
content: 'disk.img uploaded successfully.',
drawerGroup: 'Uploads',
});
```

[CONSOLE-4946]: https://issues.redhat.com/browse/CONSOLE-4946
[CONSOLE-5361]: https://issues.redhat.com/browse/CONSOLE-5361
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,8 @@ export const useActivePerspective: UseActivePerspective = require('@console/dyna
* addToast({
* title: 'Success',
* variant: 'success',
* content: 'Operation completed successfully.'
* content: 'Operation completed successfully.',
* drawerGroup: 'Operations',
* });
* };
* return <button onClick={handleClick}>Show Toast</button>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,21 @@ export type ToastOptions = {
onRemove?: (id: string) => void;
/** Callback to run when toast is dismissed with close button */
onClose?: () => void;
/** Optional group name for the notification drawer section. Omit to use the built-in default group (displayed as "Other Alerts"). Custom values are shown as-is and are not translated by Console. */
drawerGroup?: string;
/**
* When `true`, the toast is excluded from the visible toast cap and overflow link.
* Defaults to `false`.
* When `persistInDrawer` is `false`, this is always treated as `true`.
*/
skipOverflow?: boolean;
/**
* When `false`, the toast is shown on screen only and is not persisted in the notification drawer.
* Implies `skipOverflow: true` — ephemeral toasts must remain visible because they are not
* recoverable from the drawer when hidden by overflow.
* Defaults to `true`.
*/
persistInDrawer?: boolean;
};

export type ToastContextValues = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createContext } from 'react';
import type { NotificationHistoryContextValues } from './types';

export const NotificationHistoryContext = createContext<NotificationHistoryContextValues>(
{} as NotificationHistoryContextValues,
);
Loading