-
-
Notifications
You must be signed in to change notification settings - Fork 374
feat(Step): add SetStepIndex method #7619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds a new method to programmatically set the current step index in the Step component, and improves XML documentation inheritance for TreeView parameters related to IModelEqualityComparer. Sequence diagram for the new SetStepIndex step update flowsequenceDiagram
actor Caller
participant Step
participant OnFinishedCallback
Caller->>Step: SetStepIndex(index)
activate Step
Step->>Step: _currentStepIndex = clamp(index, 0, Items.Count)
Step->>Step: check IsFinished
alt IsFinished is true and OnFinishedCallback not null
Step->>OnFinishedCallback: Invoke()
activate OnFinishedCallback
OnFinishedCallback-->>Step: Task completed
deactivate OnFinishedCallback
end
Step->>Step: StateHasChanged()
Step-->>Caller: Task completed
deactivate Step
Updated class diagram for Step component with SetStepIndexclassDiagram
class Step {
int StepIndex
int _currentStepIndex
List~StepItem~ Items
bool IsFinished
Func Task OnFinishedCallback
Task~int~ Next()
Task SetStepIndex(int index)
Task Reset()
}
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- In SetStepIndex, clamping with Math.Min(Items.Count, index) allows index == Items.Count, which is out of range for a 0-based Items collection; consider using Items.Count - 1 as the upper bound instead.
- If StepIndex is a parameter or otherwise externally observable, consider updating any associated StepIndexChanged callback or notification paths in SetStepIndex so that consumers are kept in sync when the index is set programmatically.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In SetStepIndex, clamping with Math.Min(Items.Count, index) allows index == Items.Count, which is out of range for a 0-based Items collection; consider using Items.Count - 1 as the upper bound instead.
- If StepIndex is a parameter or otherwise externally observable, consider updating any associated StepIndexChanged callback or notification paths in SetStepIndex so that consumers are kept in sync when the index is set programmatically.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7619 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 749 749
Lines 33007 33015 +8
Branches 4580 4581 +1
=========================================
+ Hits 33007 33015 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new SetStepIndex method to the Step component to address issue #7615, where users could not directly set the step index but only navigate using Prev() and Next() methods. The PR also includes unrelated documentation improvements to the TreeView component and bumps the version number.
Changes:
- Added
SetStepIndexmethod to allow programmatic setting of the current step index - Improved
inheritdocdocumentation references in TreeView component - Version bump from 10.3.1-beta03 to 10.3.1-beta04
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/Step/Step.razor.cs | Added new SetStepIndex method with bounds checking and OnFinishedCallback support |
| src/BootstrapBlazor/Components/TreeView/TreeView.razor.cs | Improved documentation by adding specific cref attributes to inheritdoc tags |
| src/BootstrapBlazor/BootstrapBlazor.csproj | Incremented version number to 10.3.1-beta04 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Link issues
fixes #7615
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add programmatic control for the current step index in the Step component and refine TreeView parameter XML documentation inheritance.
New Features:
Enhancements: