From 7eb9f8a9bbb122d7fbb495192a41a5de6a1c9827 Mon Sep 17 00:00:00 2001 From: Nilesh Raj Date: Wed, 21 Oct 2026 01:05:16 +0530 Subject: [PATCH] Fix setup download notices and meteor order --- app/globals.css | 2 +- components/SetupGuidePanel.tsx | 12 +++--- tests/setup-guide-panel.test.tsx | 74 ++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 tests/setup-guide-panel.test.tsx diff --git a/app/globals.css b/app/globals.css index 8be4569..656ca0b 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1651,7 +1651,7 @@ kbd { color: var(--muted); border: 1px solid var(--line); border-radius: var(--r .fey-artifact-title { position: relative; z-index: 1; max-width: 12ch; margin: 0; font-family: var(--font-fraunces), serif; font-size: clamp(17px, 1.45vw, 22px); font-weight: 500; letter-spacing: -.035em; line-height: 1.05; } .fey-artifact-title-access { max-width: none; line-height: 1.3; } .fey-meteor-shower { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; } -.fey-meteor-shower i { position: absolute; width: 52px; height: 2px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fey-red) 80%, transparent) 72%, var(--fey-red)); box-shadow: 0 0 3px color-mix(in srgb, var(--fey-red) 45%, transparent); opacity: 0; animation: fey-meteor 9s linear infinite; animation-delay: calc(var(--card-position, 0) * -1s); } +.fey-meteor-shower i { position: absolute; width: 52px; height: 2px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fey-red) 80%, transparent) 72%, var(--fey-red)); box-shadow: 0 0 3px color-mix(in srgb, var(--fey-red) 45%, transparent); opacity: 0; animation: fey-meteor 9s linear infinite; animation-delay: calc(var(--card-position, 0) * 1s); } .fey-meteor-shower i:nth-child(1) { top: 18%; left: 10%; --meteor-x: 32px; --meteor-angle: 45deg; } .fey-meteor-shower i:nth-child(2) { top: 39%; left: 53%; --meteor-x: 32px; --meteor-angle: 45deg; } .fey-meteor-shower i:nth-child(3) { top: 57%; left: 24%; --meteor-x: 32px; --meteor-angle: 45deg; } diff --git a/components/SetupGuidePanel.tsx b/components/SetupGuidePanel.tsx index de7fcf4..6bad6b7 100644 --- a/components/SetupGuidePanel.tsx +++ b/components/SetupGuidePanel.tsx @@ -41,14 +41,16 @@ export function SetupGuidePanel({ guide }: { )} - {/* If a platform exists but has no commands, and the source was checked, show the reviewed-empty message. */} - {(platform && installCommands.length === 0 && uninstallCommands.length === 0 && sourceChecked) ?

No shell commands are recorded for this OS.

: null} + {/* A download link already gives users an install route, so only show this when none is recorded. */} + {(platform && installCommands.length === 0 && uninstallCommands.length === 0 && sourceChecked && !platform.download_url) + ?

No shell commands are recorded for this OS.

+ : null} {installCommands.length ? - : (platform && !sourceChecked) ?

{platform.download_url - ? "No shell install command is listed. Use the official download." - : "Install instructions have not been reviewed."}

: null} + : (platform && !sourceChecked && !platform.download_url) + ?

Install instructions have not been reviewed.

+ : null} {platform?.download_url ? Official download : null} diff --git a/tests/setup-guide-panel.test.tsx b/tests/setup-guide-panel.test.tsx new file mode 100644 index 0000000..2747075 --- /dev/null +++ b/tests/setup-guide-panel.test.tsx @@ -0,0 +1,74 @@ +import { renderToStaticMarkup } from "react-dom/server"; +import { describe, expect, it } from "vitest"; +import { SetupGuidePanel } from "../components/SetupGuidePanel"; +import type { SetupGuide } from "../lib/types"; + +function renderGuide(guide: SetupGuide) { + return renderToStaticMarkup(); +} + +function getWindowsPanelMarkup(markup: string) { + const panel = markup.match(/
Windows<\/summary>(.*?)<\/details>/); + if (!panel) throw new Error("Windows setup panel was not rendered"); + return panel[1]; +} + +describe("SetupGuidePanel official downloads", () => { + it("does not show a missing-shell-command message when a reviewed official download exists", () => { + const markup = renderGuide({ + source_url: "https://github.com/example/agent", + checked_at: "2026-10-20", + platforms: { + windows: { + support: "supported", + download_url: "https://example.com/agent-installer", + install_commands: [], + uninstall_commands: [], + }, + }, + }); + + const windows = getWindowsPanelMarkup(markup); + + expect(windows).toContain('href="https://example.com/agent-installer"'); + expect(windows).toContain("Official download"); + expect(windows).not.toContain("No shell commands are recorded for this OS."); + expect(windows).not.toContain("No shell install command is listed."); + }); + + it("does not show an install-instructions warning when an unreviewed platform has an official download", () => { + const markup = renderGuide({ + platforms: { + windows: { + support: "unknown", + download_url: "https://example.com/agent-installer", + install_commands: [], + uninstall_commands: [], + }, + }, + }); + + const windows = getWindowsPanelMarkup(markup); + + expect(windows).toContain("Official download"); + expect(windows).not.toContain("Install instructions have not been reviewed."); + expect(windows).not.toContain("No shell install command is listed."); + expect(windows).toContain("Removal instructions have not been reviewed."); + }); + + it("keeps the reviewed-empty message when neither commands nor an official download are recorded", () => { + const markup = renderGuide({ + source_url: "https://github.com/example/agent", + checked_at: "2026-10-20", + platforms: { + windows: { + support: "supported", + install_commands: [], + uninstall_commands: [], + }, + }, + }); + + expect(getWindowsPanelMarkup(markup)).toContain("No shell commands are recorded for this OS."); + }); +});