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

refactor(edgeless): element tree manager #8239

Merged
merged 1 commit into from
Oct 14, 2024

Commits on Oct 14, 2024

  1. refactor(edgeless): element tree manager (#8239)

    ### 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.
    L-Sun committed Oct 14, 2024
    Configuration menu
    Copy the full SHA
    1e7573e View commit details
    Browse the repository at this point in the history