Skip to content

Commit 4c11727

Browse files
committed
feat: add icons for addons
1 parent 4bc1218 commit 4c11727

File tree

31 files changed

+102
-40
lines changed

31 files changed

+102
-40
lines changed

addons/addon-manager/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"main": "index.js",
88
"author": "commas",
99
"license": "ISC",
10+
"commas:icon": {
11+
"name": "lucide-blocks"
12+
},
1013
"commas:i18n": {
1114
"zh-CN": {
1215
"productName": "附加功能管理",

addons/addon-manager/src/renderer/AddonManagerPane.vue

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,29 @@ onMounted(() => {
8383
:key="addon.name"
8484
:class="['addon-card', { 'is-disabled': !enabled }]"
8585
>
86-
<div class="addon-card-title">
87-
<span class="addon-primary-info">
88-
<span class="addon-name">{{ manifest.productName ?? manifest.name ?? addon.name }}</span>
89-
<span
90-
v-if="(manifest.productName ?? manifest.name) !== addon.name"
91-
:class="['addon-id', { link: addon.type !== 'builtin' }]"
92-
@click="showInFolder(addon)"
93-
>{{ addon.name }}</span>
94-
<span v-if="addon.type !== 'builtin'" class="addon-version">{{ manifest.version ?? '' }}</span>
95-
</span>
96-
<SwitchControl
97-
:model-value="enabled"
98-
@update:model-value="toggle(addon, $event)"
99-
/>
86+
<div class="addon-icon">
87+
<VisualIcon v-if="manifest['commas:icon']" :name="manifest['commas:icon'].name" />
88+
</div>
89+
<div class="addon-info">
90+
<div class="addon-title">
91+
<span class="addon-primary-info">
92+
<span class="addon-name">{{ manifest.productName ?? manifest.name ?? addon.name }}</span>
93+
<span
94+
v-if="(manifest.productName ?? manifest.name) !== addon.name"
95+
:class="['addon-id', { link: addon.type !== 'builtin' }]"
96+
@click="showInFolder(addon)"
97+
>{{ addon.name }}</span>
98+
<span v-if="addon.type !== 'builtin'" class="addon-version">{{ manifest.version ?? '' }}</span>
99+
</span>
100+
<SwitchControl
101+
:model-value="enabled"
102+
@update:model-value="toggle(addon, $event)"
103+
/>
104+
</div>
105+
<div class="addon-description">{{ manifest.description ?? '' }}</div>
106+
<span v-if="addon.type === 'builtin'" v-i18n class="addon-tag">Built-in#!addon-manager.3</span>
107+
<span v-else class="addon-author">{{ manifest.author ?? '' }}</span>
100108
</div>
101-
<div class="addon-description">{{ manifest.description ?? '' }}</div>
102-
<span v-if="addon.type === 'builtin'" v-i18n class="addon-tag">Built-in#!addon-manager.3</span>
103-
<span v-else class="addon-author">{{ manifest.author ?? '' }}</span>
104109
</div>
105110
</div>
106111
</form>
@@ -117,14 +122,30 @@ onMounted(() => {
117122
margin-top: 8px;
118123
}
119124
.addon-card {
125+
display: flex;
126+
gap: 16px;
120127
padding: 8px 0;
121-
border-top: 1px solid var(--design-separator);
122-
line-height: 24px;
123128
&.is-disabled {
124129
color: rgb(var(--theme-foreground) / 50%);
125130
}
126131
}
127-
.addon-card-title {
132+
.addon-icon {
133+
display: flex;
134+
justify-content: center;
135+
align-items: center;
136+
width: 48px;
137+
height: 48px;
138+
color: rgb(var(--system-accent));
139+
font-size: 24px;
140+
background: var(--design-highlight-background);
141+
border-radius: 8px;
142+
}
143+
.addon-info {
144+
flex: 1;
145+
min-width: 0;
146+
line-height: 24px;
147+
}
148+
.addon-title {
128149
display: flex;
129150
justify-content: space-between;
130151
align-items: center;

addons/addon-manager/src/renderer/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ export default () => {
99
commas.workspace.registerTabPane('addon-manager', {
1010
title: 'Addons#!addon-manager.1',
1111
component: AddonManagerPane,
12-
icon: {
13-
name: 'lucide-blocks',
14-
},
1512
})
1613

1714
commas.context.provide('preference.item', {

addons/ai/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"main": "index.js",
88
"author": "commas",
99
"license": "ISC",
10+
"commas:icon": {
11+
"name": "lucide-sparkles"
12+
},
1013
"commas:i18n": {
1114
"zh-CN": {
1215
"productName": "AI",

addons/cleaner/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"main": "index.js",
88
"author": "commas",
99
"license": "ISC",
10+
"commas:icon": {
11+
"name": "lucide-eraser"
12+
},
1013
"commas:i18n": {
1114
"zh-CN": {
1215
"productName": "缓存清理",

addons/cli/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
"chalk": "^4.1.2",
1616
"text-table": "^0.2.0"
1717
},
18+
"commas:icon": {
19+
"name": "lucide-terminal"
20+
},
1821
"commas:i18n": {
1922
"zh-CN": {
2023
"description": "Commas 命令行工具"

addons/clippy/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"devDependencies": {
1111
"clippyjs": "^0.0.3"
1212
},
13+
"commas:icon": {
14+
"name": "lucide-sticker"
15+
},
1316
"commas:i18n": {
1417
"zh-CN": {
1518
"productName": "大眼夹",

addons/editor/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"devDependencies": {
1111
"monaco-editor": "^0.51.0"
1212
},
13+
"commas:icon": {
14+
"name": "lucide-file-pen-line"
15+
},
1316
"commas:i18n": {
1417
"zh-CN": {
1518
"productName": "编辑器",

addons/git/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"main": "index.js",
88
"author": "commas",
99
"license": "ISC",
10+
"commas:icon": {
11+
"name": "lucide-git-branch"
12+
},
1013
"commas:i18n": {
1114
"zh-CN": {
1215
"productName": "Git 集成",

addons/iterm2/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"@types/canvas-confetti": "^1.6.4",
1212
"canvas-confetti": "^1.9.3"
1313
},
14+
"commas:icon": {
15+
"name": "lucide-dollar-sign"
16+
},
1417
"commas:i18n": {
1518
"zh-CN": {
1619
"productName": "iTerm2 转义码",

0 commit comments

Comments
 (0)