Skip to content

refactor(screens): extract agent-transcript bootstrap effect (audit 1.1.1 slice #36) - #209

Merged
dahai80 merged 1 commit into
mainfrom
refactor/slice36-agent-transcript-bootstrap
Aug 29, 2026
Merged

dahai80 merged 1 commit into
mainfrom
refactor/slice36-agent-transcript-bootstrap

Conversation

@dahai80

@dahai80 dahai80 commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Audit §1.1.1 god-module split — slice #36 of REPL.tsx (#170).

Change

Extract REPL.tsx agent-transcript disk-load bootstrap useEffect body (26 LOC) to src/screens/agentTranscriptBootstrap.ts applyAgentTranscriptBootstrap(ctx).

  • Class: PURE-ASYNC-HELPER (2nd instance — like slice feat: LSP 能力暴露 — 代码智能节点支持 #23 onInit / feat: integrate fusion-plugins-ecosystem as MCP tool provider #31 initialMessage)
  • Closure deps: 3 (viewingAgentTaskId, needsBootstrap guard stays in REPL thin shell, setAppState)
  • Imports: getAgentTranscript/asAgentId/isLocalAgentTask imported directly in new file (not via ctx)
  • Import cleanup: getAgentTranscript (sole-user) + asAgentId (sole-user) removed from REPL; isLocalAgentTask kept (2 residual uses)
  • Byte-identical: body preserved verbatim, taskId alias captured in helper, deps array unchanged

Verification

  • bun run typecheck — 0 errors
  • bun test src/__tests__/ — 921 pass / 0 fail
  • bunx biome check on new file only (REPL untouched by formatter) — clean
  • bun run build:dev — passes

REPL 5682 → 5658 (−24 this slice, −1438 cumulative 7096→5658).

Co-Authored-By: Claude Fable 5 [email protected]

….1.1 slice #36)

REPL.tsx agent-transcript disk-load bootstrap useEffect body (26 LOC,
PURE-ASYNC-HELPER class, 2nd — like slice #23 onInit / #31 initialMessage)
extracted to src/screens/agentTranscriptBootstrap.ts
applyAgentTranscriptBootstrap(ctx). 3 closure deps (viewingAgentTaskId,
needsBootstrap, setAppState); guard stays in REPL thin shell. 2 now-dead
imports removed from REPL (getAgentTranscript sole-user, asAgentId
sole-user; isLocalAgentTask kept — 2 residual uses). Byte-identical
behavior; gates 0/921/new-file-clean/build:dev.

Co-Authored-By: Claude Fable 5 <[email protected]>
@dahai80
dahai80 merged commit c4fb0a4 into main Aug 29, 2026
1 check passed
@dahai80
dahai80 deleted the refactor/slice36-agent-transcript-bootstrap branch August 29, 2026 16:43
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