Skip to content

fix(DockViewV2): TitleTemplate with ShowClose to false not work#971

Merged
ArgoZhang merged 3 commits intomasterfrom
fix-title-close
Apr 14, 2026
Merged

fix(DockViewV2): TitleTemplate with ShowClose to false not work#971
ArgoZhang merged 3 commits intomasterfrom
fix-title-close

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Apr 14, 2026

Link issues

fixes #970

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

Bug Fixes:

  • Fix close button visibility when using a custom DockView item title template with ShowClose set to false.

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

sourcery-ai Bot commented Apr 14, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts DockViewV2 tab CSS so that custom title templates using .bb-dockview-item-title correctly control the close button visibility when ShowClose is false, aligning their behavior with the default tab content styling.

Flow diagram for DockViewV2 CSS selector logic for close button visibility

flowchart TD
    A[Start: Render DockViewV2 tab] --> B{Tab_has_ShowClose_false?}
    B -->|No| C[Show close button using default styling]
    B -->|Yes| D{Title_element_type}
    D -->|dv_default_tab_content| E[Match selector bb_dockview dv_tab_on > dv_default_tab_content + dv_default_tab_action]
    D -->|bb_dockview_item_title| F[Match selector bb_dockview dv_tab_on > bb_dockview_item_title + dv_default_tab_action]
    E --> G[Hide or adjust dv_default_tab_action close button]
    F --> G
    G --> H[Tabs and actions container with dv_tab_on matches selectors for bb_dockview_control_icon_close]
    H --> I[Close button visibility now consistent for default and custom title templates]
    C --> I
Loading

File-Level Changes

Change Details Files
Align close-button visibility logic for custom title templates with default tab title behavior in DockViewV2 CSS.
  • Extend the CSS selector that toggles .dv-default-tab-action based on the active tab so it also matches tabs using .bb-dockview-item-title before the action container
  • Normalize the CSS file header by removing a stray BOM-related character before the @import statement
src/components/BootstrapBlazor.DockView/wwwroot/css/dockview-bb.css

Assessment against linked issues

Issue Objective Addressed Explanation
#970 Fix DockViewV2 so that when a TitleTemplate is used with ShowClose set to false, the close action/icon is correctly hidden and behaves as expected.

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 3e77f24 into master Apr 14, 2026
4 checks passed
@ArgoZhang ArgoZhang deleted the fix-title-close branch April 14, 2026 05:13
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:

  • The new .bb-dockview .dv-tab-on > .bb-dockview-item-title + .dv-default-tab-action rule duplicates the previous pattern; consider extracting a shared class or more generic selector so future changes to tab-on behavior don't require updating multiple selectors.
  • Since this logic relies on :has(.dv-tab-on) for close button behavior, confirm that all supported target browsers for DockViewV2 reliably support :has, or provide a graceful fallback to avoid regressions in older environments.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `.bb-dockview .dv-tab-on > .bb-dockview-item-title + .dv-default-tab-action` rule duplicates the previous pattern; consider extracting a shared class or more generic selector so future changes to tab-on behavior don't require updating multiple selectors.
- Since this logic relies on `:has(.dv-tab-on)` for close button behavior, confirm that all supported target browsers for DockViewV2 reliably support `:has`, or provide a graceful fallback to avoid regressions in older environments.

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

Fixes DockViewV2 behavior where providing a TitleTemplate prevented ShowClose="false" from hiding the tab close action, by extending the CSS rule to cover the template-based title element.

Changes:

  • Update DockView CSS to hide .dv-default-tab-action when the active tab title is rendered via .bb-dockview-item-title (TitleTemplate path).
  • Bump BootstrapBlazor.DockView package version from 10.0.6 to 10.0.7.

Reviewed changes

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

File Description
src/components/BootstrapBlazor.DockView/wwwroot/css/dockview-bb.css Adds a sibling selector to ensure the close action is hidden when the tab title is replaced by the TitleTemplate wrapper element.
src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj Patch version bump for the DockView package to ship the fix.

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

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.

bug(DockViewV2): TitleTemplate with ShowClose to false not work

3 participants