Skip to content

fix(UniverSheet): keep merged cells on range move and last-column print fill - #1135

Merged
ArgoZhang merged 2 commits into
masterfrom
fix-univer-sheet
Sep 15, 2026
Merged

ArgoZhang merged 2 commits into
masterfrom
fix-univer-sheet

Conversation

@zhaijunlei955

@zhaijunlei955 zhaijunlei955 commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Link issues

fixes #1138

Summary

Rebuild wwwroot/univer/univer-bundle.js from Univer v0.25.0 (fork 8f1ac99cb, webpack 2026-09-08).

This replaces the stock concat bundle. Runtime still loads this one file; no public C# / JS API change.

User-visible fixes

  • Merged cells follow a whole-range move / cut-paste on the same sheet. A self-overlapping vertical move no longer silently drops merges; a horizontal move is no longer blocked as “across merged cells” when merges only sit on the edge of the moving block.
  • Print preview no longer drops the last fully-visible column’s fill and border when the scaled viewport edge lands exactly on that grid line (text was already kept). Same for the last row in the symmetric case.
  • Activating a sheet on an offscreen workbook no longer removes drawings on the visible workbook.
  • Drawing cell anchors no longer pick up the current scroll offset twice (preview / design switch no longer drifts images).
  • Disposing an offscreen workbook no longer kills the visible drawing Edit/Delete popup.

Out of scope

Cross-sheet cut/paste still does not move merges with the cells. That needs a separate Univer fix.

Regression?

  • Yes
  • No

Stock Univer 0.25.0 behavior is unchanged except the cases above. Screen rendering (non-print) is untouched by the print-range patch.

Risk

  • High
  • Medium
  • Low

Single large asset replace (univer-bundle.js). Please smoke-test sheet edit, print preview, and any offscreen print/export path.

Verification

  • Manual (required)

  • Automated

  • Move / cut-paste a block of row-wise merged cells up/down by one row (self-overlap): merges remain.

  • Move the same block left/right when merges sit on the edge: command succeeds.

  • Print a sheet whose last used column’s right edge lands on the viewport bound: last column fill and border still render.

  • Batch print/export with drawings: visible images stay; Edit/Delete popup still appears afterward.

Packaging changes reviewed?

  • Yes
  • No
  • N/A

Please bump BootstrapBlazor.UniverSheet from 10.0.15 → 10.0.16 in this PR if this should ship as a NuGet.

☑️ Self Check before Merge

  • 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 UniverSheet to preserve range content, print formatting, and drawing state across sheet operations and workbook transitions.

Bug Fixes:

  • Preserve merged cells when moving or cut-pasting ranges within the same sheet, including overlapping moves and edge-adjacent merges.
  • Keep the final fully visible row or column fill and border in print output when the viewport boundary aligns with a grid line.
  • Prevent workbook activation and disposal from affecting drawings or drawing controls in the visible workbook.
  • Correct drawing anchor positioning when switching between preview and design modes.

Build:

  • Update the UniverSheet package version and replace the generated Univer runtime bundle with the revised build.

@bb-auto

bb-auto Bot commented Sep 11, 2026

Copy link
Copy Markdown

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

@sourcery-ai

sourcery-ai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Replaces the generated Univer 0.25.0 bundle with a forked build that preserves merges during same-sheet range moves, fixes print-preview rendering at exact row/column boundaries, and stabilizes drawing behavior across workbook visibility, scrolling, and disposal; no public C# or JavaScript API changes are introduced.

File-Level Changes

Change Details Files
Rebuild the generated Univer runtime bundle with targeted fixes for merged-range movement and print-preview boundary rendering.
  • Preserve merged-cell metadata during same-sheet whole-range moves, including self-overlapping vertical moves and edge-adjacent horizontal moves.
  • Retain the final fully visible column or row fill and border when the scaled print viewport ends exactly on a grid line.
  • Leave non-print screen rendering and cross-sheet merge movement unchanged.
src/components/BootstrapBlazor.UniverSheet/wwwroot/univer/univer-bundle.js
Correct workbook, drawing-anchor, and drawing-popup lifecycle behavior across visible and offscreen workbooks.
  • Prevent offscreen sheet activation or workbook disposal from removing drawings or the drawing Edit/Delete popup in the visible workbook.
  • Avoid applying the scroll offset twice when calculating drawing cell anchors during preview/design transitions.
src/components/BootstrapBlazor.UniverSheet/wwwroot/univer/univer-bundle.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

@bb-auto
bb-auto Bot requested a review from ArgoZhang September 11, 2026 03:01

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@bb-auto bb-auto Bot added the bug Something isn't working label Sep 15, 2026
@bb-auto bb-auto Bot added this to the v10.0.0 milestone Sep 15, 2026
ArgoZhang
ArgoZhang previously approved these changes Sep 15, 2026
@ArgoZhang
ArgoZhang merged commit 062ad89 into master Sep 15, 2026
3 checks passed
@ArgoZhang
ArgoZhang deleted the fix-univer-sheet branch September 15, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(UniverSheet): keep merged cells on range move and last-column print fill

2 participants