-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
Fix Utils issues in BlazorUI (#9481) #9482
Fix Utils issues in BlazorUI (#9481) #9482
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe pull request introduces modifications across several TypeScript and C# files in the BlazorUI project. The changes primarily focus on error handling in JavaScript utility methods, simplifying namespace references, and removing certain utility methods. The modifications include adding try-catch blocks to methods, updating method signatures, and removing methods like Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 4
🧹 Outside diff range and nitpick comments (2)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.ts (1)
Line range hint
25-29
: Consider standardizing abort method signatures across picker componentsThe
abort
method signature differs fromColorPicker.abort()
which includes adispose
parameter for cleanup. Consider standardizing these implementations for consistency.- public static abort(id: string): void { + public static abort(id: string, dispose: boolean = false): void { const bitController = CircularTimePicker._bitControllers.find(bc => bc.id == id); bitController?.controller.abort(); + + if (dispose) { + bitController?.dotnetObj?.dispose(); + } CircularTimePicker._bitControllers = CircularTimePicker._bitControllers.filter(bc => bc.id != id); }src/BlazorUI/Bit.BlazorUI/Scripts/Utils.ts (1)
15-15
: Remove unnecessary empty finally blockThe empty finally block adds no value and can be removed while keeping the try block for error handling.
- try { fn(...args); } finally { } + try { fn(...args); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Slider/BitSlider.razor.cs
(2 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.ts
(1 hunks)src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/ColorPicker/BitColorPicker.ts
(1 hunks)src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/UtilsJsRuntimeExtensions.cs
(0 hunks)src/BlazorUI/Bit.BlazorUI/Scripts/Observers.ts
(1 hunks)src/BlazorUI/Bit.BlazorUI/Scripts/Utils.ts
(2 hunks)
💤 Files with no reviewable changes (1)
- src/BlazorUI/Bit.BlazorUI/Extensions/JsInterop/UtilsJsRuntimeExtensions.cs
🧰 Additional context used
🪛 Biome (1.9.4)
src/BlazorUI/Bit.BlazorUI/Scripts/Utils.ts
[error] 31-32: Unsafe usage of 'return'.
'return' in 'finally' overwrites the control flow statements inside 'try' and 'catch'.
(lint/correctness/noUnsafeFinally)
🔇 Additional comments (5)
src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/ColorPicker/BitColorPicker.ts (1)
3-3
: LGTM! Consistent with namespace simplification
The change aligns with the namespace simplification pattern seen across other files while maintaining the same functionality.
src/BlazorUI/Bit.BlazorUI/Components/Inputs/_Pickers/CircularTimePicker/BitCircularTimePicker.ts (1)
3-3
: LGTM! Consistent with namespace simplification
The change aligns with the namespace simplification pattern seen across other files.
src/BlazorUI/Bit.BlazorUI/Scripts/Utils.ts (1)
49-52
: LGTM! Good improvements to getBoundingClientRect
The changes improve type safety by:
- Using
Partial<DOMRect>
to accurately represent possible null returns - Adding proper null checking
src/BlazorUI/Bit.BlazorUI/Components/Inputs/Slider/BitSlider.razor.cs (2)
222-238
: LGTM! Clean refactoring of height calculations
The changes consistently use the new GetClientHeight
method while maintaining the same logical flow.
344-350
: LGTM! Well-implemented GetClientHeight method
The new method is well-structured with:
- Proper async/await pattern
- Good null/empty value handling
- Appropriate fallback to 0 for invalid cases
closes #9481
Summary by CodeRabbit
New Features
Bug Fixes
isTouchDevice
method.Chores