Skip to content

Commit 95c9f2d

Browse files
authored
fix(core): align grouped iframe address bar with sidebar (#482)
1 parent c9504ce commit 95c9f2d

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

packages/core/src/client/webcomponents/components/views/ViewIframe.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { IframePanes } from 'iframe-pane'
55
import type { CSSProperties } from 'vue'
66
import { REMOTE_CONNECTION_KEY } from '@vitejs/devtools-kit/constants'
77
import { computed, nextTick, onMounted, onUnmounted, ref, useTemplateRef, watchEffect } from 'vue'
8+
import { getEntryGroup } from '../../state/dock-settings'
89
import { sharedStateToRef } from '../../state/docks'
910
1011
const props = defineProps<{
@@ -45,6 +46,13 @@ function stripRemoteConnectionParam(url: string): string {
4546
const settings = sharedStateToRef(props.context.docks.settings)
4647
const showAddressBar = computed(() => settings.value.showIframeAddressBar ?? true)
4748
const isEdgeMode = computed(() => props.context.panel.store.mode === 'edge')
49+
const addressBarBorderClass = computed(() => {
50+
if (isEdgeMode.value)
51+
return 'border-b'
52+
if (getEntryGroup(props.context.docks.entries, props.entry))
53+
return 'border-t border-r rounded-tr-md'
54+
return 'border rounded-t-md border-b-0'
55+
})
4856
const ADDRESS_BAR_HEIGHT = 40
4957
5058
const isLoading = ref(true)
@@ -263,8 +271,8 @@ onUnmounted(() => {
263271
<div class="w-full h-full flex flex-col">
264272
<div
265273
v-if="showAddressBar"
266-
class="flex-none px-2 w-full flex items-center gap-1"
267-
:class="isEdgeMode ? 'border-b border-base' : 'border rounded-t-md border-base border-b-0'"
274+
class="flex-none px-2 w-full flex items-center gap-1 border-base"
275+
:class="addressBarBorderClass"
268276
:style="{ height: `${ADDRESS_BAR_HEIGHT}px` }"
269277
>
270278
<!-- Navigation buttons (hidden for cross-origin) -->

0 commit comments

Comments
 (0)