[LayerNext 2] Define attachment scopes and permanent layer disposal
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start by reviewing graph.detachLayer(), React effect cleanup for both supported layer models, and the minimap's injected-style pattern. Trace attachment lifecycle handling across the graph, component construction, ports, subscriptions, and scheduled work before settling the public hook and cleanup-registration API. Done means attach/detach/reattach/disposal behavior is defined, all listed resources are released exactly once, StrictMode cleanup is leak-free, migration docs are updated, and existing consumer, strict, and CI checks pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Parent: #373. Status: deferred. Target branch: v2.
Dependency: #374.
Problem
The current graph.detachLayer() unregisters a layer and removes its DOM, but does not call the component's final unmount. React useLayer invokes this path on effect cleanup. The author-facing afterInit hook runs on every attachment, requires remembering base-hook calls, and cleanup of arbitrary DOM/style resources and scheduled work is easy to miss.
Scope
- Give LayerNext explicit attach, reversible detach/reattach and permanent disposal semantics.
- Invoke author hooks after derived construction is complete; do not call overridable initialization hooks from the base constructor.
- Supply an attached hook context with a guaranteed root and valid declared resources. The engine manages its internal setup without requiring user super calls.
- Allow attachment hooks to return/register cleanup for graph/DOM/signal subscriptions, temporary elements/styles and scheduled work. Run attach-scoped cleanup before reattachment and final disposal.
- Add an explicit full-removal operation such as graph.removeLayer(layer): unregister, detach and dispose the component tree and instance-lifetime resources once. Retain a distinct temporary detach path.
- Use full removal in React effect cleanup for both supported models, including StrictMode and rapid graph/layer replacement.
Acceptance criteria
- Creation before graph attachment, attach/detach/reattach, repeated detach and repeated disposal have defined behavior.
- Permanent removal releases children, ports, subscriptions, custom cleanup and scheduled tasks; a disposed instance cannot be reattached silently.
- Reattachment installs listeners once and leaves no abandoned style elements or other attach-scoped DOM. Cover the minimap's current injected style pattern.
- Explicit hide/show remains distinct from scale activation; resource and root readiness are accurate.
- React cleanup and StrictMode do not leave registered layers or live resources behind.
- Author lifecycle hooks require no super calls and never observe uninitialized derived fields.
- Migration docs distinguish temporary detach, permanent removal and custom cleanup; existing strict/consumer/CI checks stay green.
Exact public hook names and cleanup registration syntax should be reviewed before implementation. This issue records intended semantics rather than locking an unfinished API.
- Ngôn ngữ chính
- TypeScript
- Star
- 145
- Fork
- 12
- Merge trung bình
- 1 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 43
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gravity-ui/graph
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
gravity-ui/graph#457 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
gravity-ui/graph#455 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
gravity-ui/graph#456 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
gravity-ui/graph#431 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
proposal
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
gravity-ui/graph#416 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của gravity-ui/graph
Issue tương tự
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openclaw/openclaw#199885 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
feature needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
BoardGamesEmpire/board-games-empire-backend#1306 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
sequant-io/sequant#1689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100