feat(FN-806): replace hardcoded border-radius with dashboard token in agent-create-form

- Replace hardcoded border-radius value in AgentsView agent create form with CSS variable token
- Update dashboard README styling description for the Agents View create-form
- Add unit test for agent create form border-radius token usage
This commit is contained in:
gsxdsm
2026-04-03 20:54:32 -07:00
parent 603a04e312
commit 9eb4e2c634
3 changed files with 30 additions and 3 deletions

View File

@@ -612,7 +612,7 @@ export function AgentsView({ addToast, projectId }: AgentsViewProps) {
margin-bottom: 16px;
padding: 16px;
background: var(--bg-secondary);
border-radius: 8px;
border-radius: var(--radius-sm);
}
.agent-create-form .input {

View File

@@ -349,6 +349,33 @@ describe("AgentsView", () => {
);
});
});
it("renders create form with dashboard token-based styling", async () => {
render(<AgentsView addToast={mockAddToast} />);
await waitFor(() => {
expect(screen.getByText("New Agent")).toBeTruthy();
});
fireEvent.click(screen.getByText("New Agent"));
// The create form container is rendered
const createForm = document.querySelector(".agent-create-form");
expect(createForm).toBeTruthy();
// The inline style block should use var(--radius-sm) instead of hardcoded 8px
const styleElements = document.querySelectorAll("style");
let foundCreateFormRule = false;
styleElements.forEach(styleEl => {
const css = styleEl.textContent ?? "";
if (css.includes(".agent-create-form")) {
foundCreateFormRule = true;
// Must not contain hardcoded border-radius: 8px
expect(css).not.toMatch(/\.agent-create-form\s*\{[^}]*border-radius:\s*8px/);
}
});
expect(foundCreateFormRule).toBe(true);
});
});
describe("change agent state", () => {