[OpenNMS/opennms] 31d8d8: NMS-20166: Improve the OpenAPI Docs UI page (#8746)
Marshall Massengill via opennms-cvs <[email protected]>
| Newsgroups | gmane.network.opennms.cvs |
|---|---|
| Message-ID | <OpenNMS/opennms/push/refs/heads/release-36.x/[email protected]> |
Branch: refs/heads/release-36.x
Home: https://github.com/OpenNMS/opennms
Commit: 31d8d8958651456859ddfca8ef1c80245194fda8
https://github.com/OpenNMS/opennms/commit/31d8d8958651456859ddfca8ef1c80245194fda8
Author: Marshall Massengill <[email protected]>
Date: 2026-08-07 (Fri, 07 Aug 2026)
Changed paths:
M ui/src/containers/OpenAPI.vue
A ui/tests/containers/OpenAPI.test.ts
Log Message:
-----------
NMS-20166: Improve the OpenAPI Docs UI page (#8746)
* NMS-20166: Stop the OpenAPI docs page jumping when a nav entry or tab is clicked
Two things on this page call Element.scrollIntoView, and it scrolls every
scrollable ancestor rather than only the intended pane. RapiDoc does it twice per
nav click, for the operation and for the nav link. PrimeVue's Tab does it too, in
scrollInView with block 'nearest', when a tab takes focus.
Which boxes are scrollable is not entirely ours to decide: PrimeVue's theme is
generated at runtime, and a box with overflow hidden on one axis has the other
computed to auto, which quietly makes it a scroll container. So the layout is
tightened where it can be, and the offsets are put back where it cannot.
- Puts each doc in its own tab, so only one is displayed rather than stacking two
full-height rows and guaranteeing the page overflowed.
- Measures the space left below the breadcrumbs and above the footer, on mount and
whenever the chrome reflows, rather than subtracting a fixed offset from 100vh.
- Clips the column and the tab boxes. clip rather than hidden, since a hidden box is
still programmatically scrollable.
- Restores the vertical scroll of every scrollable box in the column's light DOM and
above it after a click, which is what makes this hold whatever the theme leaves
scrollable. querySelectorAll does not pierce shadow roots, so RapiDoc's own panes
are untouched and still scroll to the clicked operation. Horizontal offsets are
left alone, since the tab strip is legitimately scrollable sideways.
- Holds the document at the top while the column fits. A click is not the only thing
that moves the page: switching tabs focuses the new tab and panel, and the browser
scrolls a focused element into view on its own, after the frames the click handler
watches. Skipped when the viewport is too short to hold the column, since the page
then does need to scroll.
- Drops the IntersectionObserver that deferred the V1 doc; its tab being opened is
now the trigger.
Everything here stays inside the page. Nothing is written to documentElement, so the
fixed app chrome and the side menu's flyouts, which need overflow visible, are
unaffected.
* NMS-20166: Share the in-flight OpenAPI spec fetch
Cache the pending promise rather than its result, so opening the V1 tab
before the mount-time fetch resolves joins that request instead of
issuing a second pair. The entry is dropped again if the fetch fails, so
a later call still retries.
To unsubscribe from these emails, change your notification settings at https://github.com/OpenNMS/opennms/settings/notifications
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/wiki/index.php?page=MailingListFaq
opennms-cvs mailing list
To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-cvs