From 4b4d77f99bd55e6de0593c3acd1cf5798ae038bf Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 10 May 2024 14:05:01 -0400
Subject: added an always option for OpenWhere lightbox.  cleaned up/fixed
 making collections capable of being a lightbox.

---
 src/client/views/collections/CollectionDockingView.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/client/views/collections/CollectionDockingView.tsx')

diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 8fb2b30f1..a723dc69d 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -634,7 +634,7 @@ export class CollectionDockingView extends CollectionSubView() {
 ScriptingGlobals.add(
     // eslint-disable-next-line prefer-arrow-callback
     function openInLightbox(doc: any) {
-        CollectionDockingView.Instance?._props.addDocTab(doc, OpenWhere.lightbox);
+        CollectionDockingView.Instance?._props.addDocTab(doc, OpenWhere.lightboxAlways);
     },
     'opens up document in a lightbox',
     '(doc: any)'
-- 
cgit v1.2.3-70-g09d2


From 5cb7ad90e120123ca572e8ef5b1aa6ca41581134 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 13 May 2024 17:29:52 -0400
Subject: cleanup

---
 src/client/views/collections/CollectionDockingView.tsx   | 1 -
 src/client/views/nodes/generativeFill/GenerativeFill.tsx | 6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

(limited to 'src/client/views/collections/CollectionDockingView.tsx')

diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index a723dc69d..73179a266 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -129,7 +129,6 @@ export class CollectionDockingView extends CollectionSubView() {
     }
 
     @undoBatch
-    @action
     public static ReplaceTab(document: Doc, mods: OpenWhereMod, stack: any, panelName: string, addToSplit?: boolean, keyValue?: boolean): boolean {
         const instance = CollectionDockingView.Instance;
         if (!instance) return false;
diff --git a/src/client/views/nodes/generativeFill/GenerativeFill.tsx b/src/client/views/nodes/generativeFill/GenerativeFill.tsx
index 91b0ebd5c..25289967e 100644
--- a/src/client/views/nodes/generativeFill/GenerativeFill.tsx
+++ b/src/client/views/nodes/generativeFill/GenerativeFill.tsx
@@ -56,7 +56,7 @@ const GenerativeFill = ({ imageEditorOpen, imageEditorSource, imageRootDoc, addD
     const [isBrushing, setIsBrushing] = useState(false);
     const [canvasScale, setCanvasScale] = useState(0.5);
     // format: array of [image source, corresponding image Doc]
-    const [edits, setEdits] = useState<(string | Doc)[][]>([]);
+    const [edits, setEdits] = useState<{ url: string; saveRes: Doc | undefined }[]>([]);
     const [edited, setEdited] = useState(false);
     // const [brushStyle] = useState<BrushStyle>(BrushStyle.ADD);
     const [input, setInput] = useState('');
@@ -317,7 +317,7 @@ const GenerativeFill = ({ imageEditorOpen, imageEditorSource, imageRootDoc, addD
                     imgUrls.map(async url => {
                         // eslint-disable-next-line no-use-before-define
                         const saveRes = await onSave(url);
-                        return [url, saveRes as Doc];
+                        return { url, saveRes };
                     })
                 );
                 setEdits(imgRes);
@@ -326,7 +326,7 @@ const GenerativeFill = ({ imageEditorOpen, imageEditorSource, imageRootDoc, addD
                 image.src = imgUrls[0];
                 ImageUtility.drawImgToCanvas(image, canvasRef, canvasDims.width, canvasDims.height);
                 currImg.current = image;
-                parentDoc.current = imgRes[0][1] as Doc;
+                parentDoc.current = imgRes[0].saveRes ?? null;
             }
         } catch (err) {
             console.log(err);
-- 
cgit v1.2.3-70-g09d2

