feat(DockView): update OnlyWhenVisible render logic#7879
Conversation
# Conflicts: # src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
# Conflicts: # src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates DockView V2 sample pages to adjust rendering/local storage behavior and fixes minor Razor directive encoding, likely in support of OnlyWhenVisible render logic changes referenced in the issue. Sequence diagram for DockViewV2 rendering with EnableLocalStorage disabledsequenceDiagram
actor User
participant Browser
participant DockViewV2
participant LocalStorage
User->>Browser: Navigate to /dock-view2/group
Browser->>DockViewV2: Initialize DockViewV2(Name=DockViewV2LayoutGroup, EnableLocalStorage=false)
DockViewV2->>DockViewV2: Build layout from DockViewContent tree
DockViewV2-xLocalStorage: Skip reading stored layout (EnableLocalStorage=false)
DockViewV2->>Browser: Render dock layout
User->>DockViewV2: Rearrange tabs and groups
DockViewV2-xLocalStorage: Skip writing layout to storage (EnableLocalStorage=false)
DockViewV2->>Browser: Update rendered layout
User->>Browser: Refresh or reopen /dock-view2/group
Browser->>DockViewV2: Reinitialize DockViewV2(EnableLocalStorage=false)
DockViewV2->>DockViewV2: Build layout from default configuration
DockViewV2-xLocalStorage: No layout restoration
DockViewV2->>Browser: Render default layout again
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 - I've left some high level feedback:
- If unintended local storage usage is a broader concern, consider setting
EnableLocalStorage="false"on all relevantDockViewV2samples for consistent behavior across the demo pages. - Instead of disabling local storage only in the sample, evaluate whether the
DockViewV2component’s default forEnableLocalStorageshould befalseand explicitly enabled where persistence is required, to reduce accidental state saving.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- If unintended local storage usage is a broader concern, consider setting `EnableLocalStorage="false"` on all relevant `DockViewV2` samples for consistent behavior across the demo pages.
- Instead of disabling local storage only in the sample, evaluate whether the `DockViewV2` component’s default for `EnableLocalStorage` should be `false` and explicitly enabled where persistence is required, to reduce accidental state saving.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
Updates the DockViewV2 sample and dependencies to pick up the latest “OnlyWhenVisible” render logic changes (issue #7878), plus a small sample configuration tweak.
Changes:
- Bump
BootstrapBlazor.DockViewdependency from10.0.7to10.0.8-beta03. - Add a
ProjectReference(and solution entry) forBootstrapBlazor.DockView.csproj. - Update DockViewV2 sample markup (disable local storage in
DockViewGroup, and normalize the@pagedirective line encoding/formatting).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/BootstrapBlazor.Server/Components/Samples/DockViews2/DockViewGroup.razor |
Disables DockViewV2 local storage for this sample and normalizes the @page line. |
src/BootstrapBlazor.Server/Components/Samples/DockViews2/DockViewCol.razor |
Normalizes the @page line (removes hidden BOM/formatting). |
src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj |
Upgrades DockView package and adds an external project reference to DockView. |
BootstrapBlazor.slnx |
Adds DockView project to the solution via an external (out-of-repo) path. |
Comments suppressed due to low confidence (1)
src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj:96
- This ProjectReference points to a path outside this repository (..�......\BootstrapBlazor.Extensions...). Since that project isn't present in this repo, a clean clone/CI build will fail with 'project file not found'. Either vendor the project into this repo, remove this reference, or add a Condition="Exists('...')" and ensure the build uses the NuGet package by default.
<ProjectReference Include="..\BootstrapBlazor\BootstrapBlazor.csproj" />
</ItemGroup>
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <PackageReference Include="BootstrapBlazor.CodeEditor" Version="10.0.0" /> | ||
| <PackageReference Include="BootstrapBlazor.Dock" Version="10.0.0" /> | ||
| <PackageReference Include="BootstrapBlazor.DockView" Version="10.0.7" /> | ||
| <PackageReference Include="BootstrapBlazor.DockView" Version="10.0.8-beta03" /> |
There was a problem hiding this comment.
This project now references BootstrapBlazor.DockView twice (PackageReference here and a ProjectReference later in the file). Referencing the same assembly from both NuGet and a project typically causes duplicate/ambiguous type conflicts at compile time. Choose a single source (prefer PackageReference for CI), or gate the ProjectReference behind a Condition and remove the PackageReference when the project reference is enabled.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7879 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 764 764
Lines 34162 34162
Branches 4700 4700
=========================================
Hits 34162 34162
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:
|
Link issues
fixes #7878
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Disable local storage for the DockViewV2 layout group sample and make minor cleanup adjustments to DockView sample components.
Bug Fixes:
Enhancements: