mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
fix: hide empty description and fix broken skill link for skills.sh results
- Hide "暂无描述" text when skill has no description (skills.sh API doesn't return descriptions), show empty spacer instead - Change skills.sh result link from guessed subdirectory path to repo root URL, since skillId doesn't reflect the actual nested path
This commit is contained in:
@@ -2738,8 +2738,8 @@ impl SkillService {
|
||||
repo_branch: "main".to_string(),
|
||||
installs: s.installs,
|
||||
readme_url: Some(format!(
|
||||
"https://github.com/{}/{}/tree/main/{}",
|
||||
owner, repo, s.skill_id
|
||||
"https://github.com/{}/{}",
|
||||
owner, repo
|
||||
)),
|
||||
})
|
||||
})
|
||||
|
||||
@@ -108,11 +108,15 @@ export function SkillCard({
|
||||
)}
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent className="flex-1 pt-0">
|
||||
<p className="text-sm text-muted-foreground/90 line-clamp-4 leading-relaxed">
|
||||
{skill.description || t("skills.noDescription")}
|
||||
</p>
|
||||
</CardContent>
|
||||
{skill.description ? (
|
||||
<CardContent className="flex-1 pt-0">
|
||||
<p className="text-sm text-muted-foreground/90 line-clamp-4 leading-relaxed">
|
||||
{skill.description}
|
||||
</p>
|
||||
</CardContent>
|
||||
) : (
|
||||
<div className="flex-1" />
|
||||
)}
|
||||
<CardFooter className="flex gap-2 pt-3 border-t border-border/50 relative z-10">
|
||||
{skill.readmeUrl && (
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user