refactor(erd): extract ErdViewController and ErdCanvas from _ErdViewState
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
- 45/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- desktop, developer-experience
Hướng nghiên cứu
Start with erd_view.dart and the existing operations in core/erd, including erd_group_ops, erd_note_ops and erd_saved_layout; first map how _ErdViewState shares its state across handlers. Split the controller and canvas into separate small PRs, then verify erd_view.dart is about 900 lines or less and build is readable. Add unit tests for selection, focus, saved views, groups and notes, and run the existing widget tests under test/features/erd unchanged.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Follow-up to #1362, which took erd_view.dart from 2,895 to 1,705 lines (layout engine, router and geometry in core/erd, ErdTableCard, ErdRelationPainter, ErdExporter, note and group widgets, search / views / export menus). What is left is one class, _ErdViewState: about 1,580 lines, ~135 members, ~31 state fields, and a 305-line build.
What is still in _ErdViewState
- Canvas: scale, pan, fit (
_setScale,_zoomBy,_fit), tap and hover (_tapCanvas,_hoverCanvas), theInteractiveViewerinbuild. - Selection and focus:
_selectTable,_clearSelection,_syncFocus,_cardFocusFor, search picking. - Saved views:
_applyState,_showState,_switchView,_newView,_renameView,_deleteView,_scheduleSave,_saveNow,_current. - Groups and notes: create, edit, gather, drag, resize.
- Card dragging and re-routing:
_dragStart/_dragMove/_dragEnd,_scheduleRoutes.
Change
ErdViewController(aChangeNotifier, no widget imports) owns selection, focus, search state, saved views, groups and notes. The pure operations that already live incore/erd(erd_group_ops,erd_note_ops,erd_saved_layout) stay there and are called from it.ErdCanvaswidget owns theInteractiveViewer, scale / fit / tap / hover and the drag of cards._ErdViewStatecomposes the two with the toolbar, menus and dialogs.
Acceptance
-
erd_view.dartis at most ~900 lines, andbuildis split into parts of a readable size. - Selection, focus, saved-view switching, groups and notes are covered by unit tests that need no
WidgetTester. - The existing 52 widget tests under
test/features/erdpass unchanged (no loosened expectations). - No change in behaviour or look; hover and drag rebuild only what they rebuilt before (#1169, #1168).
Not in scope
- The minimap from #1362: there is no minimap in the product.
- The "under 300 lines" target of #1362: it no longer describes how the view is built.
Notes
Medium risk (31 fields shared by most handlers); do it as a few small PRs: controller first, canvas second. Low priority unless ERD work is planned.
- Ngôn ngữ chính
- Dart
- Star
- 23
- Fork
- 1
- Merge trung bình
- 31 phút
- Pull request đã merge (30 ngày)
- 570
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- 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 QueryaHub/Querya-Desktop
-
enhancement ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QueryaHub/Querya-Desktop#1689 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowĐang mởbug frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
QueryaHub/Querya-Desktop#1642 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug error-handling settings
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
QueryaHub/Querya-Desktop#1637 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
QueryaHub/Querya-Desktop#1636 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement marketplace
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
QueryaHub/Querya-Desktop#1635 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của QueryaHub/Querya-Desktop
Issue tương tự
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
chriskelly/wish-together#36 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Web Guide has broken linksĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
Paste asks for iOS paste permission because the default context menu ignores SystemContextMenuCó thể đã có người làm @dorklein đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
maheshj01/searchfield#267 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
avdept/JellyBoxPlayer#375 ·
Maintainer thường phản hồi trong vòng 1 ngày