Skip to content

"Add site" Stepper: Introduce click handler to allow clicks on the previous step that is already complete - #1891

Merged
ivan-ottinger merged 6 commits into
trunkfrom
add/click-handler-to-complete-steps
Oct 16, 2025
Merged

"Add site" Stepper: Introduce click handler to allow clicks on the previous step that is already complete#1891
ivan-ottinger merged 6 commits into
trunkfrom
add/click-handler-to-complete-steps

Conversation

@ivan-ottinger

@ivan-ottinger ivan-ottinger commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

  • introduce handleStepClick to handle clicks on the previous step that is already complete
  • ensure the selected import file is remembered when navigating between steps
  • adjust styling of the previous step label
Screen.Capture.on.2025-10-15.at.17-24-50.mp4

Testing Instructions

  1. Check out the PR branch and build the app with npm install && npm start.
  2. Click the Add site button in the app sidebar and try to navigate through the steps of Start from Blueprint and Import from backup flows.
  3. When you complete the first step and get to the second one by clicking the Continue button, it should be possible to get back to the first step by clicking the step label (not just the Back button).
  4. When you are in the Import from backup flow and navigating back to the step where the import file is selected, it should be remembered.
  5. When you review how the step labels are animated during transition between steps, there should be no odd movement / shift in those labels.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@ivan-ottinger ivan-ottinger self-assigned this Oct 15, 2025
className={ cx(
`text-sm`,
isCurrent ? 'text-gray-900 font-medium' : 'text-gray-500'
`text-sm font-medium`,

@ivan-ottinger ivan-ottinger Oct 15, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am curios to hear what you think about this change.

Before (you can see slight shift / movement in labels):

Screen.Capture.on.2025-10-15.at.17-17-26.mov

After (there's no shift in the labels; instead the unselected label has thinner font size):

Screen.Capture.on.2025-10-15.at.17-16-26.mp4

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.

Nice catch!

@ivan-ottinger
ivan-ottinger marked this pull request as ready for review October 15, 2025 15:26
@ivan-ottinger
ivan-ottinger requested a review from a team October 15, 2025 15:26
@github-actions

github-actions Bot commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

📊 Performance Test Results

Comparing a4bb4c0 vs trunk

site-editor

Metric trunk a4bb4c0 Diff Change
load 16639.00 ms 14375.00 ms -2264.00 ms 🟢 -13.6%

site-startup

Metric trunk a4bb4c0 Diff Change
siteCreation 23444.00 ms 23218.00 ms -226.00 ms 🟢 -1.0%
siteStartup 9051.00 ms 8104.00 ms -947.00 ms 🟢 -10.5%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

@bcotrim bcotrim left a comment

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.

LGTM 👍
Added some suggestions, but feel free to merge as is.

Comment thread src/modules/add-site/components/stepper.tsx Outdated
{ steps.map( ( step, index ) => {
const isCurrent = step.status === 'current';
const isCompleted = step.status === 'completed';
const isClickable = isCompleted && step.path;

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.

I would also move this logic to the useStepper hook.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestions, Bernardo. I agree, it make sense to move these. I have moved the click handler as well: ad724a7.

@gcsecsey gcsecsey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes LGTM and work well. I can navigate back using the labels, and the file selection in earlier step is also preserved. 👍

@ivan-ottinger

Copy link
Copy Markdown
Contributor Author

Thank you for your reviews, Bernardo and Gergely!

@ivan-ottinger
ivan-ottinger merged commit 1c1e091 into trunk Oct 16, 2025
12 checks passed
@ivan-ottinger
ivan-ottinger deleted the add/click-handler-to-complete-steps branch October 16, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants