From b960beb2f31327becdf6709a61b90523abdee65a Mon Sep 17 00:00:00 2001
From: Sophie Zhang <sophie_zhang@brown.edu>
Date: Thu, 22 Feb 2024 13:39:42 -0500
Subject: layout progress

---
 .../collectionFreeForm/CollectionFreeFormView.tsx        | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

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

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index 1e0840495..19948b7eb 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -1649,15 +1649,22 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
         return url.href.replace(ext, '_m' + ext);
     }
 
+    @action
+    smartLayout = async () => {};
+
+    roundToRoundNumber = (num: number) => {
+        return Math.round(num / 10) * 10;
+    };
+
     // gpt layout
     @action
     gptLayout = async () => {
         const docLayouts = this.childDocs.map(doc => ({
-            width: NumCast(doc.width),
-            height: NumCast(doc.height),
-            content: StrCast(doc.title),
+            width: this.roundToRoundNumber(NumCast(doc.width)),
+            height: this.roundToRoundNumber(NumCast(doc.height)),
+            // content: StrCast(doc.title),
         }));
-        console.log(docLayouts);
+        console.log('Doc layouts', docLayouts);
 
         const res = await smartLayout2(docLayouts);
         console.log('Smart layout result', res);
@@ -1752,6 +1759,7 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
         // Want to condense into a Smart Organize button
         this._props.renderDepth && optionItems.push({ description: 'Style with AI', event: this.gptStyling, icon: 'paint-brush' });
         this._props.renderDepth && optionItems.push({ description: 'Smart Layout', event: this.gptLayout, icon: 'object-group' });
+        // this._props.renderDepth && optionItems.push({ description: 'Smart Organize', event: this.smartOrganize, icon: 'object-group' });
         if (!Doc.noviceMode) {
             optionItems.push({ description: (!Doc.NativeWidth(this.layoutDoc) || !Doc.NativeHeight(this.layoutDoc) ? 'Freeze' : 'Unfreeze') + ' Aspect', event: this.toggleNativeDimensions, icon: 'snowflake' });
         }
-- 
cgit v1.2.3-70-g09d2

