Skip to content
Open
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
3 changes: 2 additions & 1 deletion src/app/WorkspaceBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const WorkspaceBar = () => {

const openInput = () => {
setOpen(true);
setTyping("");
setTyping(workspaceName);
setSelectedIndex(0);
};

Expand Down Expand Up @@ -212,6 +212,7 @@ export const WorkspaceBar = () => {
type="text"
className={styles.input}
autoFocus
onFocus={(e) => e.target.select()}
value={typing}
placeholder="Rename your model or search for one"
onBlur={cancelInput}
Expand Down
2 changes: 2 additions & 0 deletions src/app/__tests__/WorkspaceBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ it("should rename the workspace", async () => {
await clickRename();

const input = screen.getByRole("textbox");
await userEvent.clear(input);
await userEvent.type(input, "new name[Enter]");

expect(input).not.toHaveFocus();
Expand Down Expand Up @@ -79,6 +80,7 @@ it("should not rename when name is invalid", async () => {
await clickRename();

const input = screen.getByRole("textbox");
await userEvent.clear(input);
await userEvent.type(input, " [Enter]");

expect(input).toHaveFocus();
Expand Down