fix: simplify skills.sh catalog presentation (#3371)

This commit is contained in:
Patrick Erichsen
2026-08-01 17:40:19 -07:00
committed by GitHub
parent 50c4ffc1a0
commit ec8a9ec508
5 changed files with 19 additions and 18 deletions
@@ -155,7 +155,7 @@ describe("HomeListingSection", () => {
render(<HomeListingSection initialListing={initialTrending([external])} />);
expect(screen.getByText("@doany-skills")).toBeTruthy();
expect(screen.getByText("skills.sh")).toBeTruthy();
expect(screen.queryByText("skills.sh")).toBeNull();
expect(screen.getByLabelText("Downloads").textContent).toContain("12.3k");
});
-1
View File
@@ -136,7 +136,6 @@ function HomeListingSkillRow({ entry }: { entry: SkillPageEntry }) {
<span className="home-v2-listing-row-name" title={item.displayName}>
{truncateText(item.displayName, PUBLIC_CATALOG_NAME_PREVIEW_LENGTH)}
</span>
{isSkillsSh ? <span className="home-v2-listing-source-badge">skills.sh</span> : null}
{owner ? <span className="home-v2-listing-row-by">@{owner}</span> : null}
</div>
<p className="home-v2-listing-row-summary">
+14 -1
View File
@@ -95,7 +95,18 @@ describe("SkillsShCatalogDetailPage", () => {
});
it("renders only stored bounded content and no file explorer", () => {
render(<SkillsShCatalogDetailPage entry={makeEntry()} />);
const entry = makeEntry();
entry.content = {
...entry.content!,
markdown: `---
name: html
description: Build useful HTML artifacts.
---
# Use this skill
Build a useful artifact.`,
};
render(<SkillsShCatalogDetailPage entry={entry} />);
const detailTabs = screen.getByRole("tablist", { name: "Skill detail tabs" });
expect(detailTabs).toBeTruthy();
@@ -106,6 +117,8 @@ describe("SkillsShCatalogDetailPage", () => {
expect(screen.queryByText("Files")).toBeNull();
expect(screen.queryByText("File explorer")).toBeNull();
expect(screen.queryByText("skills/html/SKILL.md")).toBeNull();
expect(screen.queryByText("name: html")).toBeNull();
expect(screen.queryByText("description: Build useful HTML artifacts.")).toBeNull();
expect(screen.getByText("Content is truncated to the stored 64 KiB snapshot.")).toBeTruthy();
});
+4 -1
View File
@@ -11,6 +11,7 @@ import { truncateText } from "../lib/truncateText";
import { MarkdownPreview } from "./MarkdownPreview";
import { SidebarMetadata } from "./SidebarMetadata";
import { SkillDetailPageView, type SkillDetailViewSkill } from "./SkillDetailPageView";
import { stripFrontmatter } from "./skillDetailUtils";
import { SkillCommandLineCard } from "./SkillInstallSurface";
import { Alert, AlertDescription } from "./ui/alert";
import { Badge } from "./ui/badge";
@@ -275,7 +276,9 @@ function SkillsShContentTabs({ entry }: { entry: SkillsShCatalogDetail }) {
</p>
) : null}
<div className="skill-readme-preview">
<MarkdownPreview highlight={false}>{entry.content.markdown}</MarkdownPreview>
<MarkdownPreview highlight={false}>
{stripFrontmatter(entry.content.markdown)}
</MarkdownPreview>
</div>
</>
) : (
-14
View File
@@ -23290,20 +23290,6 @@ a.search-empty-action {
white-space: nowrap;
}
.home-v2-listing-source-badge {
flex: 0 0 auto;
padding: 2px 6px;
border: 1px solid color-mix(in srgb, var(--hv2-text-tertiary) 42%, transparent);
border-radius: var(--r-pill);
color: var(--hv2-text-tertiary);
font-family: var(--font-mono), ui-monospace, monospace;
font-size: 9px;
font-weight: 650;
line-height: 1.2;
letter-spacing: 0.02em;
white-space: nowrap;
}
.home-v2-listing-row-summary {
margin: 0;
font-size: 13px;