-
-
Notifications
You must be signed in to change notification settings - Fork 415
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
refactor(edgeless): element tree manager #8239
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
|
Your org has enabled the Graphite merge queue for merging into masterAdd the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 1e7573e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
818cecd
to
a21a0ac
Compare
Closes: [BS-1398](https://linear.app/affine-design/issue/BS-1398/[bug]-拖出-frame-后-mindmap-依然跟随-frame), [BS-1400](https://linear.app/affine-design/issue/BS-1400/mindmap无法移出frame) This PR fix mindmap is moved with frame moving when the mindmap has been drag out of frame. ### What changes - add workround to avoid multiple container in `FrameManager` for nodes of mindmap. - The fix can be refactored after #8239 - add frame and mindmap e2e tests
a21a0ac
to
3db021b
Compare
3db021b
to
8824b32
Compare
size-limit report 📦
|
8824b32
to
87b543d
Compare
87b543d
to
2720313
Compare
2720313
to
baef0d2
Compare
baef0d2
to
ffddf7c
Compare
ffddf7c
to
a4d70cd
Compare
a4d70cd
to
6948bd8
Compare
6948bd8
to
4565077
Compare
4565077
to
7433fda
Compare
7433fda
to
80a2b6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merge activity
|
### TL;DR This PR introduces `TreeManager` to maintain the container-children relationship among `GfxModel`s. This change can make sure an element only has zero or one container. ### What changes: - A new `TreeManager` is introduced to maintain the container-children relationship. Its implementation references the relevant code previously used in group in `surface-model.ts`. - Removed code related to the container-children relationship watcher of group. - The `ContainerElement` interface and related code have been moved from `element-model.ts` to a new file, `container-element.ts`. - Simplified the implementation of the `ContainerElement` interface in `GroupLikeModel` and `FrameModel`. - Some type annotation changes: from `BlockSuite.EdgelessModel` to `GfxModel`. ### About test: The existing tests already cover the changes mentioned above, including the relationship changes after operations on the child elements of frames and groups.
80a2b6d
to
1e7573e
Compare
This PR removes redundant code related to the container-child element relationship, which is now maintained by the new `TreeManager` after #8239 .
This PR refactor group test utils with container interface after PR #8239
## Features: [feat: markdown adapter with latex](#8503) [feat: support notion block equation html import](#8504) [feat: support edgeless tidy up](#8516) [feat: support notion callout block to blocksuite quote block](#8523) [feat(playground): add import notion zip entry](#8527) ## Bugfix: [fix(blocks): auto focus latex block](#8505) [fix: enhance button layout with icon alignment](#8508) [fix(edgeless): ime will crash edgeless text width](#8506) [fix(edgeless): edgeless text is deleted when first block is empty](#8512) [fix: notion html quote block import](#8515) [fix: yjs warning](#8519) [fix(blocks): real nested list on html export](#8511) [fix(edgeless): cmd a will select element inner frame](#8517) [fix(edgeless): disable contenteditable when edgeless text not in editing state](#8525) [fix: import notion toggle list as toggle bulleted list](#8528) ## Refactor: [refactor(database): signals version datasource api](#8513) [refactor(edgeless): element tree manager](#8239) [refactor(blocks): simplify frame manager implementation](#8507) [refactor: update group test utils using container interface](#8518) [refactor: update frame test with container test uitls](#8520) [refactor(database): context-menu ui and ux](#8467) [refactor: move chat block to affine](#8420) ## Misc [perf: optimize snapshot job handling](#8428) [perf(edgeless): disable shape shadow blur](#8532) [chore: bump up all non-major dependencies](#8514) [chore: Lock file maintenance](#8510) ## Docs [docs: fix table structure warning](#8509) [docs: edgeless data structure desc](#8531) [docs: update link](#8533)
TL;DR
This PR introduces
TreeManager
to maintain the container-children relationship amongGfxModel
s. This change can make sure an element only has zero or one container.What changes:
TreeManager
is introduced to maintain the container-children relationship. Its implementation references the relevant code previously used in group insurface-model.ts
.ContainerElement
interface and related code have been moved fromelement-model.ts
to a new file,container-element.ts
.ContainerElement
interface inGroupLikeModel
andFrameModel
.BlockSuite.EdgelessModel
toGfxModel
.About test:
The existing tests already cover the changes mentioned above, including the relationship changes after operations on the child elements of frames and groups.