Invoke is a leading creative engine that uses image and video generation models to empower professionals, artists, and enthusiasts to generate and create visual media using the latest AI-driven technologies. The solution offers an industry-leading application interface, and serves as the foundation for multiple commercial products.
TypeScript ai-artartificial-intelligencegenerative-artimage-generationimg2imginpaintinglatent-diffusionlinuxmacosoutpaintingstable-diffusiontxt2imgwindows
fix(gallery): never page-follow a starred selection
Josh Corbett60c813e35644
diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/galleryStateView.test.ts b/invokeai/frontend/webv2/src/features/gallery/ui/galleryStateView.test.tsindex 93fce51494..cfafe663e6 100644--- a/invokeai/frontend/webv2/src/features/gallery/ui/galleryStateView.test.ts+++ b/invokeai/frontend/webv2/src/features/gallery/ui/galleryStateView.test.ts@@ -271,6 +271,14 @@ describe('gallery state view', () => {expect(pageOf({ searchTerm: 'cats' })).toBeNull();expect(pageOf({ starredOnly: true })).toBeNull();expect(pageOf({ starredOnly: true }, { starredOnly: true })).toBe(2);+ // A starred selection sits in the strip, so no page of the unstarred grid holds it.+ expect(pageOf({ selectedImage: { ...createImageItem('starred.png'), starred: true } })).toBeNull();+ expect(+ pageOf(+ { selectedImage: { ...createImageItem('starred.png'), starred: true }, starredOnly: true },+ { starredOnly: true }+ )+ ).toBe(2);expect(pageOf({ semanticImageQuery: { imageName: 'ref.png', kind: 'image' } })).toBeNull();});diff --git a/invokeai/frontend/webv2/src/features/gallery/ui/galleryStateView.ts b/invokeai/frontend/webv2/src/features/gallery/ui/galleryStateView.tsindex 24db5dde6d..d059dcdec6 100644--- a/invokeai/frontend/webv2/src/features/gallery/ui/galleryStateView.ts+++ b/invokeai/frontend/webv2/src/features/gallery/ui/galleryStateView.ts@@ -465,7 +465,10 @@ export const getGalleryStateView = (selectedImageQuery.galleryView === galleryView &&selectedImageQuery.imageOrderDir === settings.imageOrderDir &&selectedImageQuery.searchTerm === searchTerm &&- selectedImageQuery.starredOnly === starredOnly+ selectedImageQuery.starredOnly === starredOnly &&+ // A starred item lives in the strip, never on a page of the unstarred+ // listing; Preview stamps its starred-list page, which the grid must not follow.+ (starredOnly || selectedItem?.starred !== true)? selectedImageQuery.page: null;