Skip to content

Commit db51fea

Browse files
committed
redesign: group extra packages by type with neutral tags
1 parent bf3dfeb commit db51fea

File tree

1 file changed

+75
-38
lines changed

1 file changed

+75
-38
lines changed

src/routes/dashboard/+page.svelte

Lines changed: 75 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,20 @@
116116
return Array.from(selectedPackages.keys()).filter((pkg) => !presetPkgs.has(pkg));
117117
}
118118
119+
function getGroupedExtras(): { cli: string[]; apps: string[]; taps: string[] } {
120+
const extras = getExtraPackages();
121+
const cli: string[] = [];
122+
const apps: string[] = [];
123+
const taps: string[] = [];
124+
for (const pkg of extras) {
125+
const t = selectedPackages.get(pkg) || 'formula';
126+
if (t === 'cask') apps.push(pkg);
127+
else if (t === 'tap') taps.push(pkg);
128+
else cli.push(pkg);
129+
}
130+
return { cli, apps, taps };
131+
}
132+
119133
120134
121135
function initPackagesForPreset(preset: string) {
@@ -535,14 +549,38 @@
535549
{/if}
536550
</div>
537551
{#if getExtraPackages().length > 0}
552+
{@const grouped = getGroupedExtras()}
538553
<div class="selected-extras">
539-
{#each getExtraPackages() as pkg}
540-
{@const pkgType = selectedPackages.get(pkg) || 'formula'}
541-
<button type="button" class="extra-tag {pkgType}" onclick={() => togglePackage(pkg, pkgType)}>
542-
{pkg}
543-
<span class="remove-icon">×</span>
544-
</button>
545-
{/each}
554+
{#if grouped.cli.length > 0}
555+
<div class="extras-group">
556+
<span class="group-label">CLI</span>
557+
{#each grouped.cli as pkg}
558+
<button type="button" class="extra-tag" onclick={() => togglePackage(pkg, 'formula')}>
559+
{pkg}<span class="remove-icon">×</span>
560+
</button>
561+
{/each}
562+
</div>
563+
{/if}
564+
{#if grouped.apps.length > 0}
565+
<div class="extras-group">
566+
<span class="group-label">Apps</span>
567+
{#each grouped.apps as pkg}
568+
<button type="button" class="extra-tag" onclick={() => togglePackage(pkg, 'cask')}>
569+
{pkg}<span class="remove-icon">×</span>
570+
</button>
571+
{/each}
572+
</div>
573+
{/if}
574+
{#if grouped.taps.length > 0}
575+
<div class="extras-group">
576+
<span class="group-label">Taps</span>
577+
{#each grouped.taps as pkg}
578+
<button type="button" class="extra-tag" onclick={() => togglePackage(pkg, 'tap')}>
579+
{pkg}<span class="remove-icon">×</span>
580+
</button>
581+
{/each}
582+
</div>
583+
{/if}
546584
</div>
547585
{/if}
548586
<div class="packages-search">
@@ -1078,54 +1116,53 @@
10781116
}
10791117
10801118
.selected-extras {
1081-
display: flex;
1082-
flex-wrap: wrap;
1083-
gap: 6px;
10841119
margin-bottom: 12px;
10851120
padding: 10px;
1086-
background: rgba(34, 197, 94, 0.05);
1087-
border: 1px dashed var(--accent);
1121+
background: rgba(255, 255, 255, 0.02);
1122+
border: 1px solid var(--border);
10881123
border-radius: 8px;
10891124
}
10901125
1126+
.extras-group {
1127+
display: flex;
1128+
flex-wrap: wrap;
1129+
align-items: center;
1130+
gap: 6px;
1131+
margin-bottom: 8px;
1132+
}
1133+
1134+
.extras-group:last-child {
1135+
margin-bottom: 0;
1136+
}
1137+
1138+
.group-label {
1139+
font-size: 0.6rem;
1140+
text-transform: uppercase;
1141+
letter-spacing: 0.05em;
1142+
color: var(--text-muted);
1143+
font-weight: 600;
1144+
width: 32px;
1145+
flex-shrink: 0;
1146+
}
1147+
10911148
.extra-tag {
10921149
display: inline-flex;
10931150
align-items: center;
10941151
gap: 4px;
10951152
padding: 4px 8px;
1096-
border: none;
1153+
background: rgba(255, 255, 255, 0.08);
1154+
border: 1px solid rgba(255, 255, 255, 0.12);
1155+
color: var(--text-secondary);
10971156
border-radius: 4px;
10981157
font-size: 0.75rem;
10991158
font-family: 'JetBrains Mono', monospace;
11001159
cursor: pointer;
11011160
transition: all 0.15s;
11021161
}
11031162
1104-
.extra-tag.formula {
1105-
background: var(--accent);
1106-
color: #000;
1107-
}
1108-
1109-
.extra-tag.formula:hover {
1110-
background: #1a9f4a;
1111-
}
1112-
1113-
.extra-tag.cask {
1114-
background: #60a5fa;
1115-
color: #000;
1116-
}
1117-
1118-
.extra-tag.cask:hover {
1119-
background: #3b82f6;
1120-
}
1121-
1122-
.extra-tag.tap {
1123-
background: #fbbf24;
1124-
color: #000;
1125-
}
1126-
1127-
.extra-tag.tap:hover {
1128-
background: #f59e0b;
1163+
.extra-tag:hover {
1164+
background: rgba(255, 255, 255, 0.14);
1165+
color: var(--text-primary);
11291166
}
11301167
11311168
.remove-icon {

0 commit comments

Comments
 (0)