feat: allow jumping forward and back between completed steps of stepper#1089
Conversation
|
There was a problem hiding this comment.
Pull Request Overview
This PR implements functionality to allow users to navigate between completed steps in a stepper component. The main change introduces a "max reached step" tracking mechanism that enables jumping back to previously completed steps while preventing forward navigation to incomplete steps.
- Adds state tracking for the maximum step reached by the user
- Updates step completion states and navigation controls based on user progress
- Includes example usage updates in the kitchen sink app
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/runtime/src/widgets/Stepper/Stepper.tsx | Implements max reached step tracking, updates step completion logic, and adds disabled state for unreachable steps |
| apps/kitchen-sink/src/ensemble/screens/widgets.yaml | Updates stepper example to show both icon and text in step template |
| {namedData.map((data, index) => ( | ||
| <Step key={index}> | ||
| <StepButton onClick={onChangeCallback(index)}> | ||
| <Step completed={index <= maxReachedStep} key={index}> |
There was a problem hiding this comment.
The completion logic is incorrect. A step should be marked as completed only if it's less than the max reached step, not less than or equal to it. The current step (index === maxReachedStep) should be active but not completed.
| <Step completed={index <= maxReachedStep} key={index}> | |
| <Step completed={index < maxReachedStep} key={index}> |
|
Visit the preview URL for this PR (updated for commit 67da1c2): https://react-kitchen-sink-dev--pr1089-stepper-next-k6n0e050.web.app (expires Thu, 31 Jul 2025 14:36:11 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 6267897ade2ba783b6db70a53a60fc3946d625e9 |
Describe your changes
Closes #1088
Screenshots [Optional]
Screen.Recording.2025-07-24.at.7.23.21.PM2.mov
Issue ticket number and link
Checklist before requesting a review
pnpm changeset add