-
-
Notifications
You must be signed in to change notification settings - Fork 362
feat(Layout): add OnCloseTabItemAsync parameter #7023
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 GuideThis PR enhances the Layout component by introducing an asynchronous OnCloseTabItemAsync callback to intercept and optionally cancel tab closures, and wires it through to the razor template. Sequence diagram for tab close interception with OnCloseTabItemAsyncsequenceDiagram
participant User
participant Layout
participant TabItem
User->>Layout: Request to close TabItem
Layout->>Layout: Invoke OnCloseTabItemAsync(TabItem)
alt OnCloseTabItemAsync returns true
Layout->>TabItem: Close TabItem
else OnCloseTabItemAsync returns false
Layout-->>User: Tab closure cancelled
end
Class diagram for updated Layout component with OnCloseTabItemAsyncclassDiagram
class Layout {
+Func<Task>? OnToolbarRefreshCallback
+Func<TabItem, Task<bool>>? OnCloseTabItemAsync
}
class TabItem
Layout --> TabItem : uses in OnCloseTabItemAsync
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7023 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 743 743
Lines 32452 32453 +1
Branches 4498 4498
=========================================
+ Hits 32452 32453 +1
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 support for a callback method to control tab closing behavior in the Layout component. The callback allows consumers to implement custom logic that can prevent a tab from being closed by returning false.
- Added
OnCloseTabItemAsyncparameter to the Layout component that accepts a callback function - Passed the new parameter through to the underlying Tab component which already supports this functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/Layout/Layout.razor.cs | Added the OnCloseTabItemAsync parameter with documentation describing the callback behavior |
| src/BootstrapBlazor/Components/Layout/Layout.razor | Passed the new OnCloseTabItemAsync parameter to the Tab component |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Link issues
fixes #7020
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add OnCloseTabItemAsync callback to Layout component and bind it to the Tab component to enable async pre-close logic and optional cancellation of tab items
New Features:
Bug Fixes:
Enhancements: