spring-boot-admin icon indicating copy to clipboard operation
spring-boot-admin copied to clipboard

Bug: Audit log shakes on refresh

Open cdprete opened this issue 9 months ago • 2 comments

Spring Boot Admin Server information

  • Version: 4.0.1

  • Spring Boot version: 4.0.3

  • Configured Security: None

  • Webflux or Servlet application: WebFlux

Client information

  • Spring Boot versions: 4.0.3

  • Used discovery mechanism: Eureka

  • Webflux or Servlet application: Servlet

Description

Hello. It seems like that the Audit Log view shakes shortly on the right side every time it gets updated. See the gif below:

Image

It's not urgent at all from my point of view, but it would be nice to get it fixed.

cdprete avatar Mar 04 '26 06:03 cdprete

Analysis and Fix

The shaking is caused by a layout shift triggered by the loading spinner overlay being inserted/removed from the DOM on every 5-second poll cycle.

Root Cause

In views/instances/auditevents/index.vue, fetchAuditevents() unconditionally sets isLoading = true on every periodic refresh:

async fetchAuditevents() {
  this.isLoading = true;  // triggers every 5 seconds
  ...
}

sba-instance-section renders a loading spinner overlay (position: absolute, height: 100vh) when loading is true. This overlay is added to and removed from the DOM every poll cycle. The DOM insertion can cause a brief scrollbar appearance/disappearance, producing the horizontal layout shift (the "shake" on the right side).

Fix

Only show the loading state when there are no events yet (initial load or after a filter change clears the list):

this.isLoading = this.events.length === 0;

Periodic refreshes with existing data no longer toggle the loading state, eliminating the DOM churn that causes the shake.

PR: #5211

herley-shaori avatar Mar 29 '26 03:03 herley-shaori

Hello @herley-shaori.

I left some comments in the PR ;) @SteKoe please have a look at them as well ;)

cdprete avatar Mar 29 '26 10:03 cdprete