Skip to content

feat(#5504): customizable browser notifications - #5584

Open
abhiramaab wants to merge 1 commit into
codecentric:masterfrom
abhiramaab:feat/customizable-notifications
Open

feat(#5504): customizable browser notifications#5584
abhiramaab wants to merge 1 commit into
codecentric:masterfrom
abhiramaab:feat/customizable-notifications

Conversation

@abhiramaab

Copy link
Copy Markdown

Summary

  • Add spring.boot.admin.ui.browser-notification-timeout (default 5000ms; 0 disables auto-dismiss)
  • Use configured timeout in browser notifications instead of hardcoded 5s
  • Click notification to open instance details when the status change maps to a single instance

Test plan

  • Set browser-notification-timeout: 0 — notification stays until dismissed
  • Set browser-notification-timeout: 10000 — notification auto-dismisses after 10s
  • Single-instance app status change — click opens /instances/{id}/details
  • npm test -- --run notifications.spec.ts passes

Copilot AI review requested due to automatic review settings August 2, 2026 18:24
@abhiramaab
abhiramaab requested a review from a team as a code owner August 2, 2026 18:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds configurability and richer UX to Spring Boot Admin UI browser notifications by exposing a server-side timeout setting to the frontend and using it when creating Notification instances, plus enabling click-through navigation to instance details when a status change can be attributed to a single instance.

Changes:

  • Introduces spring.boot.admin.ui.browser-notification-timeout (default 5000ms; 0 disables auto-dismiss) and wires it into UiController.Settings.
  • Frontend: uses the configured timeout (instead of a hardcoded 5s) and adds logic to derive a single affected instance for click navigation.
  • Adds Vitest coverage for URL/id selection helpers and a Spring MVC test asserting settings exposure.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spring-boot-admin-server-ui/src/test/java/de/codecentric/boot/admin/server/ui/web/UiControllerTest.java Adds a test to ensure the browser notification timeout is present in uiSettings model.
spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/web/UiController.java Extends UiController.Settings with browserNotificationTimeout.
spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiProperties.java Adds the new configuration property with default (5000ms) and Javadoc.
spring-boot-admin-server-ui/src/main/java/de/codecentric/boot/admin/server/ui/config/AdminServerUiAutoConfiguration.java Maps the new property into UiController.Settings.
spring-boot-admin-server-ui/src/main/frontend/sba-config.ts Adds browserNotificationTimeout to the default UI settings config.
spring-boot-admin-server-ui/src/main/frontend/notifications.ts Uses configured timeout and adds click-to-open-instance-details behavior.
spring-boot-admin-server-ui/src/main/frontend/notifications.spec.ts Adds unit tests for helper functions introduced in notifications.ts.
spring-boot-admin-server-ui/src/main/frontend/global.d.ts Extends the UISettings type with browserNotificationTimeout.

Comment on lines 19 to +31
import { HealthStatus } from './HealthStatus';
import Application from './services/application';
import sbaConfig from './sba-config';

let granted = false;

type BrowserNotificationOptions = NotificationOptions & {
timeout?: number;
url?: string;
};

export const buildInstanceDetailsUrl = (instanceId: string) =>
`/instances/${instanceId}/details`;
Comment on lines +32 to +34
it('builds instance details path', () => {
expect(buildInstanceDetailsUrl('abc123')).toBe('/instances/abc123/details');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants