fix(DockViewV2): TitleTemplate with ShowClose to false not work#971
Merged
fix(DockViewV2): TitleTemplate with ShowClose to false not work#971
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts 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 visibilityflowchart 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
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:
- The new
.bb-dockview .dv-tab-on > .bb-dockview-item-title + .dv-default-tab-actionrule 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.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
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-actionwhen the active tab title is rendered via.bb-dockview-item-title(TitleTemplate path). - Bump
BootstrapBlazor.DockViewpackage version from10.0.6to10.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #970
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes: