Backend / staging cleanup, performance substrate, and create-flow polish #60

Merged
an.di merged 16 commits from adilallo/Backend/StagingCleanup into main 2026-05-26 15:11:47 +00:00
6 changed files with 18 additions and 37 deletions
Showing only changes of commit 59999b8211 - Show all commits
@@ -79,7 +79,6 @@ const MiniContainer = memo<MiniProps>(
return { return {
wrapperElement: "div" as const, wrapperElement: "div" as const,
wrapperProps: { wrapperProps: {
...baseProps,
className: "block", className: "block",
}, },
}; };
@@ -27,7 +27,6 @@ const FeatureGridContainer = memo<FeatureGridProps>(
panelContent: getAssetPath(featurePanelPath("support")), panelContent: getAssetPath(featurePanelPath("support")),
...featurePanelLayout("support"), ...featurePanelLayout("support"),
ariaLabel: t("featureGrid.features.decisionMaking.ariaLabel"), ariaLabel: t("featureGrid.features.decisionMaking.ariaLabel"),
href: "#decision-making",
}, },
{ {
backgroundColor: "bg-[var(--color-surface-invert-brand-lime)]", backgroundColor: "bg-[var(--color-surface-invert-brand-lime)]",
@@ -40,7 +39,6 @@ const FeatureGridContainer = memo<FeatureGridProps>(
panelContent: getAssetPath(featurePanelPath("exercises")), panelContent: getAssetPath(featurePanelPath("exercises")),
...featurePanelLayout("exercises"), ...featurePanelLayout("exercises"),
ariaLabel: t("featureGrid.features.valuesAlignment.ariaLabel"), ariaLabel: t("featureGrid.features.valuesAlignment.ariaLabel"),
href: "#values-alignment",
}, },
{ {
backgroundColor: "bg-[var(--color-surface-invert-brand-rust)]", backgroundColor: "bg-[var(--color-surface-invert-brand-rust)]",
@@ -53,7 +51,6 @@ const FeatureGridContainer = memo<FeatureGridProps>(
panelContent: getAssetPath(featurePanelPath("guidance")), panelContent: getAssetPath(featurePanelPath("guidance")),
...featurePanelLayout("guidance"), ...featurePanelLayout("guidance"),
ariaLabel: t("featureGrid.features.membershipGuidance.ariaLabel"), ariaLabel: t("featureGrid.features.membershipGuidance.ariaLabel"),
href: "#membership-guidance",
}, },
{ {
backgroundColor: "bg-[var(--color-surface-invert-brand-teal)]", backgroundColor: "bg-[var(--color-surface-invert-brand-teal)]",
@@ -66,7 +63,6 @@ const FeatureGridContainer = memo<FeatureGridProps>(
panelContent: getAssetPath(featurePanelPath("tools")), panelContent: getAssetPath(featurePanelPath("tools")),
...featurePanelLayout("tools"), ...featurePanelLayout("tools"),
ariaLabel: t("featureGrid.features.conflictResolution.ariaLabel"), ariaLabel: t("featureGrid.features.conflictResolution.ariaLabel"),
href: "#conflict-resolution",
}, },
], ],
[t], [t],
@@ -13,7 +13,6 @@ export interface Feature {
panelHeight: number; panelHeight: number;
panelImageClassName?: string; panelImageClassName?: string;
ariaLabel: string; ariaLabel: string;
href: string;
} }
export interface FeatureGridViewProps extends FeatureGridProps { export interface FeatureGridViewProps extends FeatureGridProps {
@@ -26,7 +26,7 @@ function FeatureGridView({
> >
<div <div
data-figma-node="18847-22410" data-figma-node="18847-22410"
className="rounded-[var(--measures-radius-500,20px)] bg-[var(--color-surface-default-secondary)] px-[var(--spacing-scale-020)] py-[var(--spacing-scale-032)] focus-within:ring-2 focus-within:ring-[var(--color-surface-default-brand-royal)] focus-within:ring-offset-2 md:px-[var(--spacing-scale-048)] md:pb-[var(--spacing-scale-048)] md:pt-[var(--spacing-scale-076)] lg:pb-[var(--spacing-scale-076)]" className="rounded-[var(--measures-radius-500,20px)] bg-[var(--color-surface-default-secondary)] px-[var(--spacing-scale-020)] py-[var(--spacing-scale-032)] md:px-[var(--spacing-scale-048)] md:pb-[var(--spacing-scale-048)] md:pt-[var(--spacing-scale-076)] lg:pb-[var(--spacing-scale-076)]"
> >
<div className="mx-auto w-full gap-[var(--spacing-scale-048)] [container-type:inline-size] lg:flex lg:items-start lg:gap-[var(--spacing-scale-048)]"> <div className="mx-auto w-full gap-[var(--spacing-scale-048)] [container-type:inline-size] lg:flex lg:items-start lg:gap-[var(--spacing-scale-048)]">
<div className="lg:min-w-0 lg:shrink"> <div className="lg:min-w-0 lg:shrink">
@@ -52,7 +52,6 @@ function FeatureGridView({
panelHeight={feature.panelHeight} panelHeight={feature.panelHeight}
panelImageClassName={feature.panelImageClassName} panelImageClassName={feature.panelImageClassName}
ariaLabel={feature.ariaLabel} ariaLabel={feature.ariaLabel}
href={feature.href}
featureGridShell featureGridShell
/> />
))} ))}
+13 -12
View File
@@ -46,20 +46,21 @@ describe("FeatureGrid (behavioral tests)", () => {
).toBeInTheDocument(); ).toBeInTheDocument();
}); });
it("renders all four feature cards", () => { it("renders all four feature cards as static tiles", () => {
render(<FeatureGrid title="Test" subtitle="Test" />); render(<FeatureGrid title="Test" subtitle="Test" />);
expect(screen.getByText("Decision-making")).toBeInTheDocument();
expect(screen.getByText("Values alignment")).toBeInTheDocument();
expect(screen.getByText("Membership")).toBeInTheDocument();
expect(screen.getByText("Conflict resolution")).toBeInTheDocument();
expect( expect(
screen.getByRole("link", { name: "Decision-making support tools" }), screen.queryByRole("link", { name: "Decision-making support tools" }),
).toBeInTheDocument(); ).not.toBeInTheDocument();
expect( });
screen.getByRole("link", { name: "Values alignment exercises" }),
).toBeInTheDocument(); it("does not apply a focus ring to the entire grid shell", () => {
expect( render(<FeatureGrid title="Test" subtitle="Test" />);
screen.getByRole("link", { name: "Membership guidance resources" }), const shell = document.querySelector('[data-figma-node="18847-22410"]');
).toBeInTheDocument(); expect(shell?.className).not.toContain("focus-within:ring-2");
expect(
screen.getByRole("link", { name: "Conflict resolution tools" }),
).toBeInTheDocument();
}); });
it("has proper accessibility attributes", () => { it("has proper accessibility attributes", () => {
+3 -16
View File
@@ -129,24 +129,11 @@ test.describe("Critical User Journeys", () => {
featureSection.locator("text=Conflict resolution"), featureSection.locator("text=Conflict resolution"),
).toBeVisible(); ).toBeVisible();
// Check feature links - Mini tiles render as <a> tags with href="#..." // Feature tiles are presentational — only the lockup "Learn more" is a link
// There are 4 feature cards + 1 "Learn more" link = 5 total links
// We check for the specific feature card links
await expect( await expect(
featureSection.locator('a[href="#decision-making"]'), featureSection.locator('a[href="#decision-making"]'),
).toBeVisible(); ).toHaveCount(0);
await expect( await expect(featureSection.getByRole("link", { name: "Learn more" })).toBeVisible();
featureSection.locator('a[href="#values-alignment"]'),
).toBeVisible();
await expect(
featureSection.locator('a[href="#membership-guidance"]'),
).toBeVisible();
await expect(
featureSection.locator('a[href="#conflict-resolution"]'),
).toBeVisible();
// Test feature card interactions
await page.locator('a[href="#decision-making"]').click();
}); });
test("header navigation functionality", async ({ page }) => { test("header navigation functionality", async ({ page }) => {