InvokeAI icon indicating copy to clipboard operation
InvokeAI copied to clipboard

feat(ui): tabbed canvases

Open csehatt741 opened this issue 2 months ago • 13 comments

Summary

A new feature was implemented to enable multiple canvases in the canvas editor.

  • SliceConfig was updated in types.js to handle partially undoable slices:
    • new generic parametes, TInternalState and TSerializedState, were added to strongly type states used in Redux and the persisted into storage
    • new functions, wrapState and unwrapState, were added to the migrate field for wrapping/unwrapping state during serialization/deserialization
    • undoableConfig was deleted, as reduxUndoOptions is used only in slices, so this field became redundant
  • store.ts was refactored to use the updated SliceConfig
  • new schemas, zStateWithHistory, zCanvasStateWithHistory, zCanvasesState, zCanvasesStateWithHistory and zCanvasesStateWithoutHistory, were created in types.ts to represent types in the partially undoable canvases slice
  • new selectors, selectCanvases selectSelectedCanvasWithHistory and selectSelectedCanvas, were added to selectors.ts to isolate changes due to refactoring in the canvas slice from components
  • canvasSlice was split into two parts representing the canvases slice without history and the canvas with undoable history
  • undoableCanvasesReducer higher order reducer was created to combine canvases and canvas reducers
  • RTK was updated to version 2.9.0

Related Issues / Discussions

Closes #8380

Checklist

  • [x] The PR has a short but descriptive title, suitable for a changelog
  • [ ] Tests added / updated (if applicable)
  • [ ] ❗Changes to a redux slice have a corresponding migration
  • [ ] Documentation added / updated (if applicable)
  • [ ] Updated What's New copy (if doing a release after this PR)

csehatt741 avatar Sep 10 '25 11:09 csehatt741