Skip to content

NMS-18978: Don't load ui-components menu assets on login and password gate; fix wallpaper edge gap - #8900

Open
synqotik wants to merge 2 commits into
developfrom
jira/NMS-18978-ui-components-ref-on-login-smoke
Open

synqotik wants to merge 2 commits into
developfrom
jira/NMS-18978-ui-components-ref-on-login-smoke

Conversation

@synqotik

@synqotik synqotik commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

NMS-18978: Don't load ui-components menu assets on login and password gate; fix wallpaper edge gap

The ui-components CSS and JS, which are used for the menu/sidemenu that appear on JSP pages, were included in the JSP login and password gate pages, even though there's no menu on those pages.

This removes those references so those 2 pages are cleaner. There's a small tradeoff where the menu assets won't be loaded until the user logs in and gets to the main page vs. having already been cached, but this seems like a reasonable one-time-per-session tradeoff.

Also, fixed an edge gap with the OpenNMS Horizon wallpaper on those 2 pages, where a thin white bar across the top and left edges was being displayed. The image was fixed and now the wallpaper fills the entire window neatly.

Summary

includes/bootstrap.jsp adds two links to the <head> of every page:

  • a stylesheet for the Vue menu bundle, ui-components/assets/index.css
  • a modulepreload for ui-components/assets/index.js

This includes login.jsp and account/selfService/passwordGate.jsp, which never mount the menu. The links were added in NMS-19975 (#8670). NMS-20180 (#8792) then kept them on the login page on purpose, so the bundle would be cached before the first page after login.

This PR drops both links on those two pages:

  • The login page no longer blocks rendering on the menu stylesheet.
  • Neither page pulls in the Vue app's global CSS.
  • Neither page depends on the menu bundle at all.

Changes

  • includes/bootstrap.jsp: new nomenuassets option. When set, the page skips the menu bundle's stylesheet and modulepreload links. Pages can set it either way they already set quiet: as an include param or as a Bootstrap flag. The option is documented in the parameter notes at the top of the file, and the head comment is updated.
  • login.jsp: Bootstrap.flags("quiet", "nomenuassets").
  • passwordGate.jsp: <jsp:param name="nomenuassets" value="true" />.
  • WebappIT: verifyLoginPageDoesNotExecuteMenuBundle is now verifyLoginPageDoesNotReferenceMenuBundle. It asserts that login.jsp contains no ui-components/ reference at all. It also checks that the login form rendered, so it can't pass on an error page.

Wallpaper edge gap

The login and password gate pages both showed a thin white bar along the top and left edges of the background. This is not caused by the menu changes above.

  • Cause: images/wallpapers/background_dark.png has a 1–2px partly transparent border: the top 2 rows, the bottom row and the left column. Layout is not involved, because .login-page sits at (0,0) and fills the viewport. background-size: cover scales the image about 1.28×, so the white <body> shows through as a 2–3px strip on top and 1–2px on the left. The bottom edge is cropped off by cover, so it never shows.
  • Fix: the border is cropped off the image, which goes from 1284×857 to 1283×854. There are no CSS changes. The remaining pixels are fully opaque and identical to the original's interior. The file is re-encoded without interlacing and shrinks from 474 KB to 257 KB.

Not changed

  • Other quiet pages still get the stylesheet and preload. The new flag is opt-in and only these two pages use it.
  • /ui-components/assets/** stays reachable without logging in. That rule from NMS-20174/NMS-20180 still guards against a browser caching an auth redirect as the bundle. The WebappIT tests for anonymous asset access are unchanged.
  • The inline theme script still runs on every page. It sets the open-light/open-dark class on <html> before first paint and doesn't reference ui-components.
  • Trade-off: the first page after login no longer finds the menu bundle already cached, so it fetches it like any other JSP page does.

External References

… gate

Add a 'nomenuassets' bootstrap.jsp include param / Bootstrap flag that
omits the Vue menu bundle's stylesheet and modulepreload links, and set it
on login.jsp and the password gate, neither of which mounts the menu. Other
quiet pages are unchanged. /ui-components/assets/** remains anonymously
accessible.

Update WebappIT to assert login.jsp no longer references the bundle.
background_dark.png had a partially transparent 1-2px border (top two
rows, bottom row, left column). Scaled up by background-size: cover, it
let the white <body> show through as a thin bar along the top and left
of the login and password gate pages. Crop it off; the remaining image
is fully opaque and pixel-identical to the original's interior.
@synqotik synqotik changed the title NMS-18978: Don't load ui-components menu assets on login and password gate NMS-18978: Don't load ui-components menu assets on login and password gate; fix wallpaper edge gap Sep 25, 2026
@synqotik
synqotik marked this pull request as ready for review September 25, 2026 21:26

This branch has not been deployed

No deployments
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.

1 participant