From 8f7c1c50b7c0cbd2ebc95c3b3fb8f72a6c01df20 Mon Sep 17 00:00:00 2001 From: "Vyctor H. Brzezowski" Date: Wed, 5 Aug 2026 20:51:36 -0300 Subject: [PATCH] fix(web): simplify official publisher activity (#3426) --- src/__tests__/official-route.test.tsx | 2 ++ src/components/PublisherListItem.test.tsx | 20 ++++++++++++++++++++ src/components/PublisherListItem.tsx | 11 +++++++++-- src/routes/official/index.tsx | 1 + src/styles.css | 21 +++++++++++++++++++++ 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/src/__tests__/official-route.test.tsx b/src/__tests__/official-route.test.tsx index 24edd749..2c3926fb 100644 --- a/src/__tests__/official-route.test.tsx +++ b/src/__tests__/official-route.test.tsx @@ -39,6 +39,7 @@ vi.mock("../components/PublisherListItem", () => ({ PublisherListItem: (props: { publisher: { _id: string }; showOfficialBadge?: boolean; + showPublishedRail?: boolean; variant?: string; }) => { publisherListItemMock(props); @@ -152,6 +153,7 @@ describe("official route", () => { expect(publisherListItemMock).toHaveBeenCalledWith( expect.objectContaining({ showOfficialBadge: false, + showPublishedRail: false, variant: "list", }), ); diff --git a/src/components/PublisherListItem.test.tsx b/src/components/PublisherListItem.test.tsx index 9b7247d0..b7e27560 100644 --- a/src/components/PublisherListItem.test.tsx +++ b/src/components/PublisherListItem.test.tsx @@ -39,6 +39,26 @@ describe("PublisherListItem", () => { expect(screen.queryByText("34")).toBeNull(); }); + it("renders plain activity without grouped item icons", () => { + const publisher = makePublisher(); + publisher.publishedItems = [ + { kind: "skill", displayName: "Example Skill", slug: "example-skill" } as never, + ]; + + const { container } = render( + , + ); + + expect(container.querySelector(".publisher-published-rail")).toBeNull(); + expect(container.querySelector(".publisher-card-main > .marketplace-icon")).toBeTruthy(); + expect(container.querySelector(".publisher-card-stat.is-primary svg")).toBeTruthy(); + expect(screen.getByText("2")).toBeTruthy(); + expect(screen.getByText("published")).toBeTruthy(); + expect(screen.getByText("12")).toBeTruthy(); + expect(screen.getByText("downloads")).toBeTruthy(); + expect(container.querySelector(".publisher-card-stat-separator")?.textContent).toBe("·"); + }); + it("renders legacy preview metrics as downloads", () => { const publisher = makePublisher(); publisher.publishedItems = [ diff --git a/src/components/PublisherListItem.tsx b/src/components/PublisherListItem.tsx index a85f4d03..9d79b68f 100644 --- a/src/components/PublisherListItem.tsx +++ b/src/components/PublisherListItem.tsx @@ -15,6 +15,7 @@ import { OfficialBadge } from "./OfficialBadge"; type PublisherListItemProps = { publisher: PublicPublisherListItem; showOfficialBadge?: boolean; + showPublishedRail?: boolean; variant?: "list" | "grid" | "highlight"; }; @@ -38,6 +39,7 @@ function PublishedRail({ items }: { items: PublicPublisherPublishedItem[] }) { export function PublisherListItem({ publisher, showOfficialBadge = true, + showPublishedRail = true, variant = "list", }: PublisherListItemProps) { const handle = publisher.handle.trim(); @@ -98,12 +100,17 @@ export function PublisherListItem({ {summaryInMain ? null :

{truncateText(summary, 80)}

} -
+
- + {showPublishedRail ? : null} {formatCompactStat(publishedCount)} published + {showPublishedRail ? null : ( + + )}
diff --git a/src/styles.css b/src/styles.css index bf83b0f2..53c36833 100644 --- a/src/styles.css +++ b/src/styles.css @@ -18031,6 +18031,19 @@ a.agentic-risk-finding-title:focus-visible { color: var(--oc-text-muted); } +.publisher-card-list .publisher-card-stats.is-plain { + display: flex; + gap: var(--oc-space-2); +} + +.publisher-card-list .publisher-card-stats.is-plain .publisher-card-stat.is-primary::before { + content: none; +} + +.publisher-card-stat-separator { + color: var(--oc-text-muted); +} + .publisher-card-stat svg { color: color-mix(in srgb, var(--ink-soft) 76%, var(--bg)); } @@ -18240,10 +18253,18 @@ a.agentic-risk-finding-title:focus-visible { text-align: right; } + .publisher-card-stats.is-plain { + display: grid; + } + .publisher-card-list .publisher-card-stat.is-primary::before { content: none; } + .publisher-card-stat-separator { + display: none; + } + .publisher-published-rail { padding-left: 7px; }