feat: refine skill detail author badge and landing publish CTA (#95)

* Replace skill author monogram with icon

* Update landing publish CTA copy
This commit is contained in:
Xudong Sun 2026-03-19 10:49:54 +08:00 • committed by GitHub
parent 2daddab217
commit c90199183a
2 changed files with 3 additions and 16 deletions

View file

@ -16,7 +16,7 @@
"subtitle": "使用社区驱动的技能构建强大的 AI 代理",
"searchPlaceholder": "搜索技能...",
"exploreSkills": "探索技能",
"publishSkill": "开始构建"
"publishSkill": "发布技能"
},
"features": {
"secure": {

View file

@ -2,7 +2,7 @@ import { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useParams, useNavigate, useRouterState, useSearch } from '@tanstack/react-router'
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { ArrowLeft, ChevronDown, ChevronUp } from 'lucide-react'
import { ArrowLeft, ChevronDown, ChevronUp, User } from 'lucide-react'
import { MarkdownRenderer } from '@/features/skill/markdown-renderer'
import { FileTree } from '@/features/skill/file-tree'
import { InstallCommand } from '@/features/skill/install-command'
@ -68,19 +68,6 @@ function parseMetadataJson(parsed?: string) {
}
}
function getAuthorMonogram(name?: string) {
if (!name) {
return '?'
}
const trimmed = name.trim()
if (!trimmed) {
return '?'
}
return trimmed[0]!.toUpperCase()
}
function getPromotionConflictKey(error: ApiError): 'promotion.duplicate_pending' | 'promotion.already_promoted' | null {
if (error.serverMessageKey === 'promotion.duplicate_pending') {
return 'promotion.duplicate_pending'
@ -565,7 +552,7 @@ export function SkillDetailPage() {
<div className="flex min-w-0">
<div className="inline-flex max-w-full items-center gap-2 rounded-full border border-border/60 bg-background/85 px-3 py-1.5 text-sm text-muted-foreground shadow-sm backdrop-blur-sm">
<span className="inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-primary/10 text-[11px] font-semibold uppercase tracking-[0.08em] text-primary">
{getAuthorMonogram(skill.ownerDisplayName)}
<User className="h-3.5 w-3.5" aria-hidden="true" />
</span>
<span className="min-w-0 truncate">{t('skillDetail.authorLabel', { name: skill.ownerDisplayName })}</span>
</div>