From 7091dc152f72117993973333661c9ea759e70e22 Mon Sep 17 00:00:00 2001 From: Alexander Medvedev Date: Mon, 31 Aug 2026 21:35:25 +0200 Subject: [PATCH] chore: make sidebar non sticky --- src/App.css | 2 - src/locales/de.json | 3 +- src/locales/en.json | 3 +- src/locales/es.json | 3 +- src/locales/fr.json | 3 +- src/locales/it.json | 3 +- src/locales/ja.json | 3 +- src/locales/ko.json | 3 +- src/locales/nl.json | 3 +- src/locales/pl.json | 3 +- src/locales/pt.json | 3 +- src/locales/ru.json | 3 +- src/locales/tr.json | 5 ++- src/locales/zh.json | 3 +- src/pages/PluginDetail.tsx | 30 ++++++++++++- src/pages/dashboard/plugin/AddPlugin.tsx | 45 +++++++++++++------ src/pages/dashboard/plugin/StoreListing.tsx | 48 +++++++++++++++------ src/types/plugin.ts | 1 + 18 files changed, 125 insertions(+), 42 deletions(-) diff --git a/src/App.css b/src/App.css index 8fc8a48..c15abbc 100644 --- a/src/App.css +++ b/src/App.css @@ -1805,8 +1805,6 @@ h3 { padding: 2rem; border-radius: 12px; border: 1px solid var(--border); - position: sticky; - top: 120px; } .sidebar-widget h3 { diff --git a/src/locales/de.json b/src/locales/de.json index fda361f..9cd2abc 100644 --- a/src/locales/de.json +++ b/src/locales/de.json @@ -76,8 +76,9 @@ "success": "Meldung eingereicht. Unser Team wird sie prüfen." }, "commands": { - "title": "Befehle & Berechtigungen", + "title": "Befehle", "no_commands": "Keine Befehle für dieses Plugin angegeben.", + "aliases": "Aliasse", "permission": "Berechtigung", "no_permission": "Keine erforderlich", "copy_command": "Befehl kopieren", diff --git a/src/locales/en.json b/src/locales/en.json index 4d6e500..3fa9c35 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -76,8 +76,9 @@ "success": "Report submitted. Our moderation team will investigate." }, "commands": { - "title": "Commands & Permissions", + "title": "Commands", "no_commands": "No commands listed for this plugin.", + "aliases": "Aliases", "permission": "Permission", "no_permission": "None required", "copy_command": "Copy command", diff --git a/src/locales/es.json b/src/locales/es.json index 238c534..1868d6b 100644 --- a/src/locales/es.json +++ b/src/locales/es.json @@ -76,8 +76,9 @@ "success": "Reporte enviado. Nuestro equipo lo revisará." }, "commands": { - "title": "Comandos y Permisos", + "title": "Comandos", "no_commands": "No hay comandos listados para este plugin.", + "aliases": "Alias", "permission": "Permiso", "no_permission": "Ninguno requerido", "copy_command": "Copiar comando", diff --git a/src/locales/fr.json b/src/locales/fr.json index 7f47361..475fd80 100644 --- a/src/locales/fr.json +++ b/src/locales/fr.json @@ -76,8 +76,9 @@ "success": "Signalement envoyé. Notre équipe va l'examiner." }, "commands": { - "title": "Commandes et Permissions", + "title": "Commandes", "no_commands": "Aucune commande listée pour ce plugin.", + "aliases": "Alias", "permission": "Permission", "no_permission": "Aucune requise", "copy_command": "Copier la commande", diff --git a/src/locales/it.json b/src/locales/it.json index 884c0b4..25f59fd 100644 --- a/src/locales/it.json +++ b/src/locales/it.json @@ -76,8 +76,9 @@ "success": "Segnalazione inviata. Il team di moderazione verificherà." }, "commands": { - "title": "Comandi e Permessi", + "title": "Comandi", "no_commands": "Nessun comando elencato per questo plugin.", + "aliases": "Alias", "permission": "Permesso", "no_permission": "Nessuno richiesto", "copy_command": "Copia comando", diff --git a/src/locales/ja.json b/src/locales/ja.json index 13fe3e3..ad04681 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -76,8 +76,9 @@ "success": "報告を受け付けました。運営チームが確認いたします。" }, "commands": { - "title": "コマンドと権限", + "title": "コマンド", "no_commands": "このプラグインに登録されているコマンドはありません。", + "aliases": "エイリアス", "permission": "権限", "no_permission": "権限不要", "copy_command": "コマンドをコピー", diff --git a/src/locales/ko.json b/src/locales/ko.json index 9ee5516..8fece56 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -76,8 +76,9 @@ "success": "신고가 접수되었습니다. 검토 후 처리하겠습니다." }, "commands": { - "title": "명령어 및 권한", + "title": "명령어", "no_commands": "이 플러그인에 등록된 명령어가 없습니다.", + "aliases": "별칭", "permission": "권한", "no_permission": "필요 없음", "copy_command": "명령어 복사", diff --git a/src/locales/nl.json b/src/locales/nl.json index 4708d0f..0a8fd4b 100644 --- a/src/locales/nl.json +++ b/src/locales/nl.json @@ -76,8 +76,9 @@ "success": "Melding verzonden. Ons moderatieteam zal dit onderzoeken." }, "commands": { - "title": "Commando's & Permissies", + "title": "Commando's", "no_commands": "Geen commando's vermeld voor deze plugin.", + "aliases": "Aliassen", "permission": "Permissie", "no_permission": "Geen vereist", "copy_command": "Kopieer commando", diff --git a/src/locales/pl.json b/src/locales/pl.json index a5cdca3..04badd0 100644 --- a/src/locales/pl.json +++ b/src/locales/pl.json @@ -76,8 +76,9 @@ "success": "Zgłoszenie wysłane. Zespół moderacji zajmie się sprawą." }, "commands": { - "title": "Polecenia i Uprawnienia", + "title": "Polecenia", "no_commands": "Brak poleceń dla tego pluginu.", + "aliases": "Aliasy", "permission": "Uprawnienie", "no_permission": "Brak wymaganego", "copy_command": "Kopiuj polecenie", diff --git a/src/locales/pt.json b/src/locales/pt.json index 521d239..8facea0 100644 --- a/src/locales/pt.json +++ b/src/locales/pt.json @@ -76,8 +76,9 @@ "success": "Denúncia enviada com sucesso. Nossa equipe irá analisar." }, "commands": { - "title": "Comandos e Permissões", + "title": "Comandos", "no_commands": "Nenhum comando listado para este plugin.", + "aliases": "Aliases", "permission": "Permissão", "no_permission": "Nenhuma necessária", "copy_command": "Copiar comando", diff --git a/src/locales/ru.json b/src/locales/ru.json index 5518867..2bead31 100644 --- a/src/locales/ru.json +++ b/src/locales/ru.json @@ -76,8 +76,9 @@ "success": "Жалоба отправлена на рассмотрение модераторам." }, "commands": { - "title": "Команды и Права", + "title": "Команды", "no_commands": "У этого плагина нет зарегистрированных команд.", + "aliases": "Алиасы", "permission": "Право", "no_permission": "Не требуется", "copy_command": "Скопировать команду", diff --git a/src/locales/tr.json b/src/locales/tr.json index 15d725f..75a73c7 100644 --- a/src/locales/tr.json +++ b/src/locales/tr.json @@ -76,9 +76,10 @@ "success": "Bildirim iletildi. Moderasyon ekibimiz inceleyecektir." }, "commands": { - "title": "Komutlar ve İzinler", + "title": "Komutlar", "no_commands": "Bu eklenti için listelenmiş komut yok.", - "permission": "İzin", + "aliases": "Takma Adlar", + "permission": "Yetki", "no_permission": "Gerekli değil", "copy_command": "Komutu kopyala", "copy_permission": "İzni kopyala", diff --git a/src/locales/zh.json b/src/locales/zh.json index 2a77839..03fb72a 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -76,8 +76,9 @@ "success": "举报已提交,审核团队将尽快处理。" }, "commands": { - "title": "命令与权限", + "title": "指令", "no_commands": "此插件未列出任何指令。", + "aliases": "别名", "permission": "权限", "no_permission": "无需权限", "copy_command": "复制指令", diff --git a/src/pages/PluginDetail.tsx b/src/pages/PluginDetail.tsx index b94d0e2..ef7b1ee 100644 --- a/src/pages/PluginDetail.tsx +++ b/src/pages/PluginDetail.tsx @@ -208,7 +208,7 @@ const PluginCommandsSidebarWidget = ({ commands }: { commands?: PluginCommand[]

- {t('plugin.commands.title', 'Commands & Permissions')} + {t('plugin.commands.title', 'Commands')}

+ {/* Aliases row */} + {cmd.aliases && Array.isArray(cmd.aliases) && cmd.aliases.length > 0 ? ( +
+ + {t('plugin.commands.aliases', 'Aliases')}: + + {cmd.aliases.map((alias: string, aIdx: number) => { + const formattedAlias = alias.startsWith('/') ? alias : `/${alias}`; + return ( + + {formattedAlias} + + ); + })} +
+ ) : null} + {/* Permission row */} {cmd.permission ? (
diff --git a/src/pages/dashboard/plugin/AddPlugin.tsx b/src/pages/dashboard/plugin/AddPlugin.tsx index a557dc0..15feb02 100644 --- a/src/pages/dashboard/plugin/AddPlugin.tsx +++ b/src/pages/dashboard/plugin/AddPlugin.tsx @@ -236,6 +236,7 @@ const AddPlugin = () => { const [commands, setCommands] = useState; }>>([]); @@ -245,13 +246,14 @@ const AddPlugin = () => { ...prev, { name: '', + aliases: '', permission: '', descriptions: { [activeLocale]: '' } } ]); }; - const updateCommandField = (index: number, field: 'name' | 'permission', value: string) => { + const updateCommandField = (index: number, field: 'name' | 'permission' | 'aliases', value: string) => { const cleanValue = field === 'name' ? value.replace(/^\/+/, '') : value; setCommands(prev => { const next = [...prev]; @@ -462,12 +464,18 @@ const AddPlugin = () => { try { const validCommands = commands .filter(c => c.name.trim().replace(/^\/+/, '').length > 0) - .map((c, idx) => ({ - name: c.name.trim().replace(/^\/+/, ''), - permission: c.permission.trim() || undefined, - description: c.descriptions, - display_order: idx, - })); + .map((c, idx) => { + const aliases = c.aliases + ? c.aliases.split(',').map(a => a.trim().replace(/^\/+/, '')).filter(a => a.length > 0) + : undefined; + return { + name: c.name.trim().replace(/^\/+/, ''), + aliases: aliases && aliases.length > 0 ? aliases : undefined, + permission: c.permission.trim() || undefined, + description: c.descriptions, + display_order: idx, + }; + }); const metadata = { name, @@ -810,11 +818,11 @@ const AddPlugin = () => { )}
- {/* Commands & Permissions */} + {/* Commands */}
- Commands & Permissions + Commands