Skip to content

Commit 9ee61ef

Browse files
committed
fix(inspector): improve selector merge
1 parent 164c125 commit 9ee61ef

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/inspector/client/components/Analyzer.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ const mergedSelectors = computed(() => {
5151
})
5252
5353
return [...map.values()]
54+
.sort((a, b) => b.count - a.count)
5455
})
5556
5657
const grouped = computed(() => mergedSelectors
@@ -78,14 +79,18 @@ const grouped = computed(() => mergedSelectors
7879

7980
<template>
8081
<div p-4 space-y-8>
82+
<label flex="~ gap-2 items-center">
83+
<input v-model="mergeSameUtil" type="checkbox">
84+
<span>Merge Alias</span>
85+
</label>
8186
<div v-if="selectors.length > 10">
8287
<div mb-4 op50 uppercase text-sm>
8388
Top 10 Utilities
8489
</div>
8590
<div p-4 bg-active>
8691
<div flex="~ wrap" gap="x-2 y-2">
8792
<AnalyzerItem
88-
v-for="(item, i) in selectors.slice(0, 10)"
93+
v-for="(item, i) in mergedSelectors.slice(0, 10)"
8994
:key="i"
9095
:item="item"
9196
/>
@@ -102,7 +107,7 @@ const grouped = computed(() => mergedSelectors
102107
<span v-for="(item, i) in colors" :key="i">
103108
<div p-2 w-25 inline-block of-hidden bg-active>
104109
<AnalyzerItem :item="item" />
105-
<div font-mono text-sm op50 ws-nowrap of-ellipsis of-hidden>{{ item.color }}</div>
110+
<div font-mono text-sm op50 ws-nowrap text-ellipsis of-hidden>{{ item.color }}</div>
106111
<div h-10 mt-1 :style="{ background: item.color }" />
107112
</div>
108113
</span>
@@ -124,10 +129,6 @@ const grouped = computed(() => mergedSelectors
124129
<div>
125130
<div mb4 op50 uppercase text-sm flex="~ gap-4 items-center">
126131
Utilities Usage
127-
<label flex="~ gap-2 items-center">
128-
<input v-model="mergeSameUtil" type="checkbox">
129-
<span>Merge Alias</span>
130-
</label>
131132
</div>
132133

133134
<FlowLayout v-if="grouped.length" :cols="2" :gap="16">

0 commit comments

Comments
 (0)