feat(DockView): support auto switch theme#388
Conversation
Reviewer's Guide by SourceryThis pull request introduces theme switching functionality to the BootstrapBlazor.DockView component. Key changes include updating the project and package versions, enhancing the DockViewV2 component to implement IDisposable and handle theme changes, integrating JavaScript for theme management, and adding utility functions for dynamic theme switching. Sequence diagram for theme change handlingsequenceDiagram
participant User
participant DockViewV2
participant ThemeProviderService
participant JavaScript
User->>DockViewV2: Change theme
DockViewV2->>ThemeProviderService: Subscribe to ThemeChangedAsync
ThemeProviderService-->>DockViewV2: ThemeChangedAsync event
DockViewV2->>JavaScript: Update theme via switchTheme
JavaScript-->>DockViewV2: Theme updated
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.
Hey @ArgoZhang - I've reviewed your changes and they look great!
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.
| @@ -6,12 +6,13 @@ import { getConfig, reloadFromConfig, loadPanelsFromLocalstorage, saveConfig } f | |||
| import './dockview-extensions.js' | |||
|
|
|||
| const cerateDockview = (el, options) => { | |||
There was a problem hiding this comment.
nitpick (typo): Check function naming for consistency.
Consider renaming 'cerateDockview' to 'createDockview' if this was not an intentional naming choice, to improve readability and avoid potential confusion.
Suggested implementation:
const createDockview = (el, options) => {If there are any references to "cerateDockview" elsewhere in the file or across your codebase, be sure to update them to "createDockview".
Link issues
fixes #387
Summary By Copilot
This pull request includes several changes to the
BootstrapBlazor.DockViewcomponent to add theme switching functionality and improve the codebase. The most important changes include updating the project version, modifying theDockViewV2component to implementIDisposable, and adding theme-related methods and event handlers.Project Version Update:
src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj: Updated the project version to 9.1.8 and theBootstrapBlazorpackage version to 9.4.12. [1] [2]Component Enhancements:
src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs: ModifiedDockViewV2to implementIDisposable, injectedIThemeProvider, and added theOnThemeChangedAsyncmethod to handle theme changes. [1] [2] [3] [4] [5]JavaScript Integration:
src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js: Added theme handling in theinitfunction and registered an event handler for theme changes. [1] [2] [3] [4]Utility Functions:
src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js: AddedswitchThememethod to thedockviewcomponent to update the theme dynamically. [1] [2]Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Introduce theme switching capability in the DockViewV2 component, enabling automatic theme updates. Enhance the component by implementing IDisposable for better resource management and update project dependencies to the latest versions.
New Features:
Enhancements:
Build: