Преглед изворни кода

fix(app): hide badge for builtin slash commands

Add source: 'command' to builtin and config-defined commands so they
don't show a 'custom' badge. Only MCP and skill commands show badges.
R44VC0RP пре 3 недеља
родитељ
комит
cb6ec0a564

+ 1 - 1
packages/app/src/components/prompt-input.tsx

@@ -1728,7 +1728,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
                         </Show>
                       </div>
                       <div class="flex items-center gap-2 shrink-0">
-                        <Show when={cmd.type === "custom"}>
+                        <Show when={cmd.type === "custom" && cmd.source !== "command"}>
                           <span class="text-11-regular text-text-subtle px-1.5 py-0.5 bg-surface-base rounded">
                             {cmd.source === "skill"
                               ? language.t("prompt.slash.badge.skill")

+ 3 - 0
packages/opencode/src/command/index.ts

@@ -63,6 +63,7 @@ export namespace Command {
       [Default.INIT]: {
         name: Default.INIT,
         description: "create/update AGENTS.md",
+        source: "command",
         get template() {
           return PROMPT_INITIALIZE.replace("${path}", Instance.worktree)
         },
@@ -71,6 +72,7 @@ export namespace Command {
       [Default.REVIEW]: {
         name: Default.REVIEW,
         description: "review changes [commit|branch|pr], defaults to uncommitted",
+        source: "command",
         get template() {
           return PROMPT_REVIEW.replace("${path}", Instance.worktree)
         },
@@ -85,6 +87,7 @@ export namespace Command {
         agent: command.agent,
         model: command.model,
         description: command.description,
+        source: "command",
         get template() {
           return command.template
         },