diff --git a/RELEASE_NOTES_v2.2.58.md b/RELEASE_NOTES_v2.2.58.md new file mode 100644 index 0000000..4c29952 --- /dev/null +++ b/RELEASE_NOTES_v2.2.58.md @@ -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 diff --git a/app/modules/sag/templates/detail.html b/app/modules/sag/templates/detail.html index 98baf8b..f2dac6f 100644 --- a/app/modules/sag/templates/detail.html +++ b/app/modules/sag/templates/detail.html @@ -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); } }