From 3d377ea1f9b6f4b9dfc6688735e56c7d042c7f49 Mon Sep 17 00:00:00 2001 From: Dotta Date: Thu, 11 Jun 2026 06:12:37 +0000 Subject: [PATCH] Fix Skills Store rollout polish Co-Authored-By: Paperclip --- ui/src/pages/CompanySkills.tsx | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/ui/src/pages/CompanySkills.tsx b/ui/src/pages/CompanySkills.tsx index 1c6f6b1fdcd..1fb8cba530d 100644 --- a/ui/src/pages/CompanySkills.tsx +++ b/ui/src/pages/CompanySkills.tsx @@ -1235,12 +1235,14 @@ function NewSkillWizard({ }) { const [step, setStep] = useState(0); const [draft, setDraft] = useState(initialDraft); + const [slugDirty, setSlugDirty] = useState(initialDraft.slug.trim().length > 0); const categoryDraft = draft.categories.join(", "); const steps = ["Basics", "Design", "Content", "Review"]; useEffect(() => { setStep(0); setDraft(initialDraft); + setSlugDirty(initialDraft.slug.trim().length > 0); }, [initialDraft]); function patchDraft(patch: Partial) { @@ -1300,7 +1302,7 @@ function NewSkillWizard({ const nextName = event.target.value; patchDraft({ name: nextName, - slug: draft.slug ? draft.slug : normalizeSkillDraftSlug(nextName), + slug: slugDirty ? draft.slug : normalizeSkillDraftSlug(nextName), markdown: draft.markdown === defaultSkillMarkdown(draft.name, draft.tagline) ? defaultSkillMarkdown(nextName, draft.tagline) : draft.markdown, @@ -1311,7 +1313,11 @@ function NewSkillWizard({ /> patchDraft({ slug: normalizeSkillDraftSlug(event.target.value) })} + onChange={(event) => { + const nextSlug = normalizeSkillDraftSlug(event.target.value); + setSlugDirty(nextSlug.length > 0); + patchDraft({ slug: nextSlug }); + }} placeholder="skill-shortname" className="h-9 font-mono" /> @@ -2642,6 +2648,9 @@ function SkillDetailPage({ const currentPin = shortRef(skill.sourceRef); const latestPin = shortRef(updateStatus?.latestRef); const selectedVersion = versions.find((version) => version.id === currentVersionSelection(skill)) ?? null; + const subtitleText = skill.tagline || skill.description + ? cardDescriptionText(skill.tagline ?? skill.description) + : source.label; function renderFilesBody() { return ( @@ -2941,7 +2950,7 @@ function SkillDetailPage({

{detail.name}

- {detail.tagline ?? detail.description ?? source.label} + {subtitleText}

@@ -4102,9 +4111,15 @@ export function CompanySkills() { const targetSet = new Set(nextAgentIds); const current = (activeDetail.usedByAgents ?? []).map((entry) => entry.id); const currentSet = new Set(current); + const currentVersionByAgent = new Map( + (activeDetail.usedByAgents ?? []).map((entry) => [entry.id, entry.versionId ?? null]), + ); const toAdd = nextAgentIds.filter((id) => !currentSet.has(id)); const toRemove = current.filter((id) => !targetSet.has(id)); - const affected = new Set([...toAdd, ...toRemove]); + const toUpdateVersion = nextAgentIds.filter((id) => + currentSet.has(id) && (currentVersionByAgent.get(id) ?? null) !== versionId, + ); + const affected = new Set([...toAdd, ...toRemove, ...toUpdateVersion]); if (affected.size === 0) { setAttachPopoverOpen(false); return;