refactor: extraer el slice de galería y workspaces de useStore - #101
Merged
Conversation
Move workspace CRUD, gallery list/filter/search/refresh, metadata, favorite, delete and clip rejoin into gallerySlice. Keep the public useStore facade, shared request epochs, and loadSettingsFromOutput in the composer. Architecture tests cover bindSlice and client-side filters.
PR Review — Loreframe StudioRisk: medium Automated review from Findings
Changed files
CONTRIBUTING checklist
Posted by the repo PR review workflow. Re-runs on each push to the PR. |
Owner
Author
|
cursor review |
Code health
Markdown, JSON catalogs and tests are out of this table. Only Most complex functions
Trend vs baseline
Warnings
Ratchet passed. |
There was a problem hiding this comment.
✅ 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 95edcca. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objetivo
PR medio y cohesivo del slice de galería/workspaces. No mueve
startGeneration.ui/src/stores/gallerySlice.ts: workspaces CRUD, vista Uploads, listado/filtro/búsqueda/refresh de outputs, metadata, favorito, borrar y rejoin de clips.useStoresigue siendo la fachada pública y compone el slice conbindSlice(sinas never).loadSettingsFromOutput,rerollGeneration,startGenerationy el overlay de almacenamiento siguen enuseStore.developerModesigue saliendo deauditdeva través de la fachada (setMediaFilter('all')).Verificación local
npx tsc -b --pretty falsenpx eslintde los archivos tocados (--max-warnings=0)npm test: 504 passed (incluyearchitectureSlicesyworkspaceOutputs)python scripts/code_health.py --check: ratchet passed; funciones nuevas degallerySlice≤ 14 (tope de hotspot nuevo: 25)Pendiente de CI. No mezclar hasta que los checks estén verdes.
No toca
StoryLabPanel.tsxni_launch_runtime.py.Note
Medium Risk
Large state move touching gallery loading, workspace transitions, and selection/metadata sync; behavior is intended to be unchanged but regressions would affect core browsing UX.
Overview
Moves gallery and workspace state out of the monolithic
useStoreinto a dedicatedgallerySlice, composed with the samebindSlicepattern as other slices.useStoreremains the public facade—call sites keep usinguseStorefor workspaces, outputs, filters, metadata, favorites, delete, and rejoin.The extracted slice keeps the existing epoch counters and
AbortControllerwiring so workspace switches still cancel in-flight output/metadata loads. While moving code, filtering is refactored to aFILTER_PREDICATESmap, API rows go throughtoOutputFile, and incremental refresh usesmergeRefreshedOutputs/clearedFeedStatehelpers.galleryWorkspaceName(andgalleryWorkspaceEpoch) are exported for tests and cross-slice use.loadSettingsFromOutput,rerollGeneration,startGeneration, and storage overlay logic stay inuseStore. Architecture tests assert the gallery slice is isolated and that composition includescreateGallerySlicewithoutas nevercasts.Reviewed by Cursor Bugbot for commit 95edcca. Configure here.