Skip to content

Extract noisy JSX/statement IIFEs (CL-5351 slice C) - #325

Merged
TheGreatAxios merged 2 commits into
mainfrom
cl-5351-iife-cleanup
Aug 5, 2026
Merged

Extract noisy JSX/statement IIFEs (CL-5351 slice C)#325
TheGreatAxios merged 2 commits into
mainfrom
cl-5351-iife-cleanup

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Slice C of CL-5351: behavior-preserving extraction of noisy JSX/statement IIFEs in the TUI.
  • Does not touch swallowed catches or React hook anti-patterns (other PRs).

IIFEs cleaned

Location Change
src/tui/app.tsx work/accept order Hoisted workBlock/acceptBlock/workAcceptBlocks above return
src/tui/app.tsx copy-mode window windowedCopyTargets helper + precomputed window slice
src/tui/components/chat-input.tsx action bar Extracted PromptActionBar component
src/tui/components/chat-input.tsx input border Hoisted renderInputLines + inputBody above return
src/tui/components/agent-modal.tsx re-auth hint showReauthHint boolean above return
src/tui/use-stream.ts manage_tasks parse Plain try/catch block (no IIFE)
src/tui/hooks/use-provider-manager.ts Shared persistWithMergeBase for catalog + tier disk writes

Intentional IIFEs left alone

Telemetry, OAuth completed, abort close, CRC table, and other fire-and-forget patterns outside this slice.

Test plan

  • bun run typecheck
  • bun test on use-provider-manager, chat-input (unit + component), copy (105 pass)

Closes nothing — partial progress on CL-5351.

@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

CL-5351

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Hard review (greybeard + CTO)

Verdict: APPROVE

Greybeard

Noisy JSX IIFEs extracted to named helpers/components; provider-manager persist deduped. Intentional fire-and-forget IIFEs left alone. Behavior-preserving refactor with typecheck + targeted tests green.

CTO

Surface area down, readability up. Merge independently of durability/hooks slices.

No blockers.

Behavior-preserving refactors only: hoist work/accept ordering and
copy-mode windowing in app.tsx, PromptActionBar + renderInputLines in
chat-input, re-auth hint boolean in agent-modal, plain manage_tasks
parse block in use-stream, and shared persistWithMergeBase for the two
provider-manager disk writes.
Collapse dual try/catch in persistWithMergeBase into one path, destructure
PromptActionBar props directly, and compute input lines once before the
bordered/plain body branch.
@TheGreatAxios
TheGreatAxios merged commit 6cc8104 into main Aug 5, 2026
1 check passed
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