Skip to content

refactor: extract the settings drawer slice from useStore - #70

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

refactor: extract the settings drawer slice from useStore#70
IAnMove merged 1 commit into
mainfrom
refactor/usestore-settings-slice

Conversation

@IAnMove

@IAnMove IAnMove commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Resultado

Siguiente corte acotado de useStore: createSettingsSlice en ui/src/stores/settingsSlice.ts.

  • useStore.ts sigue siendo la fachada pública (settingsOpen, toggleSettings, setSettingsOpen, settingsTab, setSettingsTab)
  • estado en memoria, sin persistencia
  • openModelVisibility sigue en useStore y escribe los mismos campos
  • 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 6/6
  • npm test 484
  • lint --max-warnings=0
  • tsc -b
  • python scripts/architecture_contracts.py

Pendiente de CI.


Note

Low Risk
In-memory UI state refactor with no API or persistence changes; behavior is covered by existing and new slice tests.

Overview
Moves settings drawer UI state out of the monolithic useStore into a dedicated createSettingsSlice module, following the same pattern as themeSlice and directorSlice.

The slice owns settingsOpen / toggleSettings / setSettingsOpen and settingsTab / setSettingsTab (default tab remains performance). useStore still spreads the slice so the public API and selectors stay the same; nothing is persisted.

Adds an architecture test that exercises the slice in isolation and through useStore.getState(), consistent with other slice facade tests.

Reviewed by Cursor Bugbot for commit c950f9d. Configure here.

Settings open/tab stay on the public useStore facade with the same
in-memory behavior. Theme, Story, Series and Comics are untouched.
@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); +56/-7; 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/settingsSlice.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 c950f9d. Configure here.

@IAnMove
IAnMove merged commit 72810bc into main Sep 2, 2026
5 checks passed
@IAnMove
IAnMove deleted the refactor/usestore-settings-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