feat: add Wizard component for multi-step wizard flows#127
Merged
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Add a new Wizard component that supports: - Multi-step wizard with breadcrumb navigation - Navigation enum (Next, Back, Jump, Stay, Done) - Section struct with label and run closure - Breadcrumb rendering with numbered sections [1:Name] > 2:Tools - Escape key handling for back navigation - Proper Ctrl+C cleanup Also adds breadcrumb styling fields to Theme: - breadcrumb_active, breadcrumb_clickable, breadcrumb_future - breadcrumb_separator Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add cursor restoration on successful wizard completion (Navigation::Done) - Mark target section as visited when navigating Back or on Escape - Add documentation for handle_navigation_key explaining it's a utility for library consumers implementing custom widgets Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Breadcrumb navigation is never rendered during wizard execution
Medium Severity
The render_breadcrumb() method exists but is never called during wizard execution, and sections cannot call it because they only receive (&mut S, &Theme) parameters without access to the Wizard instance. The PR description advertises "Breadcrumb rendering with numbered sections" as a feature, but no breadcrumb will ever be displayed. The doc comment on render_breadcrumb incorrectly states "Sections can call this to include the breadcrumb in their output if desired."
Additional Locations (1)
When Escape is pressed, widgets now clear their rendered output before returning the Interrupted error. This prevents stale widget output from accumulating when navigating between sections in wizard flows. Affected widgets: Select, MultiSelect, Input, Confirm Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix render_breadcrumb doc comment to accurately describe limitations - Remove Section and SectionFn from public exports (users interact via Wizard::section() builder method) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Wizardcomponent for building multi-step wizard flows with breadcrumb navigationNavigationenum (Next,Back,Jump(usize),Stay,Done) for controlling flowSectionstruct with label and run closure for each wizard stepTheme(breadcrumb_active,breadcrumb_clickable,breadcrumb_future,breadcrumb_separator)Features
[1:Name] > 2:Tools > 3:DoneExample usage
Test plan
examples/wizard.rs🤖 Generated with Claude Code
Note
Medium Risk
Introduces a new interactive terminal flow (
Wizard) and extendsThemewith new styling fields, which can affect rendering and navigation behavior across consumers. Also changes Escape-cancel behavior in several prompts by clearing terminal output before returningInterrupted.Overview
Adds a new
WizardAPI (withNavigationactions andhandle_navigation_key) to run multi-step terminal flows and support numbered breadcrumb navigation.Extends
Themewith breadcrumb styling fields and updates all theme constructors to provide defaults.Improves cancellation UX by calling
clear()onEscapebefore returningio::ErrorKind::InterruptedinConfirm,Input,Select, andMultiSelect, and adds anexamples/wizard.rsdemo.Written by Cursor Bugbot for commit 304b6eb. This will update automatically on new commits. Configure here.