‹ 首页

ss-feedback

@bitjaru · 收录于 1 周前 · 上游提交 今天

Add appropriate user feedback states (loading, success, error, empty) to a component or page

适合你,如果你在构建前端组件时需要统一管理用户反馈状态

/ 下载安装
ss-feedback.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add bitjaru/styleseed/ss-feedback
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- bitjaru/styleseed/ss-feedback
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify bitjaru/styleseed/ss-feedback
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
GitHub stars
~680上下文体积 · 单文件
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · 3c5e387

UX Feedback States Generator

When NOT to use
  • For only the words inside a state → use /ss-copy
  • For accessibility issues in existing states → use /ss-a11y
  • For brand-new component creation → use /ss-component
  • For analytics or error-logging plumbing — UI presentation only

Target: $ARGUMENTS

Instructions
  1. Read the target file and identify all data-dependent areas.
  1. Read the design language reference:
  2. DESIGN-LANGUAGE.md sections on Loading States (Skeleton), Empty States, Error States
  1. For each data-dependent area, implement ALL 4 states:
State 1: Loading (Skeleton)
// Skeleton must match the final layout shape
<div className="bg-card rounded-2xl p-6 shadow-[var(--shadow-card)]">
  <div className="flex items-center gap-2 mb-3">
    <div className="size-7 bg-surface-muted rounded-lg animate-pulse" />
    <div className="h-3 w-16 bg-surface-muted rounded animate-pulse" />
  </div>
  <div className="h-9 w-24 bg-surface-muted rounded-lg animate-pulse mb-3" />
  <div className="h-3 w-12 bg-surface-muted rounded animate-pulse" />
</div>

Rules:

  • Show skeleton for 300ms minimum (prevent flash)
  • Delay skeleton display by 300ms (fast loads skip skeleton entirely)
  • Use animate-pulse (1.5s cycle)
  • Match skeleton shapes to real content dimensions
  • Never use spinners inside cards
State 2: Empty (Zero Data)
<EmptyState
  icon={PackageIcon}
  title="No activity yet"
  description="Create your first project to get started."
  action={<Button>Create Project</Button>}
/>

Rules:

  • Center-aligned in the card
  • Icon: 32px, text-text-tertiary
  • Title: 14px, text-text-secondary
  • Always suggest a next action
  • Zero values show as "0" (don't hide or dash)
State 3: Error (Load Failed)
<div className="flex flex-col items-center justify-center py-8 text-center">
  <AlertCircle className="size-8 text-destructive mb-3" />
  <p className="text-[14px] text-text-secondary mb-4">Couldn't load the data</p>
  <Button variant="brandGhost" size="sm" onClick={retry}>Try again</Button>
</div>

Rules:

  • Partial failure: only affected card shows error, rest loads normally
  • Full page failure: full-screen EmptyState with retry
  • Error message: plain language, blame the system
  • Always provide retry button
State 4: Success (Action Feedback)
// Toast notification for action confirmations
toast("Changes saved")

// With undo for destructive actions
toast("Item deleted", { action: { label: "Undo", onClick: handleUndo } })

Rules:

  • Info toast: 3s display
  • Action toast (with undo): 5s display
  • Toast position: above BottomNav
  • One toast at a time (new replaces old)
  1. Implementation pattern:
function DataCard({ data, isLoading, error }) {
  if (isLoading) return <DataCardSkeleton />
  if (error) return <DataCardError onRetry={refetch} />
  if (!data || data.length === 0) return <DataCardEmpty />
  return <DataCardContent data={data} />
}
  1. Check prefers-reduced-motion — disable animate-pulse when reduced motion is preferred.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。