Skip to content

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

Merged
synqotik merged 2 commits into
developfrom
jira/NMS-18978-ui-components-ref-on-login-smoke
Sep 29, 2026
Merged

synqotik merged 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 JS 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 the JS references so those 2 pages are cleaner. There's a small tradeoff where the menu JS 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. Initially we also removed the CSS, but it's actually needed for some styling on those pages.

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 the modulepreload on those two pages, so neither one loads the menu bundle's JavaScript. They keep the stylesheet, because they rely on it for font size and other styling.

Changes

  • includes/bootstrap.jsp: new nomenujs option. When set, the page skips the menu bundle's modulepreload link; the stylesheet is always emitted. 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", "nomenujs").
  • passwordGate.jsp: <jsp:param name="nomenujs" value="true" />.
  • WebappIT: verifyLoginPageDoesNotExecuteMenuBundle is now verifyLoginPageDoesNotReferenceMenuBundleJs. It asserts that login.jsp contains no reference to ui-components/assets/index.js. It also checks that the login form rendered and that index.css is still linked, so the test can't pass on an error page or after a URL change.

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

@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
@synqotik
synqotik changed the base branch from develop to foundation-2026 September 27, 2026 21:57
@synqotik
synqotik changed the base branch from foundation-2026 to develop September 27, 2026 21:58

@marshallmassengill marshallmassengill 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.

Approving but two findings:

  1. The login and password gate pages will look different. The menu stylesheet the PR removes also sets the font on the input boxes, their labels and the error message text. Without it those fall back to the plain system font, and the login inputs get slightly tighter line spacing. The description doesn't mention this, so ask for before-and-after screenshots.
  2. The new flag has a trap, but nothing is affected yet. nomenuassets removes the menu's stylesheet but not the menu script. A page that set it without quiet would show the menu with no styling.

… gate

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

Update WebappIT to assert login.jsp still links the bundle stylesheet but
no longer references its JavaScript.
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 force-pushed the jira/NMS-18978-ui-components-ref-on-login-smoke branch from a617052 to 38627df Compare September 29, 2026 14:14
@synqotik synqotik changed the title NMS-18978: Don't load ui-components menu assets on login and password gate; fix wallpaper edge gap NMS-18978: Don't load ui-components menu JS on login and password gate; fix wallpaper edge gap Sep 29, 2026
@synqotik

Copy link
Copy Markdown
Contributor Author

Approving but two findings:

1. The login and password gate pages will look different. The menu stylesheet the PR removes also sets the font on the input boxes, their labels and the error message text. Without it those fall back to the plain system font, and the login inputs get slightly tighter line spacing. The description doesn't mention this, so ask for before-and-after screenshots.

2. The new flag has a trap, but nothing is affected yet. nomenuassets removes the menu's stylesheet but not the menu script. A page that set it without quiet would show the menu with no styling.

Re 1., updated to only remove the JS but keep the CSS, so styling remains unchanged.

Re 2., note the flag has been changed to nomenujs (since we are loading some assets, i.e. the CSS). Re setting one flag without the other (i.e. nomenujs without quiet), it's acceptable, someone would have to make an odd decision to do that. Eventually all the JSP will be phased out anyway.

@marshallmassengill marshallmassengill 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.

I think this is good to go!

@synqotik
synqotik merged commit 6cc05a9 into develop Sep 29, 2026
10 of 14 checks passed
@synqotik
synqotik deleted the jira/NMS-18978-ui-components-ref-on-login-smoke branch September 29, 2026 20:18
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