refactor: split MainContent into per-concern hooks
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- react, typescript
- Ambito
- desktop, developer-experience, frontend
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 6
- Fork
- 1
- Merge medio
- 17m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openidle-dev/queryden
-
Multi Query ClusterAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
openidle-dev/queryden#240 ·
-
bug enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
openidle-dev/queryden#187 ·
-
Refresh database listAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
openidle-dev/queryden#237 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
openidle-dev/queryden#192 ·
-
dependencies
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
openidle-dev/queryden#186 ·
Tutte le issue di openidle-dev/queryden
Issue simili
-
Mend: dependency security vulnerability
Difficoltà 1/5 1-3 ore Idoneità per principianti 65/100
fdm-monster/fdm-monster#5563 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
growilabs/growi#12246 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
🐛 The Rulekeeper - An index run that gives up on the lock ends SucceededForse già presa @github-actions l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SSWConsulting/SSW.Rules#2809 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
automated-triage type/bug type/ci
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno