Skip to content

fix: marker, hr and img streaming animation#540

Open
shadcn wants to merge 1 commit into
mainfrom
shadcn/fix-void-el-animation
Open

fix: marker, hr and img streaming animation#540
shadcn wants to merge 1 commit into
mainfrom
shadcn/fix-void-el-animation

Conversation

@shadcn

@shadcn shadcn commented Jun 22, 2026

Copy link
Copy Markdown

Description

fix issue with list markers, task-list checkboxes, images, and hr animations

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Changes Made

  • Fade list markers in via ::marker color, synced to the item's first word.
  • Animate task-list checkboxes and <img>/<hr> via the standard data-sd-animate rule.

Testing

  • All existing tests pass
  • Added new tests for the changes
  • Manually tested the changes

Checklist

  • My code follows the project's code style
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have created a changeset (pnpm changeset)

Changeset

  • I have created a changeset for these changes

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
streamdown Ready Ready Preview, Comment, Open in v0 Jun 22, 2026 4:11pm

charCounter: { count: number; newIndex: number }
): void => {
if (hasSkipAncestor(ancestors)) {
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing void elements (img/hr) re-animate one extra time during streaming because they never advance charCounter.count, causing a boundary collision at count === prevContentLength.

Fix on Vercel

yudaprama added a commit to yudaprama/streamdown that referenced this pull request Jul 5, 2026
… and vercel#540

PR vercel#536 and vercel#540 conflicted with the animate module refactor in PR vercel#531.
This port applies their changes onto the new multi-file architecture:

- Add `hr` to atomic tags for void-element animation
- Stamp marker CSS custom properties on `<li>` containers
- Animate task-list checkboxes via `<input>` data-sd-animate
- Merge whitespace into preceding word spans inside `<a>` links
- Add marker animation keyframes to styles.css
- Add unit tests for marker, checkbox, hr, and link whitespace

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4-flash
yudaprama added a commit to yudaprama/streamdown that referenced this pull request Jul 5, 2026
…tecture

Port link whitespace merging and void-element animation from the old
animate.ts into the new animate/ modules. Old files removed.

Changes:
- Whitespace inside <a> tags merges into preceding word span (word mode)
- List markers get CSS custom property timing via applyContainerCascade
- Task-list checkboxes stamped with data-sd-animate and animation style
- hr added to ATOMIC_TAGS for void-element animation
- Add marker keyframe animation to styles.css

💘 Generated with Crush

Assisted-by: Crush:deepseek-v4-flash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant