Skip to content

feat: Implement step persistence in wizard component - #5130

Open
micanipho wants to merge 1 commit into
shesha-io:mainfrom
micanipho:nhlakanipho/feat/wizard-step-persistence
Open

feat: Implement step persistence in wizard component#5130
micanipho wants to merge 1 commit into
shesha-io:mainfrom
micanipho:nhlakanipho/feat/wizard-step-persistence

Conversation

@micanipho

Copy link
Copy Markdown
Collaborator

This pull request adds support for persisting the current step in the wizard component, allowing users to stay on the same step after a page refresh (on a per-browser-tab basis). Step persistence is opt-in via a new persistCurrentStep flag, which is enabled by default for new and existing wizards. The implementation is careful to avoid persisting steps in the form designer and inside modals. The logic for step selection and persistence is refactored into a new utility module for easier testing and code clarity.

Wizard step persistence:

  • Added a new persistCurrentStep boolean property to IWizardComponentProps, with UI support in the settings form and defaulting to true for new and existing wizards. [1] [2] [3] [4]
  • The wizard now persists the current step index to session storage when persistCurrentStep is enabled, restoring it after a page refresh. Persistence is disabled in the designer and in modals to avoid context issues. [1] [2]
  • When the wizard is completed, the persisted step is cleared so a later visit starts fresh.

Step selection logic refactoring:

  • Extracted step index resolution and persistence logic into a new pure utility module stepSelection.ts, including helpers like getDefaultStepIndex, getInitialStepIndex, isValidStepIndex, and shouldPersistStep. [1] [2] [3]
  • Updated wizard navigation to use the new helpers, ensuring consistent and testable step selection and persistence behavior. [1] [2]

Related to issue (#4574)

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fb312212-8b6f-4df4-8d58-8b961df80333

📥 Commits

Reviewing files that changed from the base of the PR and between d13f4de and 8627b8c.

📒 Files selected for processing (5)
  • shesha-reactjs/src/designer-components/wizard/hooks.ts
  • shesha-reactjs/src/designer-components/wizard/index.tsx
  • shesha-reactjs/src/designer-components/wizard/models.ts
  • shesha-reactjs/src/designer-components/wizard/settingsForm.ts
  • shesha-reactjs/src/designer-components/wizard/stepSelection.ts
👮 Files not reviewed due to content moderation or server errors (5)
  • shesha-reactjs/src/designer-components/wizard/hooks.ts
  • shesha-reactjs/src/designer-components/wizard/models.ts
  • shesha-reactjs/src/designer-components/wizard/stepSelection.ts
  • shesha-reactjs/src/designer-components/wizard/index.tsx
  • shesha-reactjs/src/designer-components/wizard/settingsForm.ts

Warning

Walkthrough skipped

File diffs could not be summarized.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@micanipho
micanipho requested a review from James-Baloyi July 2, 2026 12:20
@micanipho micanipho added question Further information is requested and removed question Further information is requested labels Jul 9, 2026
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