CI / test (push) Canceled after 0s
## Summary epic r04 - begin refactor ## Change Type - [x] Cowork feature - [ ] Bug fix - [ ] Core AI contribution - [ ] Test / hardening - [ ] Performance - [ ] Documentation ## Related Work Cowork Task: Core Repo: http://34.143.229.138/gitea-admin/fsg-ai-core-assets Core AI Issue: Core Task: Related PR: ## Scope What is intentionally included? What is intentionally NOT included? ## Validation - [ ] Unit tests - [ ] Integration tests - [ ] Manual verification - [ ] Regression check Commands / evidence: ## Security Impact Permission / credential / network / customer data impact: ## Compatibility - [ ] No breaking change - [ ] Breaking change documented ## Reviewer Notes Anything Cowork reviewers should pay attention to. --------- Co-authored-by: Anh Tran Nguyen Minh <anhtnm1@fpt.com> Co-authored-by: Huong Le Thi Thien <huongltt35@fpt.com> Co-authored-by: Nam Pham Dinh Thanh <nampdt@fpt.com> Co-authored-by: Vu Dam Tuan <vudt15@fpt.com> Co-authored-by: Hiep Ha Van <hiephv3@fpt.com> Co-authored-by: Lam Hoang Van <lamhv7@fpt.com> Reviewed-on: #7 Co-authored-by: Duy Le Huu <duylh19@fpt.com>
38 KiB
38 KiB
Ban do tach file Co4ECanvas / _NodeItem / _EdgeItem (ui/co4e_canvas.py)
Gop tu 2 agent quet song song ui/co4e_canvas.py (701 dong).
- Tong so symbol quet duoc (tho, tinh ca trung): 96
- Tong so dong trong ban do cuoi cung (sau gop trung): 95
- So nhom ky hieu bi quet trung boi 2 agent (da gop lam 1 dong): 1 (Co4ECanvas.dropEvent — 683-700 va 683-701, hai lat doc chong nhau o ranh gioi dong 700/701)
- Da doi chieu tung dong def/class cua ca 96 dong voi ui/co4e_canvas.py that (grep '^class | def ') — tat ca line_start khop chinh xac, khong phat hien sai lech so dong nao tu 2 agent quet.
- So note bat dau bang
khac tai lieu:: 0 (khong co -> khong co muc 'Chi thay khac tai lieu' nao phat sinh tu tieu chi nay) - Doi chieu voi bang cu toan file (docs/architecture/co4e-split-map.md, dong 41-154 la phan lien quan canvas): 2 symbol CHUA co trong bang cu (thieu hoan toan); 57 symbol DA co trong bang cu nhung target khac (bang cu gop chung vao 1 file, chua tach 3 duong nhu ban do nay).
Quyet dinh gop trung: Co4ECanvas.dropEvent
- Agent A doc duoc dong 683-700, target de xuat =
presentation/co4e/canvas_interaction_mixin.py— ghi chu 'cat ngang lat, than try chua dong o dong 700, con tiep'. - Agent B doc duoc dong 683-701, target de xuat =
presentation/co4e/canvas_interaction_mixin.py— ghi chu 'chi dong 701 (e.acceptProposedAction()) nam trong lat duoc giao; dong 702 la dong trong cuoi file'. - Da doi chieu truc tiep voi
ui/co4e_canvas.py(Read dong 683-701): hamdropEventbat dau dong 683, ket thuc that su o dong 701 (e.acceptProposedAction());wc -lxac nhan file co dung 701 dong. - Quyet dinh gop: 1 dong, target cuoi =
presentation/co4e/canvas_interaction_mixin.py, dong 683-701. - Doi chieu voi bang cu: bang cu (
co4e-split-map.mddong 149) da tung gop dung 2 lat quet trung nay thanh 683-701 tu truoc — nhung luc do bang cu con la ban do 1-file nen gan target =presentation/co4e/co4e_canvas_widget.py. Ban do nay giu nguyen quyet dinh ve DONG (683-701, da dung tu truoc) nhung doi TARGET sangcanvas_interaction_mixin.pyvi day la mixin xu ly su kien keo-tha, khong phai du lieu do thi thuan.
Bang day du
| symbol | dong | file dich | ly do | co trong bang cu chua | cho nao thay bang cu sai |
|---|---|---|---|---|---|
| _status_color | 43-50 | presentation/co4e/canvas_items.py | đọc current_palette() từ theme.py — cần import theme trong file đích mới | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem | 59-210 | presentation/co4e/canvas_items.py | QGraphicsObject — cần QApplication để khởi tạo trong test; giữ self.canvas tham chiếu ngược Co4ECanvas (co4e_canvas_widget.py) — coupling hai chiều | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.init | 62-72 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.node | 64 | presentation/co4e/canvas_items.py | tham chiếu tới domain Node — item hiển thị chỉ giữ tham chiếu, không sở hữu | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.canvas | 65 | presentation/co4e/canvas_items.py | tham chiếu ngược Co4ECanvas (co4e_canvas_widget.py) — item gọi canvas._connect_from, canvas.begin_port_drag/update_port_drag/finish_port_drag (canvas_interaction_mixin.py), canvas._reposition_edges, canvas.graph_changed, canvas.node_selected/node_activated, canvas.add_step_below/begin_connect/delete_node — coupling xuyên 3 file | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.status | 66 | presentation/co4e/canvas_items.py | được set từ ngoài bởi Co4ECanvas.update_node_status/reset_statuses (co4e_canvas_widget.py) — trạng thái chia sẻ | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem._porting | 67 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.boundingRect | 74-76 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem._card_rect | 78-79 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.paint | 81-139 | presentation/co4e/canvas_items.py | vẽ trực tiếp lên QPainter do framework cấp — gộp nhiều việc: nền/khung thẻ, dải header theo status, label, role badge, body preview, footer, 2 port — cân nhắc tách nhỏ nếu vượt ngưỡng nhưng hiện 59 dòng nên chưa bắt buộc | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem._in_out_port | 141-143 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.itemChange | 145-156 | presentation/co4e/canvas_items.py | gọi self.canvas._reposition_edges/graph_changed.emit/node_selected.emit — trạng thái chia sẻ với co4e_canvas_widget.py | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.hoverMoveEvent | 158-161 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.mousePressEvent | 163-174 | presentation/co4e/canvas_items.py | đọc self.canvas._connect_from, gọi self.canvas.begin_port_drag — trạng thái/luồng chia sẻ với canvas_interaction_mixin.py | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.mouseMoveEvent | 176-181 | presentation/co4e/canvas_items.py | gọi self.canvas.update_port_drag — canvas_interaction_mixin.py | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.mouseReleaseEvent | 183-189 | presentation/co4e/canvas_items.py | gọi self.canvas.finish_port_drag — canvas_interaction_mixin.py | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.mouseDoubleClickEvent | 191-193 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.contextMenuEvent | 195-207 | presentation/co4e/canvas_items.py | gọi self.canvas.add_step_below/begin_connect (co4e_canvas_widget.py, canvas_interaction_mixin.py) và self.canvas.delete_node (co4e_canvas_widget.py) — coupling 3 file | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _NodeItem.center | 209-210 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem | 213-286 | presentation/co4e/canvas_items.py | QGraphicsPathItem — giữ self.canvas tham chiếu ngược Co4ECanvas | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.init | 214-225 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.edge | 216 | presentation/co4e/canvas_items.py | tham chiếu domain Edge | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.canvas | 217 | presentation/co4e/canvas_items.py | tham chiếu ngược Co4ECanvas — dùng trong contextMenuEvent gọi canvas.delete_edge (co4e_canvas_widget.py) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem._dst | 218 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem._hover | 224 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem._apply_pen | 227-235 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.update_path | 237-239 | presentation/co4e/canvas_items.py | gọi _rounded_path từ canvas_geometry.py — được gọi bởi Co4ECanvas._reposition_edges (co4e_canvas_widget.py) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.boundingRect | 241-242 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.shape | 244-249 | presentation/co4e/canvas_items.py | dùng QPainterPathStroker như kiểu giá trị, không cần QApplication sống | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.hoverEnterEvent | 251-255 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.hoverLeaveEvent | 257-261 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.paint | 263-279 | presentation/co4e/canvas_items.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| _EdgeItem.contextMenuEvent | 281-286 | presentation/co4e/canvas_items.py | gọi self.canvas.delete_edge — co4e_canvas_widget.py | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach _NodeItem/_EdgeItem/_status_color thanh file rieng). Ban do nay tach canvas_items.py vi day la QGraphicsObject/QGraphicsPathItem hien thi thuan, tach khoi Co4ECanvas (QGraphicsView) de giam kich thuoc file va tach lop 've' khoi lop 'dieu khien do thi'. |
| Co4ECanvas | 289-700 | presentation/co4e/co4e_canvas_widget.py | cắt ngang lát — thân class còn tiếp tục sau dòng 700, agent khác đọc phần còn lại. QGraphicsView — cần chia thành co4e_canvas_widget.py (dữ liệu đồ thị: load/add/delete/relayout) và canvas_interaction_mixin.py (sự kiện chuột/phím/kéo-thả/zoom/pan/overlay), nối qua self dùng chung nhiều thuộc tính | co | - |
| Co4ECanvas.node_selected | 290 | presentation/co4e/co4e_canvas_widget.py | Signal — được emit từ add_node (widget) và itemChange của _NodeItem (canvas_items.py) — API công khai xuyên file, callers ngoài (co4e_tab.py) kết nối vào | co | - |
| Co4ECanvas.node_activated | 291 | presentation/co4e/co4e_canvas_widget.py | Signal — emit từ _NodeItem.mouseDoubleClickEvent (canvas_items.py) | co | - |
| Co4ECanvas.graph_changed | 292 | presentation/co4e/co4e_canvas_widget.py | Signal — emit từ nhiều nơi cả widget (add_node/delete_node/relayout...) lẫn item (itemChange trong canvas_items.py) — điểm nối quan trọng giữa 2 file | co | - |
| Co4ECanvas._ZOOM_MIN | 294 | presentation/co4e/co4e_canvas_widget.py | hằng lớp dùng bởi _zoom_by trong canvas_interaction_mixin.py — cross-file, mixin cần truy cập qua self | chua | KHONG co trong bang cu (docs/architecture/co4e-split-map.md) — bang do nhay thang tu dong 292 (graph_changed) sang dong 296 (init), bo qua dong 294 (_ZOOM_MIN, _ZOOM_MAX) hoan toan. Day la thieu sot cua bang cu, khong phai sai target. |
| Co4ECanvas._ZOOM_MAX | 294 | presentation/co4e/co4e_canvas_widget.py | hằng lớp dùng bởi _zoom_by trong canvas_interaction_mixin.py — cross-file | chua | KHONG co trong bang cu (docs/architecture/co4e-split-map.md) — bang do nhay thang tu dong 292 (graph_changed) sang dong 296 (init), bo qua dong 294 (_ZOOM_MIN, _ZOOM_MAX) hoan toan. Day la thieu sot cua bang cu, khong phai sai target. |
| Co4ECanvas.init | 296-315 | presentation/co4e/co4e_canvas_widget.py | khởi tạo cả trạng thái đồ thị (self._scene/_nodes/_edges) LẪN trạng thái tương tác (self._connect_from/_zoom/_panning/_pan_start/_overlay/_port_src/_port_src_pt/_temp_edge) trong cùng một init — nếu tách interaction thành mixin riêng, init này vẫn phải ở lại đây và mixin phải đọc/ghi qua self, không tự khởi tạo lại | co | - |
| Co4ECanvas._scene | 299 | presentation/co4e/co4e_canvas_widget.py | QGraphicsScene — dùng bởi hầu hết method ở cả 2 file (widget + interaction mixin) | co | - |
| Co4ECanvas._nodes | 305 | presentation/co4e/co4e_canvas_widget.py | dict id->_NodeItem — trạng thái chia sẻ: đọc/ghi bởi cả co4e_canvas_widget.py (add_node/delete_node/load/relayout) và canvas_interaction_mixin.py (_node_at, keyPressEvent xoá selection) | co | - |
| Co4ECanvas._edges | 306 | presentation/co4e/co4e_canvas_widget.py | list _EdgeItem — trạng thái chia sẻ tương tự self._nodes | co | - |
| Co4ECanvas._connect_from | 307 | presentation/co4e/co4e_canvas_widget.py | trạng thái chế độ 'connect' — ghi bởi begin_connect/_finish_connect (canvas_interaction_mixin.py) và keyPressEvent (Escape, cùng file), đọc bởi _NodeItem.mousePressEvent (canvas_items.py) — coupling 3 file | co | - |
| Co4ECanvas._zoom | 308 | presentation/co4e/co4e_canvas_widget.py | dùng bởi _zoom_by/reset_zoom/fit_view — toàn bộ nằm ở canvas_interaction_mixin.py, chỉ khởi tạo ở đây | co | - |
| Co4ECanvas._panning | 309 | presentation/co4e/co4e_canvas_widget.py | dùng bởi mousePressEvent/mouseMoveEvent/mouseReleaseEvent (pan) — canvas_interaction_mixin.py | co | - |
| Co4ECanvas._pan_start | 310 | presentation/co4e/co4e_canvas_widget.py | canvas_interaction_mixin.py | co | - |
| Co4ECanvas._overlay | 311 | presentation/co4e/co4e_canvas_widget.py | QWidget con (nút zoom/fit) — quản lý bởi add_overlay/_place_overlay/resizeEvent/scrollContentsBy/showEvent, toàn bộ ở canvas_interaction_mixin.py | co | - |
| Co4ECanvas._port_src | 313 | presentation/co4e/co4e_canvas_widget.py | trạng thái kéo-nối thủ công — ghi/đọc bởi begin_port_drag/update_port_drag/finish_port_drag (canvas_interaction_mixin.py) và keyPressEvent (Escape huỷ, cùng file); _NodeItem (canvas_items.py) khởi phát qua self.canvas.begin_port_drag | co | - |
| Co4ECanvas._port_src_pt | 314 | presentation/co4e/co4e_canvas_widget.py | canvas_interaction_mixin.py | co | - |
| Co4ECanvas._temp_edge | 315 | presentation/co4e/co4e_canvas_widget.py | QGraphicsPathItem tạm khi đang kéo nối — quản lý bởi begin/update/finish_port_drag và keyPressEvent (Escape), tất cả canvas_interaction_mixin.py | co | - |
| Co4ECanvas.add_overlay | 318-323 | presentation/co4e/canvas_interaction_mixin.py | widget.setParent/show/raise_ — cần Qt sống | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas._place_overlay | 325-330 | presentation/co4e/canvas_interaction_mixin.py | đọc vp.height() — cần viewport thật | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.resizeEvent | 332-334 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.scrollContentsBy | 336-341 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.showEvent | 343-345 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.load | 348-362 | presentation/co4e/co4e_canvas_widget.py | reset toàn bộ self._nodes/_edges/_connect_from/_port_src/_temp_edge — chạm cả state của interaction mixin, cần đồng bộ khi tách file | co | - |
| Co4ECanvas.nodes | 364-365 | presentation/co4e/co4e_canvas_widget.py | (khong co ghi chu) | co | - |
| Co4ECanvas.edges | 367-368 | presentation/co4e/co4e_canvas_widget.py | (khong co ghi chu) | co | - |
| Co4ECanvas.add_node | 371-382 | presentation/co4e/co4e_canvas_widget.py | emit graph_changed và node_selected | co | - |
| Co4ECanvas.add_step_below | 384-390 | presentation/co4e/co4e_canvas_widget.py | (khong co ghi chu) | co | - |
| Co4ECanvas._chain_tail | 392-396 | presentation/co4e/co4e_canvas_widget.py | (khong co ghi chu) | co | - |
| Co4ECanvas.add_palette_step | 398-400 | presentation/co4e/co4e_canvas_widget.py | (khong co ghi chu) | co | - |
| Co4ECanvas.begin_connect | 402-403 | presentation/co4e/canvas_interaction_mixin.py | ghi self._connect_from — đọc bởi _NodeItem.mousePressEvent (canvas_items.py) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas._finish_connect | 405-409 | presentation/co4e/canvas_interaction_mixin.py | gọi self._make_edge (co4e_canvas_widget.py) — cross-file | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.begin_port_drag | 412-419 | presentation/co4e/canvas_interaction_mixin.py | tạo self._temp_edge, thêm vào self._scene — được _NodeItem.mousePressEvent (canvas_items.py) gọi qua self.canvas | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.update_port_drag | 421-424 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.finish_port_drag | 426-435 | presentation/co4e/canvas_interaction_mixin.py | gọi self._make_edge (co4e_canvas_widget.py) — cross-file | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas._node_at | 437-441 | presentation/co4e/canvas_interaction_mixin.py | duyệt self._scene.items — cần import _NodeItem từ canvas_items.py | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas._make_edge | 443-451 | presentation/co4e/co4e_canvas_widget.py | được gọi từ canvas_interaction_mixin.py (_finish_connect, finish_port_drag) — cross-file | co | - |
| Co4ECanvas._add_edge_item | 453-456 | presentation/co4e/co4e_canvas_widget.py | tạo _EdgeItem — cần import từ canvas_items.py | co | - |
| Co4ECanvas.delete_edge | 458-463 | presentation/co4e/co4e_canvas_widget.py | được gọi bởi _EdgeItem.contextMenuEvent (canvas_items.py) | co | - |
| Co4ECanvas.delete_node | 465-475 | presentation/co4e/co4e_canvas_widget.py | được gọi bởi _NodeItem.contextMenuEvent (canvas_items.py) | co | - |
| Co4ECanvas.delete_selected | 477-481 | presentation/co4e/co4e_canvas_widget.py | được gọi bởi keyPressEvent (canvas_interaction_mixin.py) — cross-file | co | - |
| Co4ECanvas._zoom_by | 484-495 | presentation/co4e/canvas_interaction_mixin.py | dùng self._ZOOM_MIN/_ZOOM_MAX định nghĩa ở class Co4ECanvas (co4e_canvas_widget.py) — cross-file qua self, ghi self._zoom | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.zoom_in | 497-498 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.zoom_out | 500-501 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.reset_zoom | 503-505 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.wheelEvent | 507-519 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.mousePressEvent | 522-529 | presentation/co4e/canvas_interaction_mixin.py | xử lý pan bằng chuột giữa — trùng tên method với _NodeItem.mousePressEvent (canvas_items.py) nhưng khác lớp, không xung đột thật nhưng dễ nhầm khi tách | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.mouseMoveEvent | 531-540 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.mouseReleaseEvent | 542-548 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.fit_view | 550-558 | presentation/co4e/canvas_interaction_mixin.py | fitInView phụ thuộc kích thước viewport thật | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.relayout | 560-578 | presentation/co4e/co4e_canvas_widget.py | gọi compute_waves (core/co4e.py) và self._reposition_edges — thuật toán xếp lớp thuần dữ liệu | co | - |
| Co4ECanvas.relayout_if_vertical | 580-589 | presentation/co4e/co4e_canvas_widget.py | (khong co ghi chu) | co | - |
| Co4ECanvas.add_workflow | 591-610 | presentation/co4e/co4e_canvas_widget.py | được dropEvent (canvas_interaction_mixin.py) gọi khi kéo thả cả workflow — cross-file | co | - |
| Co4ECanvas.update_node_status | 612-616 | presentation/co4e/co4e_canvas_widget.py | ghi _NodeItem.status (canvas_items.py) — cross-file | co | - |
| Co4ECanvas.reset_statuses | 618-621 | presentation/co4e/co4e_canvas_widget.py | (khong co ghi chu) | co | - |
| Co4ECanvas.refresh_node | 623-626 | presentation/co4e/co4e_canvas_widget.py | (khong co ghi chu) | co | - |
| Co4ECanvas._node_rects | 628-638 | presentation/co4e/co4e_canvas_widget.py | dùng QRectF như kiểu giá trị | co | - |
| Co4ECanvas._reposition_edges | 640-649 | presentation/co4e/co4e_canvas_widget.py | gọi _route từ canvas_geometry.py và e.update_path (_EdgeItem trong canvas_items.py) — cross-file | co | - |
| Co4ECanvas.keyPressEvent | 652-669 | presentation/co4e/canvas_interaction_mixin.py | Escape huỷ self._connect_from/self._temp_edge/self._port_src (khởi tạo ở init trong co4e_canvas_widget.py) — cross-file; Delete gọi self.delete_selected (co4e_canvas_widget.py) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.dragEnterEvent | 671-675 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.dragMoveEvent | 677-681 | presentation/co4e/canvas_interaction_mixin.py | (khong co ghi chu) | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
| Co4ECanvas.dropEvent | 683-701 | presentation/co4e/canvas_interaction_mixin.py | GOP 2 luot quet trung ky hieu: agent 1 doc duoc 683-700 (than try chua dong, cat ngang lat o ranh gioi doc 701-701), agent 2 doc duoc 683-701 (chi dong 701 e.acceptProposedAction() nam trong lat duoc giao, dong 702 la dong trong cuoi file). Doi chieu truc tiep voi ui/co4e_canvas.py xac nhan than ham thuc su ket thuc o dong 701 (701 dong tong cong ca file) -> chon 683-701. Xu ly drop tu sidebar: kind=='workflow' -> add_workflow, nguoc lai -> add_palette_step; import cuc bo workflow_from_dict/step_from_dict tu core/co4e.py; goi self.add_workflow/self.add_palette_step (co4e_canvas_widget.py) -> cross-file. Khong cham dia/mang, chi json.loads tu bytes mime trong bo nho. | co | Bang cu gop chung vao presentation/co4e/co4e_canvas_widget.py (chua tach nhom su kien chuot/phim/keo-tha/zoom/pan/overlay ra mixin rieng). Ban do nay tach canvas_interaction_mixin.py theo dung de xuat trong note cua chinh scan Co4ECanvas o bang cu (dong 90: 'can chia thanh co4e_canvas_widget.py ... va canvas_interaction_mixin.py'). |
Cho thay khac tai lieu — can nguoi quyet
Khong co symbol nao trong 96 dong quet mang note bat dau bang khac tai lieu: (da kiem bang script, dem duoc 0). Muc nay de trong theo dung yeu cau tu kiem; khong co gi can nguoi quyet tu tieu chi nay.
Tuy nhien co 2 nhom lech thuc te voi bang cu toan file, liet ke de nguoi soat bien:
- 2 symbol thieu hoan toan trong bang cu:
Co4ECanvas._ZOOM_MIN,Co4ECanvas._ZOOM_MAX(dong 294) — bang cu nhay tu dong 292 sang 296, bo sot hang class-constant nay. - 57 symbol co trong bang cu nhung target khac — bang cu (1-file) gop tat ca vao
presentation/co4e/co4e_canvas_widget.py; ban do nay tach thanh 3 file (canvas_items.pycho _NodeItem/_EdgeItem/_status_color,canvas_interaction_mixin.pycho nhom su kien chuot/phim/keo-tha/zoom/pan/overlay, phan con lai o laico4e_canvas_widget.py). Day la tach chi tiet hon, phu hop voi chinh ghi chu cua scan Co4ECanvas trong bang cu (dong 90) da de xuat huong tach nay.