Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

refactor(erd): extract ErdViewController and ErdCanvas from _ErdViewState

オープン
#1,690 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
dart, flutter

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

enhancement

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), the InteractiveViewer in build.
  • 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
  1. ErdViewController (a ChangeNotifier, no widget imports) owns selection, focus, search state, saved views, groups and notes. The pure operations that already live in core/erd (erd_group_ops, erd_note_ops, erd_saved_layout) stay there and are called from it.
  2. ErdCanvas widget owns the InteractiveViewer, scale / fit / tap / hover and the drag of cards.
  3. _ErdViewState composes the two with the toolbar, menus and dialogs.
Acceptance
  • erd_view.dart is at most ~900 lines, and build is 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/erd pass 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.

主要言語
Dart
スター
23
フォーク
1
平均マージ
31分
マージ済み PR(30日)
570

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

QueryaHub/Querya-Desktop のほかの issue

QueryaHub/Querya-Desktop の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。