From 981431735c33f5c49807a7c1bffe6182438593f9 Mon Sep 17 00:00:00 2001 From: "Jan C. Borchardt" <925062+jancborchardt@users.noreply.github.com> Date: Wed, 15 Jul 2026 18:08:35 +0200 Subject: [PATCH] fix(dismiss): keep scroll position when dismissing a notification Assisted-by: ClaudeCode:claude-opus-4-8 Signed-off-by: Jan C. Borchardt <925062+jancborchardt@users.noreply.github.com> --- src/Components/NotificationItem.vue | 9 +++++++++ src/NotificationsApp.vue | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/Components/NotificationItem.vue b/src/Components/NotificationItem.vue index 5cec7dea3..8d78f40f8 100644 --- a/src/Components/NotificationItem.vue +++ b/src/Components/NotificationItem.vue @@ -18,6 +18,7 @@ :timestamp="timestamp" /> { diff --git a/src/NotificationsApp.vue b/src/NotificationsApp.vue index 02b0917e2..dc4f50936 100644 --- a/src/NotificationsApp.vue +++ b/src/NotificationsApp.vue @@ -34,6 +34,7 @@ @@ -379,7 +380,21 @@ export default { }) }, + setItemRef(el, notificationId) { + this.itemRefs ??= {} + if (el) { + this.itemRefs[notificationId] = el + } else { + delete this.itemRefs[notificationId] + } + }, + onRemove(index) { + // Move focus to a neighboring notification before removing this one. + // Otherwise the header menu focus trap catches the lost focus and jumps + // it (and the scroll position) to the top of the list. + const neighbor = this.notifications[index + 1] || this.notifications[index - 1] + this.itemRefs?.[neighbor?.notificationId]?.focus() this.notifications.splice(index, 1) setCurrentTabAsActive(this.tabId) },