Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ vi.mock("../state/environments", async (original) => ({
serverConfig: {
environment: { platform: { os: "linux" }, capabilities: { projectCloneTracking: true } },
settings: { addProjectBaseDirectory: "/workspace/" },
newProjectsRoot: "/workspace/",
},
},
],
Expand Down Expand Up @@ -147,3 +148,18 @@ it("keeps the caret in place when an edit briefly makes the folder path not a pa
await userEvent.keyboard("w");
await expect.element(input()).toHaveValue("/wworkspace/project");
});

it.each([
{ flow: "Git URL", value: "https://github.com/pingdotgg/t3code.git", submit: "Continue (Enter)" },
{ flow: "New project", value: "demo-tab-order", submit: /^Create \(/ },
])("moves focus from the $flow input to its enabled submit button on Tab", async (step) => {
await using _screen = await render(<CommandPalette>{null}</CommandPalette>);
await act(() => openCommandPalette({ open: "add-project" }));
await page.getByText(step.flow, { exact: true }).click();
const input = page.getByRole("combobox");
await input.fill(step.value);
const submit = page.getByRole("button", { name: step.submit });
await expect.element(submit).toBeEnabled();
await userEvent.keyboard("{Tab}");
await expect.element(submit).toHaveFocus();
});
1 change: 0 additions & 1 deletion apps/web/src/components/CommandPaletteAddProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ export function CommandPaletteSubmitButton(props: {
<Button
variant="outline"
size="xs"
tabIndex={-1}
className="absolute inset-e-2.5 top-1/2 -translate-y-1/2"
aria-label={props.ariaLabel}
disabled={props.disabled}
Expand Down
Loading