Skip to content

ThreadView: extract nine custom hooks into src/components/thread/ (#1447 pass J) - #1461

Merged
currentbits merged 10 commits into
mainfrom
coder/refactor-j-threadview-hooks-6661f8
Oct 5, 2026
Merged

currentbits merged 10 commits into
mainfrom
coder/refactor-j-threadview-hooks-6661f8

Conversation

@currentbits

Copy link
Copy Markdown
Owner

Round 4, pass J of #1447. This extracts nine custom hooks from the ThreadView component body into src/components/thread/. The hook map, extraction order and reasoning are in docs/superpowers/specs/2026-10-05-threadview-split.md.

Hook Lines Concern
useStickToBottom 181 transcript autoscroll / stick-to-bottom (#607, #408, #83)
useTranscriptAnnotations 186 transcript annotation memos
useAppSnap 159 AppSnap and the browser screenshot hand-off (#1206)
useQueuedEdit 156 editing queued follow-ups
usePaneLayoutActions 113 pane layout actions (state stays in the component)
useRetryAnchors 87 failure/retry anchors
useHeaderGitStatus 72 header git attention and details-card git status
useCiteShortcut 54 cite shortcut
useCliCommands 46 CLI slash command list

ThreadView.tsx: 5,042 → 4,369 lines.

Left in place on purpose: render-phase window/seen-key state, notes and pins, the thread-switch reset effect, the header popovers, and rewind/run stats. Their hooks are interleaved with other concerns, or the switch effect writes into all of them. Moving them would reorder declarations or effects, which is a behaviour change. The reasons are in the spec, under "Left in place".

Checked

  • Effect order: a script lists every useEffect/useLayoutEffect in the original component in order. It lists the new component the same way, with each custom-hook call expanded into the hook's own effects. Both give the same 22 effects, with the same kind and opening line, in the same sequence.
  • Pure move, ignoring indentation: the only non-move lines are hook calls, returns, and parameter types.
  • Screenshots against main (demo renderer, timers frozen):
  • npm run typecheck and npx vite build are clean. Full renderer suite: 2,656 passed, 0 failed, 3 test files cancelled. The machine was at load 42 with two other suites running, and those three files (agentsCollapse, appWiring, composer) plus threadView pass 283/283 on their own.

🤖 Generated with Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit 199f0ac into main Oct 5, 2026
6 checks passed
@currentbits
currentbits deleted the coder/refactor-j-threadview-hooks-6661f8 branch October 5, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant