-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
refactor(LayoutSplitebar): Enhanced javascript handle sidebar width is not set #5512
Conversation
Reviewer's Guide by SourceryThis pull request removes the unused Sequence diagram for LayoutSplitebar init functionsequenceDiagram
participant JSInterop as JS
participant section
participant bar
JS->>JS: init(id)
JS->>section: getComputedStyle(section).getPropertyValue('--bb-layout-sidebar-width')
alt widthString is empty
JS->>section: section.style.setProperty('--bb-layout-sidebar-width', '0')
end
JS->>section: parseInt(widthString)
JS->>bar: Drag.drag(bar, drag, move)
loop Dragging
bar->>section: section.classList.add('drag')
bar->>section: getComputedStyle(section).getPropertyValue('--bb-layout-sidebar-width')
bar->>JS: eventX - originX
JS->>JS: newWidth = width + moveX
alt newWidth < min
JS->>JS: newWidth = min
end
JS->>section: section.style.setProperty('--bb-layout-sidebar-width', newWidth)
end
File-Level Changes
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 @ArgoZhang - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider adding a try-catch block around the
parseInt
call inLayoutSplitebar.razor.js
to handle potential parsing errors. - The code in
LayoutSplitebar.razor.js
modifies the style directly; consider if this could be done with CSS classes instead.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5512 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 649 649
Lines 29563 29563
Branches 4165 4165
=========================================
Hits 29563 29563 ☔ View full report in Codecov by Sentry. |
Link issues
fixes #5511
Summary By Copilot
This pull request includes several changes to the
BootstrapBlazor
project, focusing on the removal of unused components and improvements to the layout split bar functionality. The most important changes include the removal of theOnlineSheet
component and the enhancement of theinit
function inLayoutSplitebar.razor.js
.Removal of
OnlineSheet
component:src/BootstrapBlazor.Server/Components/Samples/Tutorials/OnlineSheet.razor
: Removed theOnlineSheet
component.src/BootstrapBlazor.Server/Components/Samples/Tutorials/OnlineSheet.razor.cs
: Removed the associated C# code-behind file.src/BootstrapBlazor.Server/Components/Samples/Tutorials/OnlineSheet.razor.css
: Removed the associated CSS file.src/BootstrapBlazor.Server/Components/Samples/Tutorials/OnlineSheet/OnlineSheet.razor.cs
: Updated theOnlineSheet
class to remove theComponentBase
inheritance.Improvements to layout split bar functionality:
src/BootstrapBlazor/Components/Layout/LayoutSplitebar.razor.js
: Enhanced theinit
function to handle cases where the sidebar width is not set, ensuring a default value is applied.Regression?
[If yes, specify the version the behavior has regressed from]
[是否影响老版本]
Risk
[Justify the selection above]
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Refactors the LayoutSplitebar component to handle cases where the sidebar width is not explicitly set, providing a default value. Removes the OnlineSheet component.
Enhancements: