release: v2.2.58 sag tab top-position UX

This commit is contained in:
Christian 2026-03-18 08:36:54 +01:00
parent 9a3ada380f
commit 7a95623094
2 changed files with 40 additions and 1 deletions

15
RELEASE_NOTES_v2.2.58.md Normal file
View File

@ -0,0 +1,15 @@
# Release Notes v2.2.58
Dato: 2026-03-18
## Fokus
Forbedret UX paa SAG detaljesiden, saa fanernes indhold vises i toppen ved faneskift.
## Aendringer
- SAG tabs: aktiv tab-pane flyttes til toppen af tab-content ved faneskift.
- SAG tabs: automatisk scroll til fanebjaelken efter faneskift.
- SAG tabs: samme top-positionering og scroll ved `?tab=` deep-link aktivering.
## Berorte filer
- app/modules/sag/templates/detail.html
- RELEASE_NOTES_v2.2.58.md

View File

@ -2207,6 +2207,24 @@
let wikiSearchTimeout;
let selectedRelationCaseId = null;
const caseTypeKey = "{{ (case.template_key or case.type or 'ticket')|lower }}";
function promoteCaseTabPane(tabId) {
if (!tabId) return;
const tabContent = document.getElementById('caseTabsContent');
const pane = document.getElementById(tabId);
if (!tabContent || !pane || !tabContent.contains(pane)) return;
if (tabContent.firstElementChild === pane) return;
tabContent.insertBefore(pane, tabContent.firstElementChild);
}
function scrollToCaseTabs() {
const tabs = document.getElementById('caseTabs');
if (!tabs) return;
const offset = 110;
const targetTop = tabs.getBoundingClientRect().top + window.pageYOffset - offset;
window.scrollTo({ top: Math.max(0, targetTop), behavior: 'smooth' });
}
window.moduleDisplayNames = {
'relations': 'Relationer',
'call-history': 'Opkaldshistorik',
@ -2304,6 +2322,11 @@
} catch (tabLoadError) {
console.error('Tab data reload failed:', tabLoadError);
}
requestAnimationFrame(() => {
promoteCaseTabPane(tabId);
scrollToCaseTabs();
});
});
}
@ -7701,7 +7724,8 @@
if (tabBtn) {
setTimeout(() => {
bootstrap.Tab.getOrCreateInstance(tabBtn).show();
tabBtn.scrollIntoView({ behavior: 'smooth', block: 'nearest' });
promoteCaseTabPane(tabParam);
scrollToCaseTabs();
}, 300);
}
}