Skip to content

Commit d396dc6

Browse files
committed
fix(hub-ui): give dock iframes a title and the standalone hub landmarks
axe flags the standalone hub page for an unnamed dock iframe and for content outside any landmark. Each dock iframe now carries its localized dock title, and the dock list and content area are nav and main landmarks.
1 parent 72d917d commit d396dc6

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

‎packages/hub-ui/src/client/components/dock/DockStandalone.vue‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ function switchEntry(id: string | undefined) {
5555

5656
<template>
5757
<ColorSchemeRoot>
58-
<div v-if="!isRpcTrusted" class="h-screen w-screen of-hidden">
58+
<main v-if="!isRpcTrusted" class="h-screen w-screen of-hidden">
5959
<ViewBuiltinClientAuthNotice :context="context" />
60-
</div>
60+
</main>
6161
<div v-else class="h-screen w-screen of-clip grid cols-[max-content_1fr]">
62-
<div class="border-r border-base flex flex-col min-h-0">
62+
<nav aria-label="Docks" class="border-r border-base flex flex-col min-h-0">
6363
<div class="p2 border-b border-base flex">
6464
<BrandMark class="w-7 h-7 ma" />
6565
</div>
@@ -77,8 +77,8 @@ function switchEntry(id: string | undefined) {
7777
</template>
7878
</DockEntriesWithCategories>
7979
</div>
80-
</div>
81-
<div class="min-h-0 flex">
80+
</nav>
81+
<main class="min-h-0 flex">
8282
<DockGroupSidebar
8383
v-if="activeGroup"
8484
:context
@@ -95,7 +95,7 @@ function switchEntry(id: string | undefined) {
9595
/>
9696
<div id="devframes-views-container" ref="viewsContainer" class="pointer-events-auto" />
9797
</div>
98-
</div>
98+
</main>
9999
</div>
100100
<FloatingElements />
101101
<CommandPalette :context />

‎packages/hub-ui/src/client/components/views/ViewIframe.vue‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { stripRemoteConnectionFromUrl, watchFrameLocation } from '@devframes/hub
88
import { DEVFRAME_REMOTE_ASSETS_ERROR_MESSAGE_TYPE } from '@devframes/hub/constants'
99
import { computed, nextTick, onMounted, onUnmounted, ref, useTemplateRef, watchEffect } from 'vue'
1010
import { t } from '../../i18n'
11+
import { localizeTitle } from '../../state/locale'
1112
import { useSettings } from '../../state/settings-defaults'
1213
import ViewAssetsError from './ViewAssetsError.vue'
1314
import ViewIframeLoading from './ViewIframeLoading.vue'
@@ -233,6 +234,9 @@ onMounted(() => {
233234
style: { boxShadow: 'none', outline: 'none' },
234235
})
235236
const iframe = pane.iframe
237+
watchEffect(() => {
238+
iframe.title = localizeTitle(props.entry).title
239+
})
236240
237241
// Follow the frame wherever it goes: a document load, but also an SPA
238242
// router's `pushState`/`replaceState` and back/forward, none of which fire

0 commit comments

Comments
 (0)