π OpenHands: AI-Driven Development
fix: show pointer cursor on NewConversationButton popover items (#297)
Hiep Leb88c64307fe9
diff --git a/__tests__/components/features/conversation-panel/new-conversation-button-cloud.test.tsx b/__tests__/components/features/conversation-panel/new-conversation-button-cloud.test.tsxindex 158eee2735..19937d155b 100644--- a/__tests__/components/features/conversation-panel/new-conversation-button-cloud.test.tsx+++ b/__tests__/components/features/conversation-panel/new-conversation-button-cloud.test.tsx@@ -221,6 +221,34 @@ describe("NewConversationButton (cloud)", () => {expect(screen.getByTestId("cloud-provider-tab-gitlab")).toBeInTheDocument();});+ it("applies the pointer-cursor affordance to every interactive popover item", async () => {+ mockUseGitRepositories.mockReturnValue({+ data: {+ pages: [+ {+ items: [makeRepo("octo/cat", { main_branch: "main" })],+ next_page_id: "page-2",+ },+ ],+ },+ isLoading: false,+ isError: false,+ hasNextPage: true,+ isFetchingNextPage: false,+ fetchNextPage: vi.fn(),+ onLoadMore: vi.fn(),+ });++ const user = userEvent.setup();+ renderWithProviders(<NewConversationButton />);++ await user.click(screen.getByTestId("new-conversation-button"));++ for (const testId of ["launch-repository", "cloud-repo-load-more"]) {+ expect(screen.getByTestId(testId)).toHaveClass("cursor-pointer");+ }+ });+it("shows an empty state when no repositories are returned", async () => {mockUseGitRepositories.mockReturnValue({data: { pages: [{ items: [], next_page_id: null }] },diff --git a/__tests__/components/features/conversation-panel/new-conversation-button.test.tsx b/__tests__/components/features/conversation-panel/new-conversation-button.test.tsxindex 0d41206364..feeb83c31c 100644--- a/__tests__/components/features/conversation-panel/new-conversation-button.test.tsx+++ b/__tests__/components/features/conversation-panel/new-conversation-button.test.tsx@@ -188,6 +188,29 @@ describe("NewConversationButton", () => {expect(screen.getByTestId("new-conversation-popover")).toBeInTheDocument();});+ it("applies the pointer-cursor affordance to every interactive popover item", async () => {+ useWorkspacesStore.getState().addWorkspaces([+ {+ id: "/workspace/project/repo1",+ name: "repo1",+ path: "/workspace/project/repo1",+ },+ ]);+ const user = userEvent.setup();+ renderWithProviders(<NewConversationButton />);++ await user.click(screen.getByTestId("new-conversation-button"));++ for (const testId of [+ "launch-no-workspace",+ "launch-workspace",+ "add-workspaces-button",+ "manage-workspaces-button",+ ]) {+ expect(screen.getByTestId(testId)).toHaveClass("cursor-pointer");+ }+ });+it("keeps the popover open when conversation creation fails", async () => {const navigate = vi.fn();const createSpy = vidiff --git a/src/components/features/conversation-panel/new-conversation-button-cloud.tsx b/src/components/features/conversation-panel/new-conversation-button-cloud.tsxindex a0b3593143..b5c4387c61 100644--- a/src/components/features/conversation-panel/new-conversation-button-cloud.tsx+++ b/src/components/features/conversation-panel/new-conversation-button-cloud.tsx@@ -170,7 +170,7 @@ export function CloudNewConversationButton({};const itemClass = cn(- "flex items-center gap-2 w-full px-2 py-2 text-sm text-white text-left",+ "flex items-center gap-2 w-full px-2 py-2 text-sm text-white text-left cursor-pointer","hover:bg-[#5C5D62] rounded-md transition-colors duration-150 font-normal","disabled:opacity-60 disabled:cursor-not-allowed",);diff --git a/src/components/features/conversation-panel/new-conversation-button-local.tsx b/src/components/features/conversation-panel/new-conversation-button-local.tsxindex 1ade7cc414..947314e107 100644--- a/src/components/features/conversation-panel/new-conversation-button-local.tsx+++ b/src/components/features/conversation-panel/new-conversation-button-local.tsx@@ -101,7 +101,7 @@ export function LocalNewConversationButton({};const itemClass = cn(- "flex items-center gap-2 w-full px-2 py-2 text-sm text-white text-left",+ "flex items-center gap-2 w-full px-2 py-2 text-sm text-white text-left cursor-pointer","hover:bg-[#5C5D62] rounded-md transition-colors duration-150 font-normal","disabled:opacity-60 disabled:cursor-not-allowed",);