Skip to content

AnimationProgressControls#4

Open
PavelVanecek wants to merge 3 commits intomainfrom
animations
Open

AnimationProgressControls#4
PavelVanecek wants to merge 3 commits intomainfrom
animations

Conversation

@PavelVanecek
Copy link
Copy Markdown
Contributor

@PavelVanecek PavelVanecek commented Apr 4, 2026

This pull request introduces a new AnimationProgressControls React component for managing and visualizing animation progress in Recharts, and updates the Recharts dependency to the latest version. The most significant changes are grouped below.

New Feature: Animation Progress Controls

  • Added a new AnimationProgressControls component in src/components/AnimationProgressControls.tsx that displays progress sliders for all animations managed by Recharts' AnimationProgressProvider. This component allows users to scrub, rewind, and fast-forward animations individually or collectively, and shows the current status of each animation.
  • Exported the new AnimationProgressControls component from the public API in src/index.ts.

Dependency and Version Updates

  • Updated the recharts dependency from version ^3.8.0 to ^3.9.0 in package.json to ensure compatibility with the new animation controls.
  • Bumped the package version from 0.0.11 to 0.0.12 in package.json to reflect the addition of new features.

Summary by CodeRabbit

Release Notes v0.0.12

  • New Features

    • Introduced AnimationProgressControls component for comprehensive animation management. Provides rewind, interactive scrubbing to adjust animation progress in real-time, fast-forward, and completion controls. Supports managing individual animations separately or viewing aggregated progress across multiple animations simultaneously.
  • Chores

    • Bumped package version to 0.0.12.
    • Updated recharts from ^3.8.0 to ^3.9.0.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

Walkthrough

The PR introduces a new AnimationProgressControls React component for managing animation progress with sliders and control actions. The package version is bumped to 0.0.12, recharts devDependency is updated to ^3.9.0, and the new component is exported via the package's public API.

Changes

Cohort / File(s) Summary
Version and Dependencies
package.json
Version bumped from 0.0.11 to 0.0.12. recharts devDependency updated from ^3.8.0 to ^3.9.0; peerDependency remains ^3.8.0.
New Component
src/components/AnimationProgressControls.tsx
Added AnimationProgressControls component that uses recharts' useAnimationProgress hook to render animation controls. Includes individual sliders per animation, an aggregated slider for multiple animations, rewind/scrub/complete actions, and fallback messaging when animations are unavailable.
Public API Export
src/index.ts
Added re-export of AnimationProgressControls to the package's public API surface.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'AnimationProgressControls' is a component name but lacks context about what was done. It's unclear if this adds, modifies, or removes the component. Use a more descriptive title like 'Add AnimationProgressControls component' or 'Introduce AnimationProgressControls for animation scrubbing' to clarify the action taken.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch animations

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@PavelVanecek PavelVanecek changed the title animations AnimationProgressControls Apr 4, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/components/AnimationProgressControls.tsx (1)

34-36: Add explicit accessible names to icon-only buttons.

title is helpful, but these buttons should also have aria-label for screen-reader clarity.

Suggested fix
-      <button type="button" onClick={onRewind} title="Rewind to start" style={{ fontSize: '0.85em' }}>
+      <button type="button" onClick={onRewind} title="Rewind to start" aria-label="Rewind to start" style={{ fontSize: '0.85em' }}>
         ⏪
       </button>
...
-      <button type="button" onClick={onFastForward} title="Fast-forward to end" style={{ fontSize: '0.85em' }}>
+      <button type="button" onClick={onFastForward} title="Fast-forward to end" aria-label="Fast-forward to end" style={{ fontSize: '0.85em' }}>
         ⏩
       </button>

Also applies to: 48-50

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/AnimationProgressControls.tsx` around lines 34 - 36, The
icon-only control buttons in AnimationProgressControls lack explicit accessible
names; update the button elements (e.g., the one using onRewind and the other
icon-only buttons around lines with onPlay/onFastForward) to include an
aria-label that describes the action (for example aria-label="Rewind to start",
"Play", "Fast forward") in addition to the existing title prop so screen readers
receive a clear, explicit name for each control.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 7: Update the package.json "version" field to a minor bump reflecting new
public functionality: change the current "version": "0.0.12" entry to a minor
release (for example "0.1.0") so it follows semantic versioning for added
features; locate the "version" key in package.json and update its value
accordingly.

In `@src/components/AnimationProgressControls.tsx`:
- Around line 27-33: The component builds inputId by concatenating label (const
inputId = `animation-progress-${label}`) which can produce invalid or non-unique
DOM ids (e.g., "All animations"); in the AnimationProgressControls component
sanitize and normalize the label before composing the id: implement a small
helper (e.g., slugify/sanitizeLabel) that trims whitespace, lowercases, replaces
spaces and non-alphanumeric chars with hyphens (and optionally deduplicates
hyphens), then use that sanitized string when creating inputId and anywhere else
ids are derived so IDs are robust and safe.

---

Nitpick comments:
In `@src/components/AnimationProgressControls.tsx`:
- Around line 34-36: The icon-only control buttons in AnimationProgressControls
lack explicit accessible names; update the button elements (e.g., the one using
onRewind and the other icon-only buttons around lines with onPlay/onFastForward)
to include an aria-label that describes the action (for example
aria-label="Rewind to start", "Play", "Fast forward") in addition to the
existing title prop so screen readers receive a clear, explicit name for each
control.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c97115fc-3de6-4517-8726-507a5530167a

📥 Commits

Reviewing files that changed from the base of the PR and between 2e8d78b and 2d014d3.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • src/components/AnimationProgressControls.tsx
  • src/index.ts

},
"type": "module",
"version": "0.0.11",
"version": "0.0.12",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Use a minor version bump for this feature release.

Line 7 bumps 0.0.110.0.12, but this PR adds new public functionality. This should be a minor bump (for example 0.1.0) rather than patch.

As per coding guidelines, "Update the version number in package.json according to semantic versioning (patch, minor, major)".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 7, Update the package.json "version" field to a minor
bump reflecting new public functionality: change the current "version": "0.0.12"
entry to a minor release (for example "0.1.0") so it follows semantic versioning
for added features; locate the "version" key in package.json and update its
value accordingly.

Comment on lines +27 to +33
const inputId = `animation-progress-${label}`;
return (
<div style={{ display: 'flex', alignItems: 'center', gap: 8, flexWrap: 'wrap' }}>
<span style={{ minWidth: 80, fontSize: '0.85em', opacity: 0.8 }}>{statusLabels[status]}</span>
<label htmlFor={inputId} style={{ minWidth: 160, fontSize: '0.85em' }}>
{label}
</label>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Avoid deriving DOM id directly from labels.

Line 27 uses label to build the input id, and Line 136 passes "All animations". This can generate non-robust ids. Prefer sanitizing the label before composing the id.

Suggested fix
-  const inputId = `animation-progress-${label}`;
+  const safeLabel = label.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-_:.]/g, '');
+  const inputId = `animation-progress-${safeLabel}`;

Also applies to: 136-137

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/AnimationProgressControls.tsx` around lines 27 - 33, The
component builds inputId by concatenating label (const inputId =
`animation-progress-${label}`) which can produce invalid or non-unique DOM ids
(e.g., "All animations"); in the AnimationProgressControls component sanitize
and normalize the label before composing the id: implement a small helper (e.g.,
slugify/sanitizeLabel) that trims whitespace, lowercases, replaces spaces and
non-alphanumeric chars with hyphens (and optionally deduplicates hyphens), then
use that sanitized string when creating inputId and anywhere else ids are
derived so IDs are robust and safe.

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