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

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

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
静か
技術スタック
electron, react, typescript

調査の方向性

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.

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

説明

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
主要言語
TypeScript
スター
1k
フォーク
144
平均マージ
4日 19時間
マージ済み PR(30日)
28

環境構築

はじめの一歩

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

johannesjo/parallel-code のほかの issue

johannesjo/parallel-code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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