Skip to content

Commit 3293fe3

Browse files
authored
feat: visual differentiation for action buttons in docks (#245)
1 parent f0c87b1 commit 3293fe3

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

packages/core/src/client/webcomponents/.generated/css.ts

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/core/src/client/webcomponents/components/dock/DockEntries.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function toggleDockEntry(dock: DevToolsDockEntry) {
3131
v-if="!dock.isHidden"
3232
:context="context"
3333
:dock
34+
:is-action="dock.type === 'action'"
3435
:is-selected="selected?.id === dock.id"
3536
:is-dimmed="selected ? (selected.id !== dock.id) : false"
3637
:is-vertical="isVertical"

packages/core/src/client/webcomponents/components/dock/DockEntry.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const props = withDefaults(
1111
defineProps<{
1212
context: DocksContext
1313
dock: DevToolsDockEntryBase
14+
isAction?: boolean
1415
isSelected?: boolean
1516
isDimmed?: boolean
1617
isVertical?: boolean
@@ -81,8 +82,9 @@ useEventListener('pointerdown', () => {
8182
isVertical ? 'rotate-270' : '',
8283
isDimmed ? 'op50 saturate-0' : '',
8384
isSelected ? 'scale-120 text-purple' : '',
85+
isAction ? 'bg-[#8881] hover:bg-[#8882] rounded-full' : 'rounded-xl',
8486
]"
85-
class="flex items-center justify-center p1.5 rounded-xl hover:bg-[#8881] hover:scale-110 transition-all duration-300 relative"
87+
class="flex items-center justify-center p1.5 hover:bg-[#8881] hover:scale-110 transition-all duration-300 relative"
8688
>
8789
<DockIcon :icon="dock.icon" :title="dock.title" class="w-5 h-5 select-none" />
8890
<div v-if="badge" class="absolute top-0.5 right-0 bg-gray-6 text-white text-0.6em px-1 rounded-full shadow">

packages/core/src/client/webcomponents/components/views-builtin/ViewBuiltinSettings.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { computed } from 'vue'
66
import { docksGroupByCategories } from '../../state/dock-settings'
77
import { sharedStateToRef } from '../../state/docks'
88
import { isDockPopupSupported, requestDockPopupOpen, useIsDockPopupOpen } from '../../state/popup'
9+
import HashBadge from '../display/HashBadge.vue'
910
import DockIcon from '../dock/DockIcon.vue'
1011
1112
const props = defineProps<{
@@ -308,11 +309,18 @@ function resetSettings() {
308309
:class="settings.docksHidden.includes(dock.id) ? 'saturate-0' : ''"
309310
/>
310311
<span
311-
class="flex-1 truncate"
312+
class="truncate"
312313
:class="settings.docksHidden.includes(dock.id) ? 'line-through op60' : ''"
313314
>
314315
{{ dock.title }}
315316
</span>
317+
<HashBadge
318+
v-if="dock.type === 'action'"
319+
label="Action"
320+
class="flex-none text-xs"
321+
/>
322+
323+
<div class="flex flex-auto" />
316324

317325
<!-- Order controls -->
318326
<div class="flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">

0 commit comments

Comments
 (0)