Skip to content

feat(DockView): bump version 9.1.13#436

Merged
ArgoZhang merged 2 commits intomasterfrom
release-dockview
May 7, 2025
Merged

feat(DockView): bump version 9.1.13#436
ArgoZhang merged 2 commits intomasterfrom
release-dockview

Conversation

@zhaijunlei955
Copy link
Copy Markdown
Contributor

@zhaijunlei955 zhaijunlei955 commented May 7, 2025

Link issues

fixes #437

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 library to version 4.2.5, including CSS and JavaScript improvements for tab and element rendering

New Features:

  • Improved element positioning and rendering for dragged elements

Enhancements:

  • Updated CSS styles for tab interactions and focus states
  • Refined element positioning logic in JavaScript

@bb-auto
Copy link
Copy Markdown

bb-auto Bot commented May 7, 2025

Thanks for your PR, @zhaijunlei955. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@bb-auto bb-auto Bot requested a review from ArgoZhang May 7, 2025 02:04
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented May 7, 2025

Reviewer's Guide

This PR upgrades the dockview component to version 4.2.5. The update is implemented by replacing the dockview-core.esm.js file with the new version's code, which includes internal adjustments to element positioning and drag ghost image behavior. Accompanying CSS changes involve reorganizing existing style definitions within dockview.css by relocating several style blocks.

Sequence Diagram for Updated Drag Ghost Image Creation

sequenceDiagram
    participant User
    participant DockViewSystem as "DockView System"
    participant GhostElement as "Ghost Element"
    participant DocumentBody as "document.body"
    participant DataTransferApi as "Browser DataTransfer API"

    User->>+DockViewSystem: Initiates drag operation
    DockViewSystem->>DockViewSystem: System calls addGhostImage(dataTransfer, ghostElement, options)
    DockViewSystem->>GhostElement: Add CSS class 'dv-dragged'
    DockViewSystem->>GhostElement: Set style.top = '-9999px' (NEW: Hide initially off-screen)
    DockViewSystem->>DocumentBody: appendChild(ghostElement)
    DockViewSystem->>DataTransferApi: setDragImage(ghostElement, x, y)
    DockViewSystem->>DockViewSystem: Schedule ghostElement.remove() via setTimeout
    Note right of DockViewSystem: Ghost element is removed from DOM shortly after the browser has captured its appearance for the drag operation.
    deactivate DockViewSystem
Loading

Class Diagram for Updated DockView JavaScript Module

classDiagram
  class DockViewCoreEsmJs {
    <<JavaScript Module>>
    +shiftAbsoluteElementIntoView(element, root, options)
    +addGhostImage(dataTransfer, ghostElement, options)
  }
  note for DockViewCoreEsmJs "DockView Core Module (dockview-core.esm.js) updated to v4.2.5"
  note for DockViewCoreEsmJs.shiftAbsoluteElementIntoView "Refactored element positioning logic (shiftAbsoluteElementIntoView):
- Consistently uses `root.getBoundingClientRect()` for root dimensions, removing reliance on `root.clientWidth/Height`.
- Defines `right` and `bottom` variables as overflow amounts relative to the root.
- Adjusts conditions and translation calculations based on these overflow amounts for clarity and robustness (e.g., `if (overflow_right > buffer)` then `translateX = -buffer - overflow_right`)."
  note for DockViewCoreEsmJs.addGhostImage "Improved drag ghost image handling (addGhostImage):
- Ghost element is initially positioned off-screen (e.g., `style.top = '-9999px'`)
  before being appended to the DOM and used with `setDragImage`.
- This prevents potential flicker or momentary rendering of the ghost element at an incorrect position (e.g., 0,0)."
Loading

File-Level Changes

Change Details Files
Reorganized CSS style blocks for layout and interactive elements.
  • Relocated style definitions for .dv-root-wrapper, .dv-grid-view, and .dv-branch-node to an earlier position in the file.
  • Relocated style definitions for .dv-dragged, .dv-tab, .dv-watermark, and related tab/drag styles to an earlier position in the file.
src/components/BootstrapBlazor.DockView/wwwroot/css/dockview.css
Updated JavaScript library to v4.2.5, incorporating internal logic adjustments.
  • Updated the library version comment from 4.2.4 to 4.2.5.
  • Modified the shiftAbsoluteElementIntoView function's logic for calculating how elements are shifted into view based on boundaries.
  • Updated the addGhostImage function to initially position the drag ghost element off-screen, preventing potential rendering artifacts.
src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-core.esm.js

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

@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 @zhaijunlei955 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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 changed the title release: dockview update to v4.2.5 feat(DockView): bump version 9.1.13 May 7, 2025
@bb-auto bb-auto Bot added the enhancement New feature or request label May 7, 2025
@bb-auto bb-auto Bot added this to the v9.2.0 milestone May 7, 2025
@ArgoZhang ArgoZhang merged commit fdc5558 into master May 7, 2025
1 check passed
@ArgoZhang ArgoZhang deleted the release-dockview branch May 7, 2025 05:30
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): bump version 9.1.13

2 participants