Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add scrollLeftTop for sheet snapshot #2414

Merged
merged 4 commits into from
Jun 7, 2024

Conversation

lumixraku
Copy link
Contributor

@lumixraku lumixraku commented Jun 4, 2024

close #2116
#2116

Add scrollLeft scrollTop to sheet snapshot after scroll command, and restore the scrolling state when changing tabs of sheet.

check scrollLeft and scrollTop value in univer._univerInstanceService.getFocusedUnit()._snapshot
image

Pull Request Checklist

  • Related tickets or issues have been linked in the PR description (or missing issue).
  • Naming convention is followed (do please check it especially when you created new plugins, commands and resources).
  • Unit tests have been added for the changes (if applicable).
  • Breaking changes have been documented (or no breaking changes introduced in this PR).

@lumixraku lumixraku self-assigned this Jun 4, 2024
@lumixraku lumixraku added the qa:untested This PR is ready to be tested label Jun 4, 2024
@lumixraku lumixraku changed the title Feat/add scroll left top sheet snapshot feat: add scrollLeftTop for sheet snapshot Jun 4, 2024
Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 15.22491% with 245 lines in your changes missing coverage. Please review.

Project coverage is 27.11%. Comparing base (88f2f6d) to head (4d7082b).

Current head 4d7082b differs from pull request most recent head e8f1158

Please upload reports for the commit e8f1158 to get more accurate results.

Files Patch % Lines
packages/engine-render/src/viewport.ts 0.00% 71 Missing ⚠️
...ers/render-controllers/freeze.render-controller.ts 0.00% 40 Missing ⚠️
...ers/render-controllers/scroll.render-controller.ts 0.00% 39 Missing ⚠️
...s/sheets-ui/src/services/scroll-manager.service.ts 61.01% 23 Missing ⚠️
...src/services/selection/selection-render.service.ts 17.64% 14 Missing ⚠️
...rc/services/selection/selection-shape-extension.ts 0.00% 12 Missing ⚠️
packages/sheets-ui/src/common/utils.ts 0.00% 9 Missing ⚠️
packages/engine-render/src/scene.ts 0.00% 6 Missing ⚠️
...ui/src/controllers/editor/start-edit.controller.ts 0.00% 3 Missing ⚠️
packages/core/src/sheets/worksheet.ts 0.00% 2 Missing ⚠️
... and 19 more
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #2414      +/-   ##
==========================================
- Coverage   27.12%   27.11%   -0.02%     
==========================================
  Files        1653     1653              
  Lines       83228    83300      +72     
  Branches    17234    17254      +20     
==========================================
+ Hits        22574    22585      +11     
- Misses      60654    60715      +61     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jun 4, 2024

View Deployment

#9411388347

🥐 🍔 🥓 🥗 🥘 🌯 🍚 🍛 🍖 🍭 🍧 🍝 🥪 🥖 🍪
Still cooking, please come back later
🥙 🥮 🥨 🌭 🍦 🍙 🍕 🍰 🍮 🍜 🍡 🍱 🍿 🍕 🥟

@lumixraku lumixraku requested a review from weird94 June 5, 2024 03:41
@zhaolixin7 zhaolixin7 added qa:verified This PR has already by verified by a QA and is considered good enough to be merge and removed qa:untested This PR is ready to be tested labels Jun 5, 2024
@lumixraku lumixraku force-pushed the feat/add-scrollLeftTop-sheet-snapshot branch 4 times, most recently from 6bbdc5f to 9d09327 Compare June 6, 2024 11:46
* feat: add scrollLeftTop for sheet snapshot

* fix: set-frozen test case need ScrollManagerService -> SheetSkeletonManagerService

* fix: switch tab sync state in scene and viewport

fix: revert back _updateViewZoom

chore: import SHEET_VIEWPORT_KEY from engine-render
chore: do not change scrollXY when viewport width is negative
@lumixraku lumixraku force-pushed the feat/add-scrollLeftTop-sheet-snapshot branch from 9d09327 to 796352c Compare June 6, 2024 11:55
}

removeScrollBar() {
this._scrollBar = null;
}

/**
* 和 resetSizeAndScrollBar 不同
* 和 resetCanvasSizeAndScrollbar 不同
* 此方法是调整冻结行列设置时 & 初始化时触发, resize window 时并不会触发
Copy link
Member

Choose a reason for hiding this comment

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

Recommended comments are all changed to English

@lumixraku lumixraku force-pushed the feat/add-scrollLeftTop-sheet-snapshot branch from 796352c to 4d7082b Compare June 7, 2024 03:40
@lumixraku lumixraku merged commit 23775c8 into dev Jun 7, 2024
9 checks passed
@lumixraku lumixraku deleted the feat/add-scrollLeftTop-sheet-snapshot branch June 7, 2024 03:47
lumixraku added a commit that referenced this pull request Jun 17, 2024
* feat: add scrollLeftTop for sheet snapshot (#2348)

* feat: add scrollLeftTop for sheet snapshot

* fix: set-frozen test case need ScrollManagerService -> SheetSkeletonManagerService

* fix: switch tab sync state in scene and viewport

* fix: revert back _updateViewZoom

* chore: import SHEET_VIEWPORT_KEY from engine-render

* fix: when update scroll should consider scale factor

* chore: do not change scrollXY when viewport width is negative

* test: should use sheetSkService from cur render
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request qa:verified This PR has already by verified by a QA and is considered good enough to be merge scope:freeze scope:rendering scope:sheets basics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] the scrollTop and scrollLeft of active sheet is always 0
5 participants