Skip to content

test: Separator export from index.ts, SkeletonCard key stability, Skeleton shimmer variant animation class #208

Description

@k-deejah

Problem

Three issues in the Separator and Skeleton primitive components affect composability and correctness.

1. Separator from src/components/ui/Separator.tsx is not exported from index.ts

Separator is a primitive component that exists in the ui/ folder but is not included in src/components/index.ts. Consumers who want to use it for dividing panel sections must import from an internal path.

2. SkeletonCard rows prop creates a key warning when rows changes

SkeletonCard uses Array.from({ length: rows }).map((_, i) => <Skeleton key={i} />). Using key={i} means changing rows does not trigger remounting but index-reassignment — which can cause incorrect animation states when the row count decreases. Keys should be stable when rows doesn't change and trigger remount when it does.

3. Skeleton has no shimmer animation variant — only animate-pulse

animate-pulse (opacity pulsing) is the only animation. A shimmer effect (a light sweep across the skeleton) is more widely used and less distracting for frequent content refreshes. An optional variant="shimmer" prop would give consumers a choice.

Solution

  1. Add export { Separator } from "./ui/Separator" to src/components/index.ts.
  2. Use a stable key derived from position: key={\skeleton-row-${rows}-${i}`}to force remount whenrows` changes.
  3. Add variant?: "pulse" | "shimmer" prop to Skeleton; implement shimmer via @keyframes CSS animation.

Acceptance Criteria

  • Separator is importable from "sorokit-ui"
  • Changing rows in SkeletonCard remounts rows correctly without key warnings
  • Skeleton variant="shimmer" renders a sweep animation
  • npm run build passes

Note for Contributors: Write a clear PR description. Include a screen recording of the shimmer animation and confirm no React key warnings when changing rows.

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programhelp wantedExtra attention is needed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions