Split oversized monolith source files#164
Conversation
Review Summary by QodoSplit oversized monolith source files into focused modules
WalkthroughsDescription• Split oversized Vue SFCs and TypeScript monoliths into focused, modular files • Extracted 28+ helper modules covering desktop state management, server operations, API gateways, and UI components • Reduced largest source files from 3000+ lines to under 3000 lines (App.vue: 2993, useDesktopStateCore.mts: 2985, codexAppServerBridge.ts: 2973, ThreadConversation.vue: 2956, SidebarThreadTree.vue: 2945, codexGateway.ts: 2935) • Key extractions include thread helpers, session recovery, notification readers, app server process management, review/directory normalization, inline payload sanitization, and storage management • Maintained runtime behavior and build performance; frontend build succeeds with no new warnings • All 60 unit tests pass across 11 test files • Verified with pnpm run build:frontend, pnpm run test:unit, and pnpm run build:cli Diagramflowchart LR
Monolith["Oversized Source Files<br/>3000+ lines"] -->|Extract Thread Logic| ThreadHelpers["desktopStateThreadHelpers.ts<br/>846 lines"]
Monolith -->|Extract Server Ops| ServerModules["sessionRecovery.ts<br/>appServerProcess.ts<br/>threadInlinePayloads.ts"]
Monolith -->|Extract API Logic| GatewayModules["codexGatewayReview.ts<br/>codexGatewayDirectory.ts<br/>codexGatewayTerminal.ts"]
Monolith -->|Extract UI State| StateModules["desktopStateStorage.ts<br/>globalStateStore.ts"]
Monolith -->|Extract Component Styles| StyleFiles["SidebarThreadTree.scoped.css<br/>App.scoped.css<br/>ThreadConversation.scoped.css"]
ThreadHelpers --> Result["Refactored Codebase<br/>All files < 3000 lines"]
ServerModules --> Result
GatewayModules --> Result
StateModules --> Result
StyleFiles --> Result
File Changes1. src/composables/desktopStateThreadHelpers.ts
|
Code Review by Qodo
1. Inline payload missing theme steps
|
| ### Server inline payload helper split | ||
|
|
||
| #### Feature/Change Name | ||
| Codex bridge inline payload and session-skill recovery extraction. | ||
|
|
||
| #### Prerequisites/Setup | ||
| 1. Dependencies installed with `pnpm install` | ||
| 2. Existing Codex session fixtures covered by the server bridge unit tests | ||
|
|
||
| #### Steps | ||
| 1. Run `pnpm run test:unit -- src/server/codexAppServerBridge.inlinePayload.test.ts src/server/codexAppServerBridge.archive.test.ts`. | ||
| 2. Run `pnpm run build:cli`. | ||
| 3. Manually open a thread that contains generated/inline image or file payload content. | ||
| 4. Confirm inline media still renders through local proxy URLs instead of huge inline payloads. | ||
| 5. Open a thread whose user message used skills and confirm skill chips remain associated with the correct turn. | ||
|
|
||
| #### Expected Results | ||
| - Inline payload sanitization tests pass. | ||
| - Archive recovery tests continue to pass through the bridge re-export. | ||
| - CLI build succeeds with the extracted server module. | ||
| - Session skill inputs and local inline-media proxying behave the same after extraction. |
There was a problem hiding this comment.
1. Inline payload missing theme steps 📘 Rule violation ⚙ Maintainability
The new Server inline payload helper split section instructs manual UI verification (inline media rendering, skill chips) but does not include required light-theme and dark-theme steps/results. This makes the manual test instructions incomplete per the checklist requirements for UI changes.
Agent Prompt
## Issue description
The `Server inline payload helper split` manual test section includes UI verification steps but omits required light-theme and dark-theme verification steps/results.
## Issue Context
PR Compliance requires that any new/updated `tests.md` feature section covering UI behavior includes both light and dark theme checks.
## Fix Focus Areas
- tests.md[361-385]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
Size check
Largest scanned source files now:
Scan included
*.ts,*.tsx,*.mts,*.cts,*.js,*.jsx,*.mjs,*.cjs,*.svelte, and*.vue, excluding dependency/build/output folders.Verification
pnpm run build:frontendpnpm run test:unit-> 11 files, 60 tests passedpnpm run build:cliPerformance audit
indexchunk warning around 501 kB; the refactor keeps runtime behavior split-equivalent and does not add request paths or polling work.