Summary
CodeEditorPanel.tsx manages three separate Monaco decoration types inline (active-line decorations, step badges, block highlights) via three useEffect blocks. Extracting these into a single custom hook would significantly simplify the component.
Task
Create:
packages/gui/src/renderer/hooks/useMonacoDecorations.ts
Signature:
export const useMonacoDecorations = (
editorRef: React.RefObject<MonacoEditorNS.IStandaloneCodeEditor | null>,
monacoRef: React.RefObject<Monaco | null>,
decorations: LineDecoration[] | undefined,
stepBadges: StepBadge[] | undefined,
blockHighlights: BlockHighlight[] | undefined,
): void
The hook owns all three deltaDecorations refs and effects. CodeEditorPanel calls it once.
Acceptance
- Same visual behaviour — no decoration regressions
CodeEditorPanel.tsx drops ~80 lines
- Hook has TSDoc block
- Types pass (
pnpm typecheck)
Summary
CodeEditorPanel.tsxmanages three separate Monaco decoration types inline (active-line decorations, step badges, block highlights) via threeuseEffectblocks. Extracting these into a single custom hook would significantly simplify the component.Task
Create:
Signature:
The hook owns all three
deltaDecorationsrefs and effects.CodeEditorPanelcalls it once.Acceptance
CodeEditorPanel.tsxdrops ~80 linespnpm typecheck)