From b235e116167a06b6d36e2962dd3f610839f18974 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Sun, 1 Sep 2024 00:11:36 -0400
Subject: updated to latest Jimp.  fixed lag dropping images from filesystem by
 using worker threads.

---
 .../collections/collectionGrid/CollectionGridView.tsx   | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

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

diff --git a/src/client/views/collections/collectionGrid/CollectionGridView.tsx b/src/client/views/collections/collectionGrid/CollectionGridView.tsx
index 61bd0241c..5c41fee37 100644
--- a/src/client/views/collections/collectionGrid/CollectionGridView.tsx
+++ b/src/client/views/collections/collectionGrid/CollectionGridView.tsx
@@ -9,7 +9,7 @@ import { emptyFunction } from '../../../../Utils';
 import { Docs } from '../../../documents/Documents';
 import { DragManager } from '../../../util/DragManager';
 import { Transform } from '../../../util/Transform';
-import { undoBatch } from '../../../util/UndoManager';
+import { undoable, undoBatch } from '../../../util/UndoManager';
 import { ContextMenu } from '../../ContextMenu';
 import { ContextMenuProps } from '../../ContextMenuItem';
 import { DocumentView } from '../../nodes/DocumentView';
@@ -221,13 +221,13 @@ export class CollectionGridView extends CollectionSubView() {
             });
 
             if (this.Document.gridStartCompaction) {
-                undoBatch(() => {
+                undoable(() => {
                     this.Document.gridCompaction = this.Document.gridStartCompaction;
                     this.setLayoutList(savedLayouts);
-                })();
+                }, 'start grid compaction')();
                 this.Document.gridStartCompaction = undefined;
             } else {
-                undoBatch(() => this.setLayoutList(savedLayouts))();
+                undoable(() => this.setLayoutList(savedLayouts), 'start grid compaction')();
             }
         }
     };
@@ -315,9 +315,9 @@ export class CollectionGridView extends CollectionSubView() {
             e,
             returnFalse,
             action(() => {
-                undoBatch(() => {
+                undoable(() => {
                     this.Document.gridRowHeight = this._rowHeight;
-                })();
+                }, 'changing row height')();
                 this._rowHeight = undefined;
             }),
             emptyFunction,
@@ -360,13 +360,14 @@ export class CollectionGridView extends CollectionSubView() {
                 returnFalse,
                 (clickEv: PointerEvent, doubleTap?: boolean) => {
                     if (doubleTap && !clickEv.button) {
-                        undoBatch(
+                        undoable(
                             action(() => {
                                 const text = Docs.Create.TextDocument('', { _width: 150, _height: 50 });
                                 Doc.SetSelectOnLoad(text); // track the new text box so we can give it a prop that tells it to focus itself when it's displayed
                                 Doc.AddDocToList(this.Document, this._props.fieldKey, text);
                                 this.setLayoutList(this.addLayoutItem(this.savedLayoutList, this.makeLayoutItem(text, this.screenToCell(clickEv.clientX, clickEv.clientY))));
-                            })
+                            }),
+                            'create grid text'
                         )();
                     }
                 },
-- 
cgit v1.2.3-70-g09d2

