From a33e533dc43f34c968dbb32bd80b3d354c1284a4 Mon Sep 17 00:00:00 2001 From: Dotta Date: Thu, 11 Jun 2026 16:03:53 +0000 Subject: [PATCH] Richer source attribution + catalog page polish (PAP-10907) - Sidebar Source now surfaces the upstream catalog provenance: for catalog- installed skills, match the company skill to its catalog entry by key and show the GitHub owner/repo/path with a real link + ref/short-commit, instead of a long local staging path. - Middle-truncate the non-catalog source locator so long file paths stay readable in the narrow sidebar. - Catalog install CTA now reads "Install skill in this organization". - "Back to store" preserves the tab/category/source filters the user arrived with instead of dropping to the bare /skills root. - Settings button in the sidebar loses its outline. Co-Authored-By: Claude Opus 4.8 --- ui/src/pages/CompanySkills.tsx | 164 +++++++++++++----- .../stories/skills-store-detail.stories.tsx | 10 ++ 2 files changed, 130 insertions(+), 44 deletions(-) diff --git a/ui/src/pages/CompanySkills.tsx b/ui/src/pages/CompanySkills.tsx index ca426134977..95e6e76cd9c 100644 --- a/ui/src/pages/CompanySkills.tsx +++ b/ui/src/pages/CompanySkills.tsx @@ -6,6 +6,7 @@ import type { Agent, CatalogSkill, CatalogSkillFileDetail, + CatalogSkillSource, CompanySkillCompatibility, CompanySkillCreateRequest, CompanySkillDetail, @@ -1708,7 +1709,7 @@ function CatalogDetailPane({ cta = ( ); } else if (hashOutOfSync) { @@ -2388,6 +2389,20 @@ function versionLabel(version: CompanySkillVersion | null | undefined) { return `v${version.revisionNumber}${version.label ? ` · ${version.label}` : ""}`; } +export function getSkillVersionDiffSelection(versions: CompanySkillVersion[], targetVersionId?: string | null) { + const sorted = [...versions].sort((a, b) => b.revisionNumber - a.revisionNumber); + const right = targetVersionId + ? sorted.find((version) => version.id === targetVersionId) ?? null + : sorted[0] ?? null; + if (!right) return { leftVersionId: null, rightVersionId: null }; + + const left = sorted.find((version) => version.revisionNumber < right.revisionNumber) ?? null; + return { + leftVersionId: left?.id ?? null, + rightVersionId: right.id, + }; +} + function SkillVersionDiffDialog({ open, onOpenChange, @@ -2406,8 +2421,8 @@ function SkillVersionDiffDialog({ onRightVersionChange: (id: string | null) => void; }) { const sorted = [...versions].sort((a, b) => b.revisionNumber - a.revisionNumber); - const left = sorted.find((version) => version.id === leftVersionId) ?? sorted[1] ?? null; - const right = sorted.find((version) => version.id === rightVersionId) ?? sorted[0] ?? null; + const left = sorted.find((version) => version.id === leftVersionId) ?? null; + const right = sorted.find((version) => version.id === rightVersionId) ?? null; const allPaths = useMemo(() => { const paths = new Set(); for (const file of left?.fileInventory ?? []) paths.add(file.path); @@ -2454,10 +2469,11 @@ function SkillVersionDiffDialog({