Modified - Preserved the /user/settings left-menu scroll position without the visible reset flicker during navigation.
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-container (push) Has been cancelled

This commit is contained in:
2026-05-08 20:22:45 +00:00
parent 5e31019b99
commit 3dd2ffc195
6 changed files with 30 additions and 15 deletions
+5
View File
@@ -596,3 +596,8 @@ Project Change ID[date-time] - application-version - Type - Summary:
119 - [2026-05-07 21:14:11] - v1.27.0-dev-106-g61a9e4bd06 - Type: Modified - Made the `Admin Settings` menu header sticky while the admin left-menu options scroll.
- 1 - I modified `web_src/css/modules/flexcontainer.css` so the `.header.item` at the top of the `/-/admin` sticky side menu now uses the same sticky header treatment as `/user/settings`, with its own background and bottom separator.
- 2 - I modified `web_src/css/modules/flexcontainer.css` so the top green overflow indicator for `/-/admin` is also rendered on the bottom edge of the sticky header, with the gradient drawn by the same dedicated `::after` element used in `/user/settings`.
120 - [2026-05-07 21:31:18] - v1.27.0-dev-106-g61a9e4bd06 - Type: Modified - Preserved the `/user/settings` left-menu scroll position without the visible reset flicker during navigation.
- 1 - I modified `templates/user/settings/navbar.tmpl` to add a small inline restore hook around the menu markup, so a saved `scrollTop` is applied from `sessionStorage` before the menu becomes visible on the next settings page.
- 2 - I modified `web_src/css/modules/flexcontainer.css` so, while that inline restore is in progress, only the `/user/settings` left menu is temporarily hidden, preventing the brief flash of the menu reset at the top.
- 3 - I kept `web_src/js/features/common-page.ts` focused on saving the menu scroll position and refreshing the scroll indicators, removing the now-redundant late restore path from the global initializer.
+1 -1
View File
@@ -1 +1 @@
76ebe84b39524c3439522775bccdaefa94be0dd8
5bb40d93fd89097b89e4c79099fb2ed645f19ce0
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

+19 -1
View File
@@ -1,5 +1,12 @@
<script>
try {
if (window.sessionStorage.getItem('sticky-side-menu-scroll:user-settings')) {
document.documentElement.classList.add('restoring-user-settings-menu-scroll');
}
} catch {}
</script>
<div class="flex-container-nav">
<div class="ui fluid vertical menu">
<div class="ui fluid vertical menu" id="user-settings-side-menu">
<div class="header item">{{ctx.Locale.Tr "user.settings"}}</div>
<a class="{{if .PageIsSettingsProfile}}active {{end}}item" href="{{AppSubUrl}}/user/settings">
{{ctx.Locale.Tr "settings.profile"}}
@@ -70,3 +77,14 @@
</a>
</div>
</div>
<script>
(() => {
const menu = document.getElementById('user-settings-side-menu');
if (!menu) return;
try {
const savedScroll = window.sessionStorage.getItem('sticky-side-menu-scroll:user-settings');
if (savedScroll) menu.scrollTop = Number(savedScroll);
} catch {}
document.documentElement.classList.remove('restoring-user-settings-menu-scroll');
})();
</script>
+4
View File
@@ -26,6 +26,10 @@ body.show-sticky-side-menus .page-content.admin .flex-container-nav {
min-height: 0;
}
html.restoring-user-settings-menu-scroll body.show-sticky-side-menus .page-content.user.settings .flex-container-nav > #user-settings-side-menu {
visibility: hidden;
}
body.show-sticky-side-menus .page-content.user.settings .flex-container-nav > .ui.vertical.menu,
body.show-sticky-side-menus .page-content.admin .flex-container-nav > .ui.vertical.menu {
position: sticky;
+1 -13
View File
@@ -82,19 +82,7 @@ function initStickySideMenuIndicators() {
attributes: true,
attributeFilter: ['open'],
});
if (isUserSettingsMenu) {
window.requestAnimationFrame(() => {
window.requestAnimationFrame(() => {
try {
const savedScroll = window.sessionStorage.getItem(userSettingsMenuScrollKey);
if (savedScroll) menu.scrollTop = Number(savedScroll);
} catch {}
updateIndicators();
});
});
} else {
scheduleUpdate();
}
scheduleUpdate();
}
}