Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(site): disable task prompt submit button when prompt empty#20357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DanielleMaywood merged 2 commits intomainfromdanielle/tasks/submit-button
Oct 17, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletionssite/src/modules/tasks/TaskPrompt/TaskPrompt.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -72,6 +72,37 @@ export const ReadOnlyPresetPrompt: Story = {
},
};

export const SubmitEnabledWhenPromptNotEmpty: Story = {
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);

const prompt = await canvas.findByLabelText(/prompt/i);
await userEvent.type(prompt, MockNewTaskData.prompt);

const submitButton = canvas.getByRole("button", { name: /run task/i });
expect(submitButton).toBeEnabled();
},
};

export const SubmitDisabledWhenPromptEmpty: Story = {
play: async ({ canvasElement, step }) => {
const canvas = within(canvasElement);

await step("No prompt", async () => {
const submitButton = canvas.getByRole("button", { name: /run task/i });
expect(submitButton).toBeDisabled();
});

await step("Whitespace prompt", async () => {
const prompt = await canvas.findByLabelText(/prompt/i);
await userEvent.type(prompt, " ");

const submitButton = canvas.getByRole("button", { name: /run task/i });
expect(submitButton).toBeDisabled();
});
},
};

export const OnSuccess: Story = {
decorators: [withGlobalSnackbar],
parameters: {
Expand Down
2 changes: 1 addition & 1 deletionsite/src/modules/tasks/TaskPrompt/TaskPrompt.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -368,7 +368,7 @@ const CreateTaskForm: FC<CreateTaskFormProps> = ({ templates, onSuccess }) => {
<Button
size="icon"
type="submit"
disabled={isMissingExternalAuth}
disabled={prompt.trim().length === 0 ||isMissingExternalAuth}
className="rounded-full disabled:bg-surface-invert-primary disabled:opacity-70"
>
<Spinner
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp