Enhance AppLauncherOverlay and navigation logic for improved user experience

- Added functionality to close the overlay and return focus to the launcher when the Escape key is pressed inside an iframe.
- Implemented message handling to close the app launcher from the parent window.
- Updated navigation logic in useControllerNav to improve focus management when navigating between sidebar and main content.
- Enhanced Dashboard and Settings views with data attributes for better controller navigation support.
This commit is contained in:
Dorian
2026-02-18 11:29:05 +00:00
parent 473c58894c
commit d0312c6721
5 changed files with 51 additions and 7 deletions

View File

@@ -5,17 +5,26 @@ export const useAppLauncherStore = defineStore('appLauncher', () => {
const isOpen = ref(false)
const url = ref('')
const title = ref('')
let previousActiveElement: HTMLElement | null = null
function open(payload: { url: string; title: string }) {
previousActiveElement = (document.activeElement as HTMLElement) || null
url.value = payload.url
title.value = payload.title
isOpen.value = true
}
function close() {
const toRestore = previousActiveElement
previousActiveElement = null
isOpen.value = false
url.value = ''
title.value = ''
if (toRestore && typeof toRestore.focus === 'function') {
requestAnimationFrame(() => {
toRestore.focus()
})
}
}
return {