Skip to content

feat(DockView2): bump version 10.0.8-beta06#976

Merged
ArgoZhang merged 5 commits intomasterfrom
dev-oom
Apr 19, 2026
Merged

feat(DockView2): bump version 10.0.8-beta06#976
ArgoZhang merged 5 commits intomasterfrom
dev-oom

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Apr 19, 2026

Link issues

fixes #975

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

Update DockView V2 disposal patterns and bump DockView package version.

Bug Fixes:

  • Ensure DockViewTitleBar properly releases resources via IAsyncDisposable implementation.
  • Prevent DockViewV2 from leaving theme change event handlers subscribed when disposed.
  • Clear DockViewComponent title bar click callbacks during disposal to avoid stale references.

Copilot AI review requested due to automatic review settings April 19, 2026 01:52
@bb-auto bb-auto bot added the enhancement New feature or request label Apr 19, 2026
@bb-auto bb-auto bot added this to the v9.2.0 milestone Apr 19, 2026
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 19, 2026

Reviewer's Guide

Refactors DockView V2 and related components to adopt async disposal patterns, updating title bar and component cleanup logic and removing the previous synchronous IDisposable implementation.

Sequence diagram for async disposal flow in DockViewV2

sequenceDiagram
    participant BlazorRenderer
    participant DockViewV2
    participant ThemeProviderService
    participant BaseComponent

    BlazorRenderer->>DockViewV2: trigger async dispose
    activate DockViewV2
    DockViewV2->>DockViewV2: DisposeAsync(bool disposing = true)
    DockViewV2->>ThemeProviderService: unsubscribe ThemeChangedAsync
    ThemeProviderService-->>DockViewV2: confirmation
    DockViewV2->>BaseComponent: base.DisposeAsync(disposing)
    activate BaseComponent
    BaseComponent-->>DockViewV2: ValueTask completed
    deactivate BaseComponent
    DockViewV2-->>BlazorRenderer: ValueTask completed
    deactivate DockViewV2
Loading

Class diagram for updated async disposal in DockView components

classDiagram
    class DockViewTitleBar {
        +Func~Task~ OnClickBarCallback
        +Task OnClickBar()
        +ValueTask DisposeAsync()
        +ValueTask DisposeAsync(bool disposing)
    }

    class IAsyncDisposable {
        <<interface>>
        +ValueTask DisposeAsync()
    }

    class DockViewV2 {
        string? Name
        string? LocalStorageKey
        ...
        +void UpdateComponentState(string? key, bool visible, bool? isLock)
        +ValueTask DisposeAsync(bool disposing)
    }

    class DockViewComponent {
        string? Key
        +Action? OnClickTitleBarCallback
        +void Dispose(bool disposing)
    }

    DockViewTitleBar ..|> IAsyncDisposable

    DockViewComponent --> DockViewV2 : DockView

    DockViewComponent : overrides Dispose(bool disposing)
    DockViewV2 : overrides DisposeAsync(bool disposing)
    DockViewTitleBar : clears OnClickBarCallback on DisposeAsync(bool disposing)
    DockViewComponent : clears OnClickTitleBarCallback in Dispose(bool disposing)
Loading

File-Level Changes

Change Details Files
Adopt async disposal pattern for DockViewTitleBar and clear click callback on dispose.
  • Make DockViewTitleBar implement IAsyncDisposable.
  • Add protected virtual DisposeAsync(bool disposing) that nulls OnClickBarCallback when disposing is true.
  • Add public DisposeAsync() that calls the protected overload and suppresses finalization.
src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs
Convert DockViewV2 from synchronous IDisposable to overriding async disposal with theme change unsubscription.
  • Remove IDisposable implementation from DockViewV2 class declaration.
  • Replace private Dispose(bool disposing) and public Dispose() with protected override DisposeAsync(bool disposing) that unsubscribes from ThemeProviderService.ThemeChangedAsync and then calls base.DisposeAsync(disposing).
src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs
Ensure DockViewComponent cleans up title bar click callbacks during disposal.
  • Extend overridden Dispose(bool disposing) to null OnClickTitleBarCallback if it is not null before removing component state from DockView.
src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#975 Add disposing logic for DockViewV2 and related DockView components to correctly release resources (event handlers, callbacks, etc.).
#975 Bump the BootstrapBlazor.DockView package/component version to 10.0.8-beta06.

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

@ArgoZhang ArgoZhang merged commit c866dec into master Apr 19, 2026
4 checks passed
@ArgoZhang ArgoZhang deleted the dev-oom branch April 19, 2026 01:52
Copy link
Copy Markdown

@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:

  • In DockViewTitleBar, consider aligning the disposal pattern with the base component (e.g., overriding Dispose/DisposeAsync instead of introducing a custom DisposeAsync(bool disposing) plus GC.SuppressFinalize, which is unnecessary without a finalizer and may be inconsistent with other components).
  • The DisposeAsync(bool disposing) pattern in DockViewTitleBar currently only nulls OnClickBarCallback; if you intend to support subclass overrides, document or enforce how derived classes should chain base disposal to avoid incomplete cleanup.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `DockViewTitleBar`, consider aligning the disposal pattern with the base component (e.g., overriding `Dispose`/`DisposeAsync` instead of introducing a custom `DisposeAsync(bool disposing)` plus `GC.SuppressFinalize`, which is unnecessary without a finalizer and may be inconsistent with other components).
- The `DisposeAsync(bool disposing)` pattern in `DockViewTitleBar` currently only nulls `OnClickBarCallback`; if you intend to support subclass overrides, document or enforce how derived classes should chain base disposal to avoid incomplete cleanup.

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.

Copy link
Copy Markdown

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 DockView extension package to 10.0.8-beta06 and adjusts component disposal behavior to improve cleanup (notably event unsubscription and callback release) per issue #975.

Changes:

  • Update DockViewV2 disposal to use the async dispose override and unsubscribe from ThemeProviderService.ThemeChangedAsync.
  • Add IAsyncDisposable implementation to DockViewTitleBar and clear click callback on disposal; clear DockViewComponent titlebar callback during disposal.
  • Bump BootstrapBlazor.DockView package version to 10.0.8-beta06.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs Switch disposal approach to async override and unsubscribe from theme change event.
src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs Implement async disposal and clear callback reference on dispose.
src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs Clear titlebar click callback during component disposal.
src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj Bump package version to 10.0.8-beta06.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/// <para lang="en">DockViewV2 component</para>
/// </summary>
public partial class DockViewV2 : IDisposable
public partial class DockViewV2
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

Removing IDisposable from the public DockViewV2 type is a breaking API change for any consumers that were relying on DockViewV2 being disposable (e.g., storing it as IDisposable). If the goal is to switch to the base class async dispose pattern, consider preserving compatibility by keeping IDisposable on the public surface (or providing an explicit IDisposable.Dispose that forwards to the async dispose path), or document this as an intentional breaking change for the beta bump.

Copilot uses AI. Check for mistakes.
Comment on lines 424 to +428
{
ThemeProviderService.ThemeChangedAsync -= OnThemeChangedAsync;
}
}

/// <summary>
/// <inheritdoc/>
/// </summary>
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
return base.DisposeAsync(disposing);
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

DisposeAsync override order is inconsistent with other BootstrapModuleComponentBase components in this repo (they typically await base.DisposeAsync(disposing) first, then run component-specific cleanup; e.g. BootstrapBlazor.Term/Components/Term.razor.cs:226-235, BootstrapBlazor.WinBox/WinBox.razor.cs:249-257). Consider aligning to that pattern (and making this method async if needed) to match the established convention and avoid surprises if the base dispose logic depends on running before derived cleanup.

Copilot uses AI. Check for mistakes.
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(DockView2): bump version 10.0.8-beta06

2 participants