[Quality audit] Reduce frontend, store, and shared-lib duplication

Aperta
#160 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 4 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
electron, react, typescript

Direzione di ricerca

Start with the local audit report CODE_QUALITY_FINDINGS.md and the listed evidence files, then review the affected component, store, keybinding, and custom-theme tests. Run the acceptance checks, including npm run typecheck and focused UI smoke checks. Done means addressing the scoped findings while preserving the stated behaviors and passing the relevant checks.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Derived from the local audit report CODE_QUALITY_FINDINGS.md created on 2026-05-30.

Scope

This issue groups renderer, store, and shared-library simplification opportunities.

Findings

  • Finding 6: shortcut matching is duplicated and semantically inconsistent.
    • Evidence: src/lib/shortcuts.ts, src/lib/keybindings/match.ts, src/lib/keybindings/resolve.ts.
    • Fix direction: store app shortcuts as KeyBinding-shaped records and share modifier normalization/matching.
  • Finding 20: prompt detection is duplicated between main and renderer.
    • Evidence: electron/mcp/prompt-detect.ts, src/store/taskStatus.ts.
    • Fix direction: move shared prompt detection to an importable pure helper.
  • Finding 21: diff review duplicates ReviewProvider state and flow.
    • Evidence: src/components/ReviewProvider.tsx, src/components/ScrollingDiffView.tsx.
    • Fix direction: route diff selection through a shared provider/hook path.
  • Finding 22: ScrollingDiffView has two hidden-context implementations.
    • Evidence: GapView and TrailingGap duplicate content fetching, context construction, highlighting, rendering, and expansion.
    • Fix direction: extract a shared context-line loader/expander.
  • Finding 23: SettingsDialog theme grids are duplicated.
    • Fix direction: extract ThemeGrid(slot), PresetThemeCard, and CustomThemeCard.
  • Finding 24: SettingsDialog repeats checkbox/card setting rows.
    • Fix direction: extract SettingsCheckboxRow and a small SettingsSection wrapper.
  • Finding 25: Sidebar repeats task row chrome.
    • Fix direction: extract TaskRowShell, DirectBranchBadge, and shared attention/focus style helpers.
  • Finding 26: NewTaskDialog carries reusable option UI inline.
    • Fix direction: extract CheckboxOption, InlineBanner, DockerTaskOptions, and CoordinatorTaskOptions.
  • Finding 27: task/agent record construction is duplicated in store.
    • Fix direction: extract createAgentRecord(...) and base task builders.
  • Finding 28: task deletion and active-neighbor selection are duplicated.
    • Fix direction: extract pure draft cleanup primitives and neighbor-selection helpers while preserving lifecycle differences.
  • Finding 29: base64 terminal decoding is duplicated.
    • Fix direction: move decoder to a shared utility used by desktop and remote terminal views.
  • Finding 31: keybinding override resolution is duplicated.
    • Fix direction: extract resolveOneBinding; keep exports focused on inclusion of unbound rows.
  • Finding 32: light terminal theme palette is copied twice.
    • Fix direction: extract LIGHT_TERMINAL_THEME.
  • Finding 33: custom theme parsing/validation repeats primitives.
    • Fix direction: extract isHexTerminalBackground, collectAllowedVars, and formatVarLines while preserving current validation behavior unless intentionally changed.
  • Finding 34: Electron window wrapper retains no-op compatibility methods.
    • Fix direction: remove no-op methods and call-site awaits/catches if no supported platform behavior remains.

Acceptance checks

  • affected component tests
  • store tests
  • keybinding and custom-theme tests
  • npm run typecheck
  • focused browser/UI smoke checks for touched flows
Lingua principale
TypeScript
Stelle
1k
Fork
144
Merge medio
4g 19h
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di johannesjo/parallel-code

Tutte le issue di johannesjo/parallel-code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.