Skip to content

Commit 138a491

Browse files
authored
fix(hub-ui): give dock iframes a title and the standalone hub landmarks (#425)
1 parent eecf966 commit 138a491

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import type { DocksContext } from '@devframes/hub/client'
33
import { computed, useTemplateRef, watch } from 'vue'
4+
import { t } from '../../i18n'
45
import { getEntryGroup } from '../../state/dock-settings'
56
import { getEntryPaneKey, useIframePanes } from '../../utils/useIframePanes'
67
import { useIsRpcTrusted } from '../../utils/useIsRpcTrusted'
@@ -55,11 +56,11 @@ function switchEntry(id: string | undefined) {
5556

5657
<template>
5758
<ColorSchemeRoot>
58-
<div v-if="!isRpcTrusted" class="h-screen w-screen of-hidden">
59+
<main v-if="!isRpcTrusted" class="h-screen w-screen of-hidden">
5960
<ViewBuiltinClientAuthNotice :context="context" />
60-
</div>
61+
</main>
6162
<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">
63+
<nav :aria-label="t('settings.docks')" class="border-r border-base flex flex-col min-h-0">
6364
<div class="p2 border-b border-base flex">
6465
<BrandMark class="w-7 h-7 ma" />
6566
</div>
@@ -77,8 +78,8 @@ function switchEntry(id: string | undefined) {
7778
</template>
7879
</DockEntriesWithCategories>
7980
</div>
80-
</div>
81-
<div class="min-h-0 flex">
81+
</nav>
82+
<main class="min-h-0 flex">
8283
<DockGroupSidebar
8384
v-if="activeGroup"
8485
:context
@@ -95,7 +96,7 @@ function switchEntry(id: string | undefined) {
9596
/>
9697
<div id="devframes-views-container" ref="viewsContainer" class="pointer-events-auto" />
9798
</div>
98-
</div>
99+
</main>
99100
</div>
100101
<FloatingElements />
101102
<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)