Conversation
Reviewer's GuideRefactors the DockView component into a Razor + code‑behind pair with richer parameters and title‑bar behavior, introduces a new component-based content type for DockView items, bumps the DockView package version, and temporarily disables the JavaScript loadTabs callback while applying a partial‑mode ShowTab workaround. Sequence diagram for DockViewComponent title bar click behaviorsequenceDiagram
actor User
participant DockViewTitleBar
participant DockViewComponent
participant OnClickTitleBarCallback
User->>DockViewTitleBar: click bar icon
DockViewTitleBar->>DockViewComponent: OnClickBar()
DockViewComponent->>DockViewComponent: check OnClickTitleBarCallback
DockViewComponent-->>OnClickTitleBarCallback: invoke()
OnClickTitleBarCallback-->>DockViewComponent: Task completed
Sequence diagram for updated DockViewV2 loadTabs handlingsequenceDiagram
participant Dockview
participant DockViewV2_js
Dockview->>DockViewV2_js: emit loadTabs(tabs)
DockViewV2_js->>DockViewV2_js: loadTabs handler (no-op)
Updated class diagram for DockViewComponent in DockViewclassDiagram
class DockViewComponentBase
class DockViewComponent {
+bool ShowHeader
+string Title
+int TitleWidth
+string TitleClass
+RenderFragment TitleTemplate
+string Class
+bool Visible
+bool ShowTitleBar
+bool? ShowClose
+string Key
+bool? IsLock
+bool? ShowLock
+bool? IsFloating
+bool? ShowFloat
+bool? ShowMaximize
+string Renderer
+string TitleBarIcon
+string TitleBarIconUrl
+Func_Task_ OnClickTitleBarCallback
+void OnInitialized()
+Task OnClickBar()
+void SetVisible(bool visible)
}
class DockViewContentType {
<<enumeration>>
Component
}
class DockViewTitleBar {
+string BarIcon
+string BarIconUrl
+Func_Task_ OnClickBarCallback
}
DockViewComponent --|> DockViewComponentBase
DockViewComponent ..> DockViewContentType : sets Type
DockViewComponent --> DockViewTitleBar : uses
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:
- In
DockViewV2.razor.jstheloadTabsevent handler is now an empty function; if the callback is intentionally disabled, consider removing the subscription or adding a brief comment to clarify why it is kept registered but does nothing. - The
SetVisiblemethod onDockViewComponentonly updates theVisiblefield without triggering a re-render; if this is meant to update the UI at runtime, consider callingStateHasChanged()or documenting that callers are expected to trigger a refresh themselves.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `DockViewV2.razor.js` the `loadTabs` event handler is now an empty function; if the callback is intentionally disabled, consider removing the subscription or adding a brief comment to clarify why it is kept registered but does nothing.
- The `SetVisible` method on `DockViewComponent` only updates the `Visible` field without triggering a re-render; if this is meant to update the UI at runtime, consider calling `StateHasChanged()` or documenting that callers are expected to trigger a refresh themselves.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
This PR bumps the BootstrapBlazor.DockView package version to 10.0.6 (fixes #968) and includes refactors/behavior changes in DockView rendering and JS interop.
Changes:
- Bump
BootstrapBlazor.DockViewpackage version from10.0.5→10.0.6. - Refactor
DockViewComponentfrom a C#BuildRenderTreeimplementation into a.razor+ code-behind component. - Modify DockView JS interop around the
loadTabsevent / tab rendering flow.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj |
Version bump to 10.0.6. |
src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js |
Changes dockview event wiring (notably loadTabs). |
src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs |
Adds a TODO note in ShowTab logic. |
src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor |
New Razor markup for DockView component rendering. |
src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs |
New code-behind replacing the removed DockViewComponent.cs. |
src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs |
Removed legacy BuildRenderTree implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }); | ||
| dockview.on('loadTabs', tabs => { | ||
| invoke.invokeMethodAsync(options.loadTabs, tabs); | ||
|
|
| { | ||
| <DockViewTitleBar BarIcon="@TitleBarIcon" BarIconUrl="@TitleBarIconUrl" OnClickBarCallback="OnClickBar"></DockViewTitleBar> | ||
| } | ||
| @if (Visible) |
| /// DockContentItem 配置项子项对标 content 配置项内部 content 配置 | ||
| /// </summary> | ||
| public partial class DockViewComponent | ||
| { | ||
| /// <summary> | ||
| /// 获得/设置 组件是否显示 Header 默认 true 显示 | ||
| /// </summary> | ||
| [Parameter] | ||
| public bool ShowHeader { get; set; } = true; | ||
|
|
||
| /// <summary> | ||
| /// 获得/设置 组件 Title | ||
| /// </summary> | ||
| [Parameter] | ||
| public string? Title { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得/设置 组件 Title 宽度 默认 null 未设置 | ||
| /// </summary> | ||
| [Parameter] | ||
| public int? TitleWidth { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得/设置 组件 Title 样式 默认 null 未设置 | ||
| /// </summary> | ||
| [Parameter] | ||
| public string? TitleClass { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得/设置 Title 模板 默认 null 未设置 | ||
| /// </summary> | ||
| [Parameter] | ||
| [JsonIgnore] | ||
| public RenderFragment? TitleTemplate { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// 获得/设置 组件 Class 默认 null 未设置 |
| <Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
|
|
||
| <PropertyGroup> | ||
| <Version>10.0.5</Version> | ||
| <Version>10.0.6</Version> | ||
| </PropertyGroup> |
| /// <param name="key"></param> | ||
| public bool ShowTab(string? key) | ||
| { | ||
| // TODO: Partial 模式下使用临时回滚稍后完善 |
Link issues
fixes #968
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Introduce a new DockViewComponent Razor component for configurable dock panel content and adjust DockView dockview.js behavior.
New Features:
Enhancements: