Skip to content

refactor: composición tipada de Zustand (sin as never) - #87

Merged
IAnMove merged 1 commit into
mainfrom
refactor/typed-zustand-composition
Sep 2, 2026
Merged

refactor: composición tipada de Zustand (sin as never)#87
IAnMove merged 1 commit into
mainfrom
refactor/typed-zustand-composition

Conversation

@IAnMove

@IAnMove IAnMove commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Objetivo

PR de base tipada de Zustand, no una propiedad suelta.

  • bindSlice en ui/src/stores/storeApi.ts: las slices se componen sin as never en useStore
  • Settings agrupa el cajón y el hint de visibilidad de modelos (openModelVisibility)
  • developerModeSlice ya no escribe mediaFilter; la fachada sigue sacando el filtro auditdev al apagar el modo
  • Director/theme/sidebar/retake usan el mismo SliceCreator

Verificación local

  • npx tsc -b --pretty false
  • npm test: 492 passed
  • npm run lint -- --max-warnings=0
  • python scripts/architecture_contracts.py

Pendiente de CI. No mezclar hasta que los checks estén verdes.


Note

Medium Risk
Touches the central useStore composition path and moves cross-cutting behavior (auditdev filter reset) to the facade; behavior is covered by architecture tests but regressions would affect global UI state.

Overview
Introduces bindSlice and a shared SliceCreator type so useStore composes theme, settings, sidebar, retake, director, and developer-mode slices without as never at the merge site.

Settings now owns model-visibility focus (openModelVisibility / clearModelVisibilityFocus), moving that behavior out of the monolithic store body. Developer mode no longer updates mediaFilter inside its slice; the useStore facade still resets auditdev to all when developer mode is turned off.

Slice modules are aligned on the same factory pattern, and SLICE_QUEUE.md plus architecture tests document and lock in the new binding contract.

Reviewed by Cursor Bugbot for commit 7e65b26. Configure here.

…ther

Settings owns model-visibility focus. Developer mode no longer writes
mediaFilter; the facade still leaves the auditdev gallery filter.
@IAnMove

IAnMove commented Sep 2, 2026

Copy link
Copy Markdown
Owner Author

@cursor review

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: low
Scope: 10 file(s); +133/-134; React UI, docs

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

Findings

  • 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: ui/src/stores/storeApi.ts
  • modified: docs/development/SLICE_QUEUE.md, ui/src/stores/developerModeSlice.ts, ui/src/stores/directorSlice.ts, ui/src/stores/retakeDialogSlice.ts, ui/src/stores/settingsSlice.ts, ui/src/stores/sidebarSlice.ts, ui/src/stores/themeSlice.ts, ui/src/stores/useStore.ts, ui/tests/architectureSlices.test.mjs

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.

@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 7e65b26. Configure here.

@IAnMove
IAnMove merged commit cf5251f into main Sep 2, 2026
5 checks passed
@IAnMove
IAnMove deleted the refactor/typed-zustand-composition branch September 5, 2026 11:54
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