Skip to content

refactor: extract the retake dialog slice from useStore - #84

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

refactor: extract the retake dialog slice from useStore#84
IAnMove merged 1 commit into
mainfrom
refactor/usestore-retake-dialog-slice

Conversation

@IAnMove

@IAnMove IAnMove commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Resultado

Siguiente corte acotado de useStore: createRetakeDialogSlice en ui/src/stores/retakeDialogSlice.ts.

  • useStore.ts sigue siendo la fachada pública (retakeDialogOpen, retakeSourceFile, openRetakeDialog, closeRetakeDialog)
  • estado en memoria, sin persistencia; retakeDialogOpen arranca en false y retakeSourceFile en null
  • no toca sidebar, settings, theme, developerMode, gallery, Story/Series/Comics ni agentActions.ts
  • 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 9/9
  • npm test 489
  • lint --max-warnings=0
  • tsc -b
  • python scripts/architecture_contracts.py

Pendiente de CI.


Note

Low Risk
Pure structural refactor with unchanged public store API; consumers like RetakeDialog and MediaFeedItem are untouched.

Overview
Moves retake-dialog UI state out of the monolithic useStore into createRetakeDialogSlice (retakeDialogSlice.ts), matching other store slices (sidebar, settings, etc.).

useStore still exposes the same facade: retakeDialogOpen, retakeSourceFile, openRetakeDialog, and closeRetakeDialog—composed via spread with no persistence or behavior change. Inline definitions are removed from the main store body.

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

Reviewed by Cursor Bugbot for commit a4ddaf3. 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); +47/-5; 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/retakeDialogSlice.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 a4ddaf3. Configure here.

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