Compare commits

...

1 Commits

Author SHA1 Message Date
Naiyuan Qing
c0468961e3 fix(views): left-align picker item rows
Co-authored-by: multica-agent <github@multica.ai>
2026-06-04 10:10:25 +08:00
2 changed files with 13 additions and 1 deletions

View File

@@ -109,6 +109,18 @@ describe("AgentDropdown", () => {
expect(screen.queryByText("Others")).not.toBeInTheDocument();
});
it("left-aligns agent picker rows", async () => {
renderDropdown();
const dialog = await screen.findByRole("dialog");
const alphaRow = Array.from(
dialog.querySelectorAll<HTMLButtonElement>("button[data-picker-item]"),
).find((row) => row.textContent?.includes("Alpha"));
expect(alphaRow).toBeDefined();
expect(alphaRow).toHaveClass("text-left");
});
it("keeps the current agent marked and selects another agent", async () => {
const { onSelect } = renderDropdown();

View File

@@ -217,7 +217,7 @@ export function PickerItem({
data-picker-item
disabled={disabled}
onClick={onClick}
className={`flex w-full items-center gap-3 rounded-md px-2 py-1.5 text-sm ${disabled ? "opacity-50 cursor-not-allowed" : hoverClassName ?? "hover:bg-accent"} transition-colors`}
className={`flex w-full items-center gap-3 rounded-md px-2 py-1.5 text-left text-sm ${disabled ? "opacity-50 cursor-not-allowed" : hoverClassName ?? "hover:bg-accent"} transition-colors`}
>
{/* min-w-0 lets long children (like truncated label names) shrink
inside the flex row instead of pushing the selected checkmark off