Use filled invert for the top-nav Create rule button.

Matches the Figma Filled Invert variant so the label stays white on the dark pill.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
adilallo
2026-08-18 18:41:50 -06:00
co-authored by Cursor
parent 3cdf4174d0
commit 65f7287639
2 changed files with 18 additions and 6 deletions
@@ -189,15 +189,11 @@ const TopContainer = memo<TopProps>(
containerSize: "small" | "medium" | "large" | "xlarge",
avatarSize: "small" | "medium" | "large" | "xlarge",
) => {
// Use ghost type when folderTop is true, filled (default) otherwise
const buttonType = folderTop ? "ghost" : "filled";
const palette = "default";
return (
<Button
size={buttonSize}
buttonType={buttonType}
palette={palette}
buttonType="filled"
palette="inverse"
onClick={handleCreateRuleClick}
ariaLabel={t("ariaLabels.createNewRule")}
>
+16
View File
@@ -100,4 +100,20 @@ describe('Top "Create rule" button', () => {
window.localStorage.getItem(CORE_VALUE_DETAILS_STORAGE_KEY),
).toBeNull();
});
it("uses filled invert for Create rule", () => {
for (const folderTop of [false, true]) {
const { unmount } = renderWithProviders(<Top folderTop={folderTop} />);
const [button] = screen.getAllByRole("button", {
name: /create a new rule/i,
});
expect(button.className).toContain(
"bg-[var(--color-surface-default-primary)]",
);
expect(button.className).toContain(
"text-[var(--color-content-default-primary)]",
);
unmount();
}
});
});