From 93d4c71fe523a4b1f473ee6ab5e8a9b8ca715625 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 4 Mar 2025 11:07:40 -0500
Subject: fixed column width default / columnDragger for masonry view.

---
 src/client/views/collections/CollectionStackingView.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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

diff --git a/src/client/views/collections/CollectionStackingView.tsx b/src/client/views/collections/CollectionStackingView.tsx
index f06e0b551..96125f2c2 100644
--- a/src/client/views/collections/CollectionStackingView.tsx
+++ b/src/client/views/collections/CollectionStackingView.tsx
@@ -111,7 +111,7 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
     // columnWidth handles the margin on the left and right side of the documents
     @computed get columnWidth() {
         const availableWidth = this._props.PanelWidth() - 2 * this.xMargin;
-        const cwid = availableWidth / NumCast(this.Document._layout_columnCount, 1);
+        const cwid = availableWidth / (NumCast(this.Document._layout_columnCount) || this._props.PanelWidth() / NumCast(this.Document._layout_columnWidth, this._props.PanelWidth() / 4));
         return Math.min(availableWidth, this.isStackingView ? Number.MAX_VALUE : cwid - this.gridGap);
     }
 
@@ -241,7 +241,7 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
         this._disposers.width = reaction(
             () => [this._props.PanelWidth() - 2 * this.xMargin, NumCast(this.Document._layout_columnWidth, 250)],
             ([pw, cw]) => {
-                if (!this.isStackingView) {
+                if (!this.isStackingView && Math.round(pw / cw)) {
                     this.layoutDoc._layout_columnCount = Math.round(pw / cw);
                 }
             }
@@ -607,7 +607,7 @@ export class CollectionStackingView extends CollectionSubView<Partial<collection
         const rows = () => (!this.isStackingView ? 1 : Math.max(1, Math.min(docList.length, Math.floor((this._props.PanelWidth() - 2 * this.xMargin) / (this.columnWidth + this.gridGap)))));
         return (
             <div key={(heading?.heading ?? '') + 'head'}>
-                {this._props.isContentActive() && !this.isStackingView ? this.columnDragger : null}
+                {this._props.isContentActive() && !this.isStackingView && !this.chromeHidden ? this.columnDragger : null}
                 <div style={{ top: this.yMargin }}>
                     <CollectionMasonryViewFieldRow
                         showHandle={first}
-- 
cgit v1.2.3-70-g09d2

