Skip to content

refactor: extract the developer-mode slice from useStore - #75

Merged
IAnMove merged 1 commit into
mainfrom
refactor/usestore-developer-mode-slice
Sep 2, 2026
Merged

refactor: extract the developer-mode slice from useStore#75
IAnMove merged 1 commit into
mainfrom
refactor/usestore-developer-mode-slice

Conversation

@IAnMove

@IAnMove IAnMove commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Resultado

Siguiente corte acotado de useStore: createDeveloperModeSlice en ui/src/stores/developerModeSlice.ts.

  • useStore.ts sigue siendo la fachada pública (developerMode, setDeveloperMode)
  • persistencia hocuspocus-developer-mode-v1 sin cambio (loadDeveloperMode / saveDeveloperMode)
  • mediaFilter sigue en useStore; al desactivar developer mode con filtro auditdev se restablece a all
  • no toca Story/Series/Comics, agentActions.ts, Python ni _launch_runtime.py
  • boy scout no aplica: no se tocan componentes visibles ni catálogos i18n
  • único PR pendiente que modifica useStore.ts

Verificación local

  • npx tsx --tsconfig tsconfig.app.json --import ./tests/setupI18n.ts --test tests/architectureSlices.test.mjs 7/7
  • npm test 485
  • lint --max-warnings=0
  • tsc -b
  • python scripts/architecture_contracts.py

Pendiente de CI.


Note

Low Risk
Refactor-only with parity tests; no API or persistence contract changes beyond relocating slice code.

Overview
Moves developer mode state and setDeveloperMode out of useStore.ts into a dedicated createDeveloperModeSlice module, matching the existing theme/settings slice pattern. useStore remains the public facade by spreading the slice at store creation.

Behavior is intentionally unchanged: the flag still loads and saves via loadDeveloperMode / saveDeveloperMode (hocuspocus-developer-mode-v1), and turning off developer mode still resets mediaFilter from auditdev to all while leaving other filters untouched.

Adds an architecture test that exercises persistence through the slice alone and through useStore, including the auditdevall transition.

Reviewed by Cursor Bugbot for commit 0647cd2. Configure here.

@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: 3 file(s); +81/-10; React UI

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/developerModeSlice.ts
  • modified: 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 0647cd2. Configure here.

@IAnMove
IAnMove merged commit 830bddd into main Sep 2, 2026
5 checks passed
@IAnMove
IAnMove deleted the refactor/usestore-developer-mode-slice 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