From 852f6cecba106eb9d000f95fc1ae9863157a5d3b Mon Sep 17 00:00:00 2001 From: SnapOtter Date: Wed, 1 Jul 2026 21:05:22 +0800 Subject: [PATCH] fix: show modality starting points in landing command center (#387) --- apps/landing/src/components/ToolGrid.astro | 17 ++++++++++------- tests/e2e-landing/homepage.spec.ts | 13 +++++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/apps/landing/src/components/ToolGrid.astro b/apps/landing/src/components/ToolGrid.astro index b7346382..058d97da 100644 --- a/apps/landing/src/components/ToolGrid.astro +++ b/apps/landing/src/components/ToolGrid.astro @@ -567,17 +567,20 @@ const safeDefaultToolIdsJson = JSON.stringify(defaultToolIds).replace(/ defaultToolIdSet.has(tool.id) && matchesActiveModality(tool), - ); - const fallbackTools = - defaultTools.length > 0 ? defaultTools : tools.filter(matchesActiveModality).slice(0, 12); + const matchingTools = tools.filter(matchesActiveModality); + const defaultTools = + activeModality === "all" + ? tools.filter((tool) => defaultToolIdSet.has(tool.id)) + : matchingTools.slice(0, 12); const modalityName = modalityLabels.get(activeModality) ?? "All"; titleNode.textContent = activeModality === "all" ? "Suggested starting points" : `${modalityName} starting points`; - countNode.textContent = `${fallbackTools.length} curated tools`; - resultContainer.innerHTML = fallbackTools.map((tool) => renderCard(tool)).join(""); + countNode.textContent = + activeModality === "all" + ? `${defaultTools.length} curated tools` + : `${defaultTools.length} of ${matchingTools.length} tools`; + resultContainer.innerHTML = defaultTools.map((tool) => renderCard(tool)).join(""); resultContainer.classList.remove("hidden"); hideEmptyState(); setRequestLinks(""); diff --git a/tests/e2e-landing/homepage.spec.ts b/tests/e2e-landing/homepage.spec.ts index 79bb46f5..eedf49e8 100644 --- a/tests/e2e-landing/homepage.spec.ts +++ b/tests/e2e-landing/homepage.spec.ts @@ -80,6 +80,19 @@ test.describe("Landing Homepage", () => { expect(requestHref).toContain("title=Tool+request%3A+convert+figma+file+to+layered+psd"); }); + test("tool command center shows multiple starting points for a selected modality", async ({ + page, + }) => { + await page.getByRole("button", { name: /Video 57/ }).click(); + + const results = page.locator("#tool-command-results"); + await expect(page.getByText("Video starting points")).toBeVisible(); + await expect(page.getByText(/12 of 57 tools/)).toBeVisible(); + await expect(results.getByRole("link", { name: /Convert Video/ })).toBeVisible(); + await expect(results.getByRole("link", { name: /Compress Video/ })).toBeVisible(); + await expect(results.getByRole("link", { name: /Trim Video/ })).toBeVisible(); + }); + test("enterprise section renders eyebrow and feature cards", async ({ page }) => { await expect(page.getByText("Built for enterprise deployment.")).toBeVisible(); await expect(page.getByText("Enterprise-grade security")).toBeVisible();