-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(components): Add StepConnector component #15003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…able steps\n\n- New StepConnector/StepComponent to visually connect headings\n- Props: startAt, selector, showNumbers, checkable, persistence, showReset\n- Session-only persistence using sessionStorage when enabled\n- Registered in MDX components map
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Add empty cleanup function for consistent return in useEffect - Add comments to empty catch blocks to clarify intentional error suppression - Fix ESLint errors: consistent-return and no-empty
Bundle ReportChanges will increase total bundle size by 10.15kB (0.04%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-client-array-pushAssets Changed:
Files in
view changes for bundle: sentry-docs-server-cjsAssets Changed:
Files in
App Routes Affected:
|
return next; | ||
}); | ||
}); | ||
h.insertBefore(btn, h.firstChild); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Step Tracking Fails on Headings Without Unique IDs
The StepComponent
uses h.id
to track completion state, but headings may not have unique id
attributes. When an id
is missing, h.id
is an empty string, causing multiple ID-less headings to share the same key. This leads to toggling completion on one such step incorrectly affecting all other ID-less steps, breaking individual tracking and aria-pressed
states.
Summary
This PR introduces the StepConnector component - a visual component that connects sequential headings with a vertical rail and numbered circles, perfect for step-by-step guides and tutorials.
Features
Usage
Props
startAt
: Starting number for steps (default: 1)selector
: CSS selector for headings to connect (default: 'h2')showNumbers
: Show numbers inside circles (default: true)checkable
: Allow users to mark steps complete (default: false)persistence
: 'session' | 'none' for completion state storage (default: 'session')showReset
: Show reset button when checkable (default: true)Files Added
src/components/stepConnector/index.tsx
- Component implementationsrc/components/stepConnector/style.module.scss
- Stylessrc/mdxComponents.ts
to register component for MDX usageStatus