refactor(erd): extract ErdViewController and ErdCanvas from _ErdViewState
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 45/100
- Type d'issue
- Refactorisation
- Clarté
- Clairement spécifiée
- Activité
- Active
- Domaine
- desktop, developer-experience
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Dart
- Étoiles
- 23
- Forks
- 1
- Merge moyen
- 31 min
- PR mergées (30 j)
- 570
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de QueryaHub/Querya-Desktop
-
enhancement ui
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
QueryaHub/Querya-Desktop#1689 ·
Les mainteneurs répondent en général sous 1 jour
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowOuvertebug frontend
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
QueryaHub/Querya-Desktop#1642 ·
Les mainteneurs répondent en général sous 1 jour
-
bug error-handling settings
Difficulté 1/5 1-3 heures Accessibilité débutants 78/100
QueryaHub/Querya-Desktop#1637 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
QueryaHub/Querya-Desktop#1636 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement marketplace
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
QueryaHub/Querya-Desktop#1635 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de QueryaHub/Querya-Desktop
Issues similaires
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
0niel/university-app#617 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
linagora/tmail-flutter#5010 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 65/100
chriskelly/wish-together#36 ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug] Web Guide has broken linksOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
AppFlowy-IO/AppFlowy#9075 ·