Skip to content

Commit e072cdc

Browse files
antfuclaude
andcommitted
feat: adaptive address bar style for edge mode, scope context menu to dock icons
- Address bar drops rounded corners and outer border in edge mode, uses bottom border instead; iframe itself gets no border/radius in edge mode - Remove @contextmenu from edge panel frame so the dock context menu only triggers on individual dock icon right-clicks Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ca9b223 commit e072cdc

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

packages/core/src/client/webcomponents/components/DockEdge.vue

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import type { CSSProperties } from 'vue'
44
import { computed, h, markRaw, useTemplateRef } from 'vue'
55
import { setEdgePositionDropdown, setFloatingTooltip, useEdgePositionDropdown } from '../state/floating-tooltip'
66
import { PersistedDomViewsManager } from '../utils/PersistedDomViewsManager'
7-
import { openDockContextMenu } from './DockContextMenu'
87
import DockEntriesWithCategories from './DockEntriesWithCategories.vue'
98
import DockPanelResizer from './DockPanelResizer.vue'
109
import ViewEntry from './ViewEntry.vue'
@@ -19,7 +18,6 @@ const context = props.context
1918
const store = context.panel.store
2019
2120
const viewsContainer = useTemplateRef<HTMLElement>('viewsContainer')
22-
const edgePanel = useTemplateRef<HTMLDivElement>('edgePanel')
2321
const persistedDoms = markRaw(new PersistedDomViewsManager(viewsContainer))
2422
2523
const isVertical = computed(() => store.position === 'left' || store.position === 'right')
@@ -107,21 +105,6 @@ function switchToFloat() {
107105
store.mode = 'float'
108106
}
109107
110-
function openContextMenu(e: MouseEvent) {
111-
if (!edgePanel.value)
112-
return
113-
const entry = selectedEntry.value
114-
if (!entry)
115-
return
116-
e.preventDefault()
117-
openDockContextMenu({
118-
context,
119-
entry,
120-
el: edgePanel.value,
121-
gap: 6,
122-
})
123-
}
124-
125108
const panelStyle = computed<CSSProperties>(() => {
126109
const style: CSSProperties = {
127110
position: 'fixed',
@@ -182,11 +165,9 @@ const contentClass = computed(() => {
182165
<template>
183166
<div
184167
id="vite-devtools-edge-panel"
185-
ref="edgePanel"
186168
class="bg-glass:75 border border-base color-base shadow overflow-hidden z-floating-anchor font-sans text-[15px] box-border"
187169
:class="`flex ${isVertical ? 'flex-row' : 'flex-col'}`"
188170
:style="panelStyle"
189-
@contextmenu="openContextMenu"
190171
>
191172
<DockPanelResizer :panel="context.panel" edge-mode />
192173

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const props = defineProps<{
1515
1616
const settings = sharedStateToRef(props.context.docks.settings)
1717
const showAddressBar = computed(() => settings.value.showIframeAddressBar ?? true)
18+
const isEdgeMode = computed(() => props.context.panel.store.mode === 'edge')
1819
const ADDRESS_BAR_HEIGHT = 50
1920
2021
const isLoading = ref(true)
@@ -177,14 +178,20 @@ onMounted(() => {
177178
Object.assign(holder.element.style, props.iframeStyle)
178179
if (showAddressBar.value) {
179180
holder.element.style.marginTop = `${ADDRESS_BAR_HEIGHT}px`
180-
holder.element.style.borderTopLeftRadius = '0px'
181-
holder.element.style.borderTopRightRadius = '0px'
181+
if (!isEdgeMode.value) {
182+
holder.element.style.borderTopLeftRadius = '0px'
183+
holder.element.style.borderTopRightRadius = '0px'
184+
}
182185
}
183186
else {
184187
holder.element.style.marginTop = '0px'
185188
holder.element.style.borderTopLeftRadius = ''
186189
holder.element.style.borderTopRightRadius = ''
187190
}
191+
if (isEdgeMode.value) {
192+
holder.element.style.borderRadius = '0px'
193+
holder.element.style.border = 'none'
194+
}
188195
})
189196
190197
watch(
@@ -219,7 +226,8 @@ onUnmounted(() => {
219226
<div class="w-full h-full flex flex-col">
220227
<div
221228
v-if="showAddressBar"
222-
class="flex-none px-2 w-full flex items-center gap-1 border rounded-t-md border-base border-b-0 bg-gray/5"
229+
class="flex-none px-2 w-full flex items-center gap-1 bg-gray/5"
230+
:class="isEdgeMode ? 'border-b border-base' : 'border rounded-t-md border-base border-b-0'"
223231
:style="{ height: `${ADDRESS_BAR_HEIGHT}px` }"
224232
>
225233
<!-- Navigation buttons (hidden for cross-origin) -->

0 commit comments

Comments
 (0)