Skip to content

feat(DockView): update OnlyWhenVisible render logic#7879

Merged
ArgoZhang merged 9 commits intomainfrom
dev-dockview-only
Apr 16, 2026
Merged

feat(DockView): update OnlyWhenVisible render logic#7879
ArgoZhang merged 9 commits intomainfrom
dev-dockview-only

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Apr 16, 2026

Link issues

fixes #7878

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Disable local storage for the DockViewV2 layout group sample and make minor cleanup adjustments to DockView sample components.

Bug Fixes:

  • Prevent unintended use of local storage in the DockViewV2 group sample by explicitly disabling it.

Enhancements:

  • Tidy DockView sample components with minor markup normalization.

Copilot AI review requested due to automatic review settings April 16, 2026 13:16
@bb-auto bb-auto bot added the enhancement New feature or request label Apr 16, 2026
@bb-auto bb-auto bot added this to the v10.5.0 milestone Apr 16, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Apr 16, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates 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 disabled

sequenceDiagram
    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
Loading

File-Level Changes

Change Details Files
Disable local storage persistence on the DockViewV2 grouped layout sample to ensure state does not survive navigation/visibility changes.
  • Add EnableLocalStorage="false" parameter to the DockViewV2 component used in the DockView group sample page
  • Keep existing DockView layout, content, and localization usage unchanged
src/BootstrapBlazor.Server/Components/Samples/DockViews2/DockViewGroup.razor
Normalize Razor page directives and adjust server project/solution metadata (likely encoding or configuration cleanup).
  • Remove BOM or fix encoding on Razor pages so @page directives are clean
  • Update solution and server project files with non-functional configuration/metadata changes (diff not shown)
src/BootstrapBlazor.Server/Components/Samples/DockViews2/DockViewGroup.razor
src/BootstrapBlazor.Server/Components/Samples/DockViews2/DockViewCol.razor
BootstrapBlazor.slnx
src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj

Assessment against linked issues

Issue Objective Addressed Explanation
#7878 Update the DockView component's OnlyWhenVisible render logic so that its rendering behavior is changed as requested. The PR only adjusts sample Razor pages (adding EnableLocalStorage="false" to a DockViewV2 instance and minor page directive changes) and touches solution/project files without modifying any DockView or OnlyWhenVisible implementation code. There is no change to the render logic itself, so the issue's requested behavior change is not implemented.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@ArgoZhang ArgoZhang merged commit 37b80f0 into main Apr 16, 2026
4 checks passed
@ArgoZhang ArgoZhang deleted the dev-dockview-only branch April 16, 2026 13:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.DockView dependency from 10.0.7 to 10.0.8-beta03.
  • Add a ProjectReference (and solution entry) for BootstrapBlazor.DockView.csproj.
  • Update DockViewV2 sample markup (disable local storage in DockViewGroup, and normalize the @page directive 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" />
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b730ec5) to head (2abbd89).
⚠️ Report is 1 commits behind head on main.

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           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(DockView): update OnlyWhenVisible render logic

2 participants