Remove unnecessary React hooks (CL-5351 slice B) - #324
Merged
Conversation
2 tasks
Collaborator
Author
Hard review (greybeard + CTO)Verdict: APPROVE GreybeardDual-state queue depth removed; external-value cursor adjust is render-time (supported React pattern); plugins clear at call sites; message-pipeline load is cancellable. Net fewer effects, same behavior. CTOClean slice B of CL-5351. Merge after or with the other 5351 slices; no product coupling. No blockers. |
Derive permission queue depth from queuedApprovals, adjust cursor and Work-panel expansion during render, clear path suggestions at exit sites, sync refs without effects, and cancel stale sent-history loads. CL-5351 slice B.
Drop redundant `state` from use-stream effect/memo deps (the store object is identity-stable). Document that telemetry and wait-for-approval local state is seeded once from runner props; live updates go through setters and onChange callbacks, not a prop sync effect. CL-5351 slice B polish.
Share a generation counter between the hydrate effect and startNewSession so a late loadSentMessages cannot overwrite browse after a newer session load has already started.
TheGreatAxios
force-pushed
the
cl-5351-react-hooks
branch
from
August 5, 2026 06:18
df028aa to
41481f5
Compare
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.
Summary
permissionQueueDepthfromqueuedApprovals.length(one source of truth)setAddingPath(null)exit sitesloadSentMessagesloads on session switch/unmountPart of CL-5351 high-priority React hooks cleanup (PR B of the suggested split). Event-log
maxOffset/offset-ref items were already fixed on main.Test plan
bun run typecheckbun test src/tui/hooks/use-gates.test.ts tests/unit/tui/use-gates.test.tsx tests/unit/tui/chat-input.test.tsxbun test src/tui/components/chat-input.test.ts src/tui/components/event-log.test.tsCloses nothing alone — tracks https://linear.app/abklabs/issue/CL-5351