Repository navigation
useCoder: split into 12 domain sub-hooks under src/coder/ (#1447 pass I) - #1462
Merged
currentbits merged 14 commits intoOct 5, 2026
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…1447) Verbatim move of the contiguous searchMemory..loadCodeMap block; the sub-hook is called where the block was, so the flattened hook order is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…useCoderAgentTools (#1447) Verbatim move of the contiguous lintAgentConfig..listCliSessions block, called where the block was. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…CoderInsights (#1447) Verbatim move of the contiguous listActivity..crewIntegration block, called where the block was. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… into useCoderRepoTools (#1447) Verbatim move of the contiguous gitSyncInfo..terminal block, called where the block was. setSpotlight's setProjects is now a parameter; it is the same stable setter, so its [api] deps keep their meaning. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Verbatim move of the contiguous addProject..updateProject block, called where the block was. errorMessage moves verbatim to src/coder/errorMessage.ts (gains only `export`) so sub-hooks can share it without importing useCoder. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Verbatim move of the contiguous failUpdate..downloadUpdate block, called where the block was. failUpdate stays internal to the sub-hook. The hourly check effect and UPDATE_CHECK_INTERVAL_MS stay in useCoder.ts: test/updateCheck.test.tsx reads that file's source for the interval. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…useCoderWorkflows (#1447) Verbatim move of the contiguous refreshWorkflows..removeWorkflow block (it includes startWorkflowRun/retryWorkflowAgent, which sat between the template and automation callbacks), called where the block was. upsertWorkflow moves with its only caller. Inputs are the same values the closures read before; deps arrays are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ub (#1447) Verbatim move of the contiguous pushBranch..fetchIssue block, called where the block was. Inputs are the same values the closures read before (stable setters, refs, applyThreads/applyThreadUpdate, and selectedThreadId); deps arrays are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…oderWorkspace (#1447) Verbatim move of the contiguous listBaseBranches..dropAttachmentFiles block, called where the block was; saveAttachmentFile stays internal to the sub-hook (it was never returned). The web attachment helpers move verbatim to src/coder/webAttachments.ts; the three the sub-hook calls gain `export`. None were exported from useCoder.ts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ions (#1447) Verbatim move of the contiguous stopRun..requestTeachReview block (39 useCallbacks, no effects), called where the block was. Inputs are the same values the closures read before (stable setters, refs, applyThreads, and selectedThreadId); deps arrays are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nto useCoderRuns (#1447) Verbatim move of the contiguous createThread..rewindAndResubmit block, called where the block was. projects, settings and selectedProjectId are passed as the same per-render values createThread's deps listed, so its identity changes on exactly the same renders as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ject into useCoderThreadRemoval (#1447) Verbatim move of the contiguous deleteThread..removeProject block, called where the block was. refreshTrashed and applyThreads are passed in; both keep their identities (deps [api] and []), so these callbacks' deps keep their meaning. applyThreadUpdate stays in useCoder: three sub-hooks take it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…#1447) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Closed
4 tasks
currentbits
deleted the
coder/refactor-i-split-usecoder-into-sub-hooks-32bffe
branch
October 5, 2026 11:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Round 4, pass I of #1447.
useCoderwas one ~3,500-line hook holding all renderer-side app state. Its domain logic now lives in 12 sub-hooks undersrc/coder/, whichuseCodercomposes. The state map, domains and reasoning are indocs/superpowers/specs/2026-10-05-usecoder-split.md.useCoderThreadActionsuseCoderWorkspaceuseCoderRunsuseCoderGitHubuseCoderAgentToolsuseCoderWorkflowsuseCoderRepoToolsuseCoderThreadRemovaluseCoderMemoryuseCoderProjectsuseCoderUpdatesuseCoderInsightsTwo plain modules,
webAttachments.tsanderrorMessage.ts, hold the non-hook helpers.src/useCoder.ts: 4,510 → 2,119 lines.What stays in
useCoder:selectedRefupdating before the detail-load effect reads it.Checked
useCallback/useMemogroups only. A script compares the original and the newuseCoderwith each sub-hook expanded at its call site. Both give the same 8 effects in the same order.useCoder's return object has the same 220 keys as main, with no spreads.npm run typecheckandnpx vite buildare clean. Renderer suite: 2701/2701, 0 cancelled (TAP count).🤖 Generated with Claude Code