Skip to content

refactor: split the HTTP client into slice modules with a reexport facade - #33

Merged
IAnMove merged 1 commit into
mainfrom
refactor/api-client-slices
Sep 1, 2026
Merged

refactor: split the HTTP client into slice modules with a reexport facade#33
IAnMove merged 1 commit into
mainfrom
refactor/api-client-slices

Conversation

@IAnMove

@IAnMove IAnMove commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Alcance

Paso 4.client del plan canónico.

  • ui/src/api/client.ts queda como fachada pública (export * de cada slice).
  • Implementaciones en ui/src/api/<slice>.ts (generation, stories, director, series, comics, llm, etc.).
  • Firmas, paths HTTP, payloads y respuestas sin cambio de contrato.
  • ui/README.md conserva el literal src/api/client.ts.
  • Tests Python que leían el fuente de client.ts ahora leen la superficie ui/src/api/*.ts.

No mezcla stores, Story JSX, Wizard ni features. No toca _launch_runtime.py ni director_pipeline.py.

Tests locales

  • pytest de tests afectados → 283 passed
  • npm run check (test, lint max-warnings=0, tsc+build, budget) → PASS
  • npm run test:e2e → 2 passed
  • scripts/check_documentation_links.py → PASS

Independencia

Ningún PR abierto tocaba client.ts. Este PR no comparte hotspot con el muro WanGP ni con el gate 6.a. No mezclar.


Note

Low Risk
Refactor-only HTTP client organization with contract tests updated; no backend or runtime API contract changes described in the diff.

Overview
Splits the typed HTTP boundary from a single client.ts into domain slice modules under ui/src/api/ (generation, stories, director, characters, etc.), with client.ts kept as the public facade via export * re-exports so callers still import from one entry.

Adds tests/api_client_source.py, which concatenates sorted ui/src/api/*.ts sources. Python source-contract tests that previously read only client.ts now use this helper so assertions still cover the full client surface after the split.

Documents the layout in ui/README.md: slice modules sit beside client.ts and are re-exported from it. HTTP paths, payloads, and function names are intended to stay unchanged—this is structural refactor plus test harness alignment, not an API behavior change.

Reviewed by Cursor Bugbot for commit c137696. Configure here.

…cade

Paso 4.client. Implementations move to ui/src/api/<slice>.ts. client.ts
keeps the public import path and reexports every slice. Signatures, paths
and payloads are unchanged. ui/README.md still contains src/api/client.ts.
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: high
Scope: 31 file(s); +5330/-5239; React UI

Automated review from scripts/analyze_pr.py. This is a heuristic pass (no LLM) so humans still own the merge decision.

Findings

  • high — Local-first policy risk (ui/src/api/system.ts)
    ui/src/api/system.ts: possible telemetry / phone-home. The app must stay local-first; telemetry is opt-in only.
  • medium — Large pull request
    5330 additions / 5239 deletions. Reviewers will have an easier time with smaller, focused PRs.
  • medium — Very large file change (ui/src/api/director.ts)
    ui/src/api/director.ts adds 904 lines. Consider splitting the PR.
  • medium — Very large file change (ui/src/api/generation.ts)
    ui/src/api/generation.ts adds 847 lines. Consider splitting the PR.
  • medium — Very large file change (ui/src/api/loras.ts)
    ui/src/api/loras.ts adds 460 lines. Consider splitting the PR.
  • medium — Very large file change (ui/src/api/series.ts)
    ui/src/api/series.ts adds 475 lines. Consider splitting the PR.
  • medium — Very large file change (ui/src/api/stories.ts)
    ui/src/api/stories.ts adds 578 lines. Consider splitting the PR.
  • low — UI changed — rebuild before merge
    Run cd ui && npm run build (CI already does this). Pinokio Update rebuilds for end users; keep ui/dist untracked.

Changed files

  • added: tests/api_client_source.py, ui/src/api/characters.ts, ui/src/api/comics.ts, ui/src/api/director.ts, ui/src/api/generation.ts, ui/src/api/http.ts, ui/src/api/llm.ts, ui/src/api/loras.ts, ui/src/api/model3d.ts, ui/src/api/outputs.ts, ui/src/api/recipes.ts, ui/src/api/series.ts, ui/src/api/stories.ts, ui/src/api/styles.ts, ui/src/api/system.ts, ui/src/api/tasks.ts, ui/src/api/video-editor.ts, ui/src/api/video3d.ts, ui/src/api/wizard.ts, ui/src/api/workspaces.ts
    … and 1 more
  • modified: tests/test_activity_generation_details.py, tests/test_director_model_compat.py, tests/test_model_selection_persistence.py, tests/test_phase1_issue_fixes.py, tests/test_scail2_workflows.py, tests/test_series_lab_ui.py, tests/test_story_lab_audio_ui.py, tests/test_story_montage_clip_history_ui.py, ui/README.md, ui/src/api/client.ts

CONTRIBUTING checklist

  • python scripts/verify_clean_repo.py
  • python -m compileall -q app/services app/launch.py scripts
  • cd ui && npm run build if the UI changed
  • No weights, CivitAI sidecars, or generated guides
  • Stays local-first (no required accounts / telemetry)

Posted by the repo PR review workflow. Re-runs on each push to the PR.

@IAnMove

IAnMove commented Sep 1, 2026

Copy link
Copy Markdown
Owner Author

cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c137696. Configure here.

@IAnMove
IAnMove merged commit 79dad74 into main Sep 1, 2026
5 checks passed
@IAnMove
IAnMove deleted the refactor/api-client-slices branch September 5, 2026 11:55
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