toggle done and back buttons#3825
Conversation
|
Warning Rate limit exceeded@James-Baloyi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 0 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughAdds two optional boolean flags (showBackButton, showDoneButton) to the wizard component model, initializes them with default true, exposes toggles in settings, and conditionally renders Back/Done buttons in the Tabs wizard based on these flags and step position. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant WizardTabs as Wizard Tabs
participant Settings as Settings Form
rect rgba(230,245,255,0.6)
note over WizardTabs: Initialization
WizardTabs->>WizardTabs: initModel(model)
WizardTabs-->>WizardTabs: showBackButton = model?.showBackButton ?? true
WizardTabs-->>WizardTabs: showDoneButton = model?.showDoneButton ?? true
end
rect rgba(240,255,240,0.6)
note over Settings: Configuration
User->>Settings: Toggle Back/Done switches
Settings-->>WizardTabs: Props: showBackButton, showDoneButton
end
rect rgba(255,250,230,0.6)
note over WizardTabs: Render
WizardTabs->>WizardTabs: If current > 0 && showBackButton → Render Back
WizardTabs->>WizardTabs: If current == last && showDoneButton → Render Done
end
User->>WizardTabs: Navigate steps
WizardTabs-->>User: Buttons appear/disappear per flags and step
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks (3 passed)✅ Passed checks (3 passed)
Poem
✨ Finishing Touches
🧪 Generate 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
shesha-reactjs/src/designer-components/wizard/models.ts (1)
83-84: Consider brief JSDoc on new propsAdd short comments clarifying behavior:
- Back is hidden on first step regardless.
- Done only applies on the last step.
shesha-reactjs/src/designer-components/wizard/settingsForm.ts (1)
159-183: Add tooltips and caution to prevent dead-end wizardsHelpful UX hints and a warning reduce misconfiguration risk when hiding navigation.
Suggested tweaks:
.addSettingsInputRow( { id: nanoid(), inputs: [ { id: nanoid(), propertyName: 'showBackButton', label: 'Show Back Button', parentId: 'root', type: 'switch', jsSetting: false, defaultValue: true, + tooltip: 'Toggle visibility of the Back button across all steps (it is always hidden on the first step).' }, { id: nanoid(), propertyName: 'showDoneButton', label: 'Show Done Button', parentId: 'root', type: 'switch', jsSetting: false, defaultValue: true, + tooltip: 'Toggle visibility of the Done button on the last step. If turned off, ensure an alternative way to finish (custom action or API).' } ] } )Verification ask: Please confirm that flows which hide Done on the last step still provide a finish mechanism (e.g., custom action calling wizardApi.done or Cancel allowed). I can add a lightweight settings validator to flag configurations where Done is hidden and no alternative exists.
shesha-reactjs/src/designer-components/wizard/tabs.tsx (1)
126-169: Button gating works; verify no “last-step trap” when Done is hiddenLogic for Back (current > 0 && showBackButton) and Done (last step && showDoneButton) is correct. Please verify UX paths where:
- showDoneButton = false, and
- currentStep.allowCancel !== true on the last step.
Such a setup can strand users at the end. Consider hiding the buttons container when it would be empty or surfacing a non-blocking notice in designer mode.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
shesha-reactjs/src/designer-components/wizard/index.tsx(1 hunks)shesha-reactjs/src/designer-components/wizard/models.ts(1 hunks)shesha-reactjs/src/designer-components/wizard/settingsForm.ts(1 hunks)shesha-reactjs/src/designer-components/wizard/tabs.tsx(3 hunks)
🔇 Additional comments (3)
shesha-reactjs/src/designer-components/wizard/models.ts (1)
83-84: API additions look goodGlobal toggles for Back/Done are appropriate and align with usage elsewhere.
shesha-reactjs/src/designer-components/wizard/index.tsx (1)
32-33: Sane defaults with nullish coalescingDefaults preserve explicit false; matches Tabs usage. Good.
shesha-reactjs/src/designer-components/wizard/tabs.tsx (1)
41-44: Defaults mirrored here are fineRedundant with initModel but harmless and keeps Tabs safe if used outside the Toolbox component.
Summary by CodeRabbit