Skip to content

refactor(ipc): split lib/ipc.ts into domain modules behind a barrel#700

Merged
appergb merged 1 commit into
betafrom
refactor/split-ipc-ts
Jun 17, 2026
Merged

refactor(ipc): split lib/ipc.ts into domain modules behind a barrel#700
appergb merged 1 commit into
betafrom
refactor/split-ipc-ts

Conversation

@appergb

@appergb appergb commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

User description

Summary

First of the #697 god-file splits. Pure, behavior-preserving reorganization of src/lib/ipc.ts (1765 lines, ~118 public exports) into a src/lib/ipc/ folder of 22 domain modules behind a barrel index.ts.

  • All original exports re-exported from the barrel → every consumer import … from '…/lib/ipc' resolves unchanged (0 consumer edits; 33 import sites verified).
  • Domains: dictation, asr-credentials, polish/settings, history, vocab, style-packs, hotkeys, permissions, devices, qa, less-computer, updater, remote-server, coding-agent, marketplace (+cache), github-oauth, plus shared invokeOrMock/Tauri helpers, mock-data, utils.
  • No logic/signature/name changes. Repo convention ("all backend calls go through lib/ipc") preserved — the barrel is lib/ipc.

Verification

  • export-name diff old→new: nothing dropped (118 old names all present).
  • npx tsc --noEmit: clean. npm run build: clean.

Part of #697 (split oversized modules). Frontend-only; no Rust/cfg changes.

🤖 Generated with Claude Code


PR Type

Enhancement


Description

  • Split monolithic src/lib/ipc.ts into 22 domain modules behind a barrel

  • All exports preserved; zero consumer edits required

  • Mock state mutation helpers centralized to avoid ES module binding issues


Diagram Walkthrough

flowchart LR
  old["src/lib/ipc.ts (1765 lines, 118 exports)"]
  new["src/lib/ipc/ directory"]
  old -- "split into 22 domain modules" --> new
  new --> index["barrel index.ts re-exports everything"]
  new --> mock["mock-data.ts: centralized mock helpers"]
  new --> shared["shared.ts: isTauri, invokeOrMock, platform capabilities"]
  new --> style["style-packs.ts"]
  new --> vocab["vocab.ts"]
  new --> history["history.ts"]
  new --> hotkeys["hotkeys.ts"]
  new --> marketplace["marketplace.ts"]
  new --> settings["settings.ts"]
  new --> dictation["dictation.ts"]
  new --> asr["asr-credentials.ts"]
  new --> permissions["permissions.ts"]
  new --> devices["devices.ts"]
  new --> updater["updater.ts"]
  new --> qa["qa.ts"]
  new --> lessComp["less-computer.ts"]
  new --> remote["remote-server.ts"]
  new --> github["github-oauth.ts"]
  new --> cache["marketplace-cache.ts"]
  new --> coding["coding-agent.ts"]
  new --> utils["utils.ts"]
  new --> plat["platform-exports.ts"]
Loading

File Walkthrough

Relevant files
Enhancement
19 files
index.ts
barrel re-exporting all public symbols                                     
+198/-0 
shared.ts
core Tauri detection and invokeOrMock                                       
+63/-0   
style-packs.ts
style pack CRUD and polish mode                                                   
+110/-0 
vocab.ts
vocabulary and correction rules                                                   
+81/-0   
history.ts
dictation history and audio recording                                       
+42/-0   
hotkeys.ts
hotkey status, capability, and bindings                                   
+81/-0   
marketplace.ts
marketplace listing and installation                                         
+84/-0   
settings.ts
user preferences retrieval and update                                       
+21/-0   
dictation.ts
start/stop/cancel dictation                                                           
+31/-0   
asr-credentials.ts
credential management and provider listing                             
+66/-0   
permissions.ts
microphone and accessibility permissions                                 
+48/-0   
devices.ts
network check and microphone devices                                         
+43/-0   
updater.ts
app update channel and version checks                                       
+81/-0   
qa.ts
QA window controls and hotkey                                                       
+29/-0   
less-computer.ts
Less Computer window dismiss and approve                                 
+27/-0   
remote-server.ts
remote input status and local IPs                                               
+31/-0   
github-oauth.ts
GitHub OAuth device flow                                                                 
+42/-0   
marketplace-cache.ts
localStorage cache for marketplace data                                   
+146/-0 
coding-agent.ts
Claude coding agent detection and test                                     
+69/-0   
Tests
1 files
mock-data.ts
centralized mock state and helpers                                             
+629/-0 
Additional files
3 files
ipc.ts +0/-1765
platform-exports.ts +9/-0     
utils.ts +49/-0   

… behavior unchanged

- Delete src/lib/ipc.ts (1765 lines)
- Create src/lib/ipc/ with 22 domain modules + barrel index.ts
- Barrel re-exports every symbol the old ipc.ts exported (same names, same signatures)
- All existing `import { ... } from '@/lib/ipc'` paths continue to resolve identically
- No logic changes, no signature changes, no renames
- Mock state mutation (mockSettings, mockStylePacks) centralised in mock-data.ts
  via exported helpers (mockSetSettings, mockSetDefaultPolishMode, etc.) to avoid
  ES module read-only binding violations
- TypeScript: zero errors (npx tsc --noEmit)
- Build: clean (npm run build)
@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

697 - Partially compliant

Compliant requirements:

  • Splits the file into domain modules under src/lib/ipc/ with a barrel index.ts.
  • Behavior-preserving: no logic changes, all exports preserved (verified by export-name diff).
  • All original exports are re-exported from barrel; consumer imports unchanged (verified with 33 import sites).
  • Passes tsc --noEmit and npm run build (verified in PR description).

Non-compliant requirements:

  • (Not applicable) The ticket mentions "pass cargo test (446)" but this PR only affects frontend TypeScript code; no Rust changes.

Requires further human verification:

  • All-platform CI results (e.g., Windows, macOS, Android) are not yet visible; human verification of CI status is needed.
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@appergb appergb merged commit b98e353 into beta Jun 17, 2026
5 checks 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