diff --git a/web/src/js/__tests__/components/Command/__snapshots__/CommandSpec.js.snap b/web/src/js/__tests__/components/Command/__snapshots__/CommandSpec.js.snap index 5719df613..7a0bfc1de 100644 --- a/web/src/js/__tests__/components/Command/__snapshots__/CommandSpec.js.snap +++ b/web/src/js/__tests__/components/Command/__snapshots__/CommandSpec.js.snap @@ -13,6 +13,27 @@ exports[`CommandBar Component 1`] = `
+
+
+
+
+ + Available Commands: + +

+ [] +

+
+
+
@@ -30,11 +51,6 @@ exports[`CommandBar Component 1`] = ` value="" />
-
- Available Commands: [] -
`; diff --git a/web/src/js/components/CommandBar.tsx b/web/src/js/components/CommandBar.tsx index 82bc4e60b..13d5b98d5 100644 --- a/web/src/js/components/CommandBar.tsx +++ b/web/src/js/components/CommandBar.tsx @@ -14,7 +14,7 @@ function getAvailableCommands(commands, input = "") { return availableCommands } -export function CommandHelp({nextArgs, currentArg, help, description}){ +export function CommandHelp({nextArgs, currentArg, help, description, availableCommands}){ let results = [] for (let i = 0; i < nextArgs.length; i++) { if (i==currentArg) { @@ -26,9 +26,10 @@ export function CommandHelp({nextArgs, currentArg, help, description}){ return (
-
Argument suggestion: {results}
+ { results.length > 0 &&
Argument suggestion: {results}
} { help.includes("->") &&
Signature help: {help}
} { description &&
# {description}
} +
Available Commands:

{JSON.stringify(availableCommands)}

) } @@ -151,7 +152,7 @@ export default function CommandBar() {
))}
- { signatureHelp && } +
@@ -166,7 +167,6 @@ export default function CommandBar() { onKeyUp={onKeyUp} />
-
Available Commands: {JSON.stringify(availableCommands)}
) } \ No newline at end of file