refactor: split MainContent into per-concern hooks
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- react, typescript
調査の方向性
Start with src/components/layout/MainContent.tsx and choose one listed extraction: useEditorTabs(), useQueryExecution(), usePsqlSession() (around lines 580–700), or the toolbar component. Read the relevant state and call sites, then add a Vitest test for one path and run the TypeScript checks, tests, and build. Done means the extracted module owns its concern, the parent passes data through props, and app behavior remains unchanged.
索引モデルが issue の本文から書いたものです。
説明
src/components/layout/MainContent.tsx is 2,474 lines — by far the largest component in the app. It manages editor tabs, query execution, the integrated psql shell, results state, tool buttons, AI assist, compare/clone/definition modals, and history navigation. New contributors hit this file first and bounce.
What to extract
Any one of these is a complete, mergeable PR:
useEditorTabs()— tab state, switching, persistence, the+button.useQueryExecution()—executeQuery, the active execution state, cancellation, history-writing.usePsqlSession()— CLI path detection,\chandling,cliExecStmt, the psql output buffer. Roughly lines 580–700.<Toolbar>— the top button strip (Save, Format, Run, Tools, AI, Compare, Clone, etc.) as a sub-component.
Suggested approach
- Hooks live in
src/hooks/editor/(new directory). - Sub-components live next to
MainContent.tsx(src/components/layout/). - Aim to remove ~300–500 lines from MainContent.tsx per PR. Stop there; don't try to refactor everything in one shot.
Done criteria
- Behavior unchanged when running the app manually.
- The extracted hook/component is the only thing that owns its concern — the parent passes data down via props, not via in-line state.
- TypeScript clean, tests clean, build clean.
- Add a Vitest test exercising at least one path of the new module.
Out of scope
- Replacing Zustand with Redux/TanStack Query.
- Reworking the panel-resize layout.
- Touching the results grid logic (covered in a future ticket).
Audit reference
K2 in the pre-launch audit.
- 主要言語
- TypeScript
- スター
- 6
- フォーク
- 1
- 平均マージ
- 17分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openidle-dev/queryden のほかの issue
-
Multi Query Clusterオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
openidle-dev/queryden#240 ·
-
bug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openidle-dev/queryden#187 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
openidle-dev/queryden#237 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
openidle-dev/queryden#192 ·
-
dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
openidle-dev/queryden#186 ·
openidle-dev/queryden の issue をすべて見る
似ている issue
-
Mend: dependency security vulnerability
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
fdm-monster/fdm-monster#5563 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
growilabs/growi#12246 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
🐛 The Rulekeeper - An index run that gives up on the lock ends Succeeded対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SSWConsulting/SSW.Rules#2809 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
automated-triage type/bug type/ci
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信