@@ -3,6 +3,7 @@ import { ipcRenderer } from '@commas/electron-ipc'
33import type { AddonInfo } from ' @commas/types/addon'
44import type { TerminalTab } from ' @commas/types/terminal'
55import * as commas from ' commas:api/renderer'
6+ import { sortBy } from ' lodash'
67import { onMounted , watchEffect } from ' vue'
78import { useDiscoveredAddons } from ' ./compositions'
89
@@ -34,16 +35,23 @@ watchEffect(() => {
3435})
3536
3637const addonList = $computed (() => {
37- return discoveredAddons
38- .filter (addon => {
39- if (! isBuiltinAddonsVisible && addon .type === ' builtin' ) return false
40- return true
41- })
42- .map (addon => ({
43- addon ,
44- manifest: commas .remote .getI18nManifest (addon .manifest ),
45- enabled: enabledAddons .includes (addon .name ),
46- }))
38+ return sortBy (
39+ discoveredAddons
40+ .filter (addon => {
41+ if (! isBuiltinAddonsVisible && addon .type === ' builtin' ) return false
42+ return true
43+ })
44+ .map (addon => ({
45+ addon ,
46+ manifest: commas .remote .getI18nManifest (addon .manifest ),
47+ enabled: enabledAddons .includes (addon .name ),
48+ })),
49+ [
50+ ({ enabled }) => (enabled ? 0 : 1 ),
51+ ({ addon }) => (addon .type === ' builtin' ? 1 : 0 ),
52+ ({ addon }) => addon .name ,
53+ ],
54+ )
4755})
4856
4957function toggle(addon : AddonInfo , enabled : boolean ) {
0 commit comments