Skip to content

Commit 6acd592

Browse files
committed
fix: clarify workflow slash command hints
1 parent 472435a commit 6acd592

4 files changed

Lines changed: 19 additions & 5 deletions

File tree

src/browser/features/RightSidebar/Workflows/WorkflowEmptyState.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from "react";
22
import { BookOpen, Play, Workflow } from "lucide-react";
33

4+
import { SLASH_COMMAND_HINTS } from "@/common/constants/slashCommandHints";
45
import type { AvailableWorkflow, WorkflowArgSummary } from "@/common/types/workflow";
56

67
import { WorkflowScopeBadge } from "./WorkflowBadges";
@@ -231,11 +232,12 @@ export const WorkflowEmptyState: React.FC<WorkflowEmptyStateProps> = (props) =>
231232
)}
232233

233234
<div className="text-muted pt-1 text-center text-[11.5px]">
234-
Or start one from chat with{" "}
235+
Start one from chat with{" "}
235236
<span className="border-border bg-surface-secondary rounded border px-1.5 py-px font-mono">
236-
/
237+
{`/workflow ${SLASH_COMMAND_HINTS.workflow}`}
237238
</span>
238-
, or author one in <span className="text-content-secondary font-mono">.mux/workflows/</span>
239+
; workspace <span className="text-content-secondary font-mono">.js</span> workflows are
240+
loaded by explicit path.
239241
</div>
240242
</div>
241243
);

src/browser/utils/slashCommands/ghostHint.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ describe("getCommandGhostHint", () => {
5858
).toBe(SLASH_COMMAND_HINTS.heartbeat);
5959
});
6060

61+
it("returns only workflow args after the typed /workflow command", () => {
62+
const enabledExperiments = new Set<ExperimentId>([EXPERIMENT_IDS.DYNAMIC_WORKFLOWS]);
63+
64+
const hint = getCommandGhostHint("/workflow ", false, {
65+
isExperimentEnabled: (experimentId) => enabledExperiments.has(experimentId),
66+
});
67+
68+
expect(hint).toBe("<script_path> [args]");
69+
expect(hint).not.toContain("/workflow");
70+
});
71+
6172
it("returns goal hints regardless of experiment state after GA", () => {
6273
expect(
6374
getCommandGhostHint("/goal ", false, {

src/browser/utils/slashCommands/registry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,13 +665,13 @@ const btwCommandDefinition: SlashCommandDefinition = {
665665
},
666666
};
667667

668-
const WORKFLOW_COMMAND_USAGE = "/workflow <script_path> [args]";
668+
const WORKFLOW_COMMAND_USAGE = `/workflow ${SLASH_COMMAND_HINTS.workflow}`;
669669

670670
const workflowCommandDefinition: SlashCommandDefinition = {
671671
key: "workflow",
672672
description: "Run an explicit workflow by script path",
673673
experimentGate: EXPERIMENT_IDS.DYNAMIC_WORKFLOWS,
674-
inputHint: WORKFLOW_COMMAND_USAGE,
674+
inputHint: SLASH_COMMAND_HINTS.workflow,
675675
handler: ({ rawInput }): ParsedCommand => {
676676
const trimmed = rawInput.trim();
677677
if (!trimmed) {

src/common/constants/slashCommandHints.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ export const SLASH_COMMAND_HINTS = {
1212
heartbeat: "<minutes>|off",
1313
goal: "[-b <amount>] [--turns <n>] <objective>|budget <amount>|clear",
1414
btw: "<question>",
15+
workflow: "<script_path> [args]",
1516
} as const satisfies Readonly<Record<string, string>>;

0 commit comments

Comments
 (0)