feat(FN-956): improve remote edit button usability on mobile and desktop

- Increase remote edit icon size from 12px to 16px for better tap/click targets
- Add mobile-specific CSS rules to show/hide remote edit buttons based on screen size
- Add comprehensive test coverage for mobile-friendly edit button visibility
This commit is contained in:
gsxdsm
2026-04-05 11:07:28 -07:00
parent ec2dc79569
commit 56dc5e8d3e
3 changed files with 51 additions and 4 deletions

View File

@@ -1195,6 +1195,37 @@ describe("GitManagerModal", () => {
});
});
it("applies mobile-friendly edit button class for touch targets", async () => {
(fetchGitRemotesDetailed as any).mockResolvedValue([
{ name: "origin", fetchUrl: "https://github.com/a/b.git", pushUrl: "https://github.com/a/b.git" },
]);
render(
<GitManagerModal isOpen={true} onClose={vi.fn()} tasks={mockTasks} addToast={mockAddToast} />
);
fireEvent.click(screen.getByRole("tab", { name: /remotes/i }));
await waitFor(() => {
expect(screen.getByText("origin")).toBeInTheDocument();
});
// Both edit buttons should have the mobile-friendly class for adequate touch targets
const nameEditBtn = screen.getByTitle("Edit remote name");
const urlEditBtn = screen.getByTitle("Edit remote URL");
expect(nameEditBtn.classList.contains("gm-remote-edit-btn")).toBe(true);
expect(urlEditBtn.classList.contains("gm-remote-edit-btn")).toBe(true);
// Both should be visible and have 16px icons
expect(nameEditBtn).toBeVisible();
expect(urlEditBtn).toBeVisible();
const nameSvg = nameEditBtn.querySelector("svg");
const urlSvg = urlEditBtn.querySelector("svg");
expect(nameSvg).toBeTruthy();
expect(urlSvg).toBeTruthy();
});
it("handles API errors gracefully", async () => {
(fetchGitRemotesDetailed as any).mockRejectedValue(new Error("Failed to load remotes"));