From 4c768162e0436115a05b9c8b0e4d837d626d45ba Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 30 Oct 2024 18:54:52 -0400
Subject: reworked how context menu buttons for ink and text work. added
 disableMixBlend for making transparent docs not use 'multiply'.

---
 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 e1786d2c9..3e8138390 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -453,7 +453,7 @@ export class CollectionDockingView extends CollectionSubView() {
                 }
             }
         }
-        if (!InteractionUtils.IsType(e, InteractionUtils.TOUCHTYPE) && !InteractionUtils.IsType(e, InteractionUtils.PENTYPE) && ![InkTool.Highlighter, InkTool.Pen, InkTool.Write].includes(Doc.ActiveTool)) {
+        if (!InteractionUtils.IsType(e, InteractionUtils.TOUCHTYPE) && !InteractionUtils.IsType(e, InteractionUtils.PENTYPE) && Doc.ActiveTool !== InkTool.Ink) {
             e.stopPropagation();
         }
     };
-- 
cgit v1.2.3-70-g09d2


From 4270a0c74ffdfab64cd8d259ce76773a68a7f422 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 2 Jan 2025 10:14:39 -0500
Subject: fixed react warning for goldenlayout unmounting.

---
 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 3e8138390..539b49c86 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -382,7 +382,7 @@ export class CollectionDockingView extends CollectionSubView() {
         } catch {
             /* empty */
         }
-        this._goldenLayout?.destroy();
+        setTimeout(() => this._goldenLayout?.destroy());
         window.removeEventListener('resize', this.onResize);
         window.removeEventListener('mouseup', this.onPointerUp);
 
-- 
cgit v1.2.3-70-g09d2


From 84139cbfb20ab53fe42d1c21a74b86368c5822ca Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 4 Mar 2025 19:07:45 -0500
Subject: fixed maximizing mainview by fixing window event removal in
 dockingview.

---
 src/client/views/MainView.tsx                      |  2 +-
 .../views/collections/CollectionDockingView.tsx    | 30 ++++++++++++++--------
 2 files changed, 20 insertions(+), 12 deletions(-)

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

diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx
index cc7c1a42b..afefe3f03 100644
--- a/src/client/views/MainView.tsx
+++ b/src/client/views/MainView.tsx
@@ -686,7 +686,7 @@ export class MainView extends ObservableReactComponent<object> {
         );
     }
     @computed get mainDocView() {
-        const headerBar = this._hideUI || !this.headerBarDocHeight?.() ? null : this.headerBarDocView;
+        const headerBar = null; // this._hideUI || !this.headerBarDocHeight?.() ? null : this.headerBarDocView;
         return (
             <>
                 {headerBar}
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 539b49c86..04e3b2663 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -48,8 +48,7 @@ export class CollectionDockingView extends CollectionSubView() {
     // eslint-disable-next-line no-use-before-define
     @observable public static Instance: CollectionDockingView | undefined = undefined;
 
-    private _reactionDisposer?: IReactionDisposer;
-    private _lightboxReactionDisposer?: IReactionDisposer;
+    private _disposers: { [key: string]: IReactionDisposer } = {};
     private _containerRef = React.createRef<HTMLDivElement>();
     private _flush: UndoManager.Batch | undefined;
     private _unmounting = false;
@@ -66,6 +65,7 @@ export class CollectionDockingView extends CollectionSubView() {
     constructor(props: SubCollectionViewProps) {
         super(props);
         makeObservable(this);
+        console.log('CREATING DOCKING VIEW');
         if (this._props.renderDepth < 0) CollectionDockingView.Instance = this;
         // Why is this here?
         (window as unknown as { React: unknown }).React = React;
@@ -282,6 +282,7 @@ export class CollectionDockingView extends CollectionSubView() {
     }
     setupGoldenLayout = async () => {
         if (this._unmounting) return;
+        console.log('SETUP LAYOUT');
         // const config = StrCast(this.Document.dockingConfig, JSON.stringify(DashboardView.resetDashboard(this.Document)));
         const config = StrCast(this.Document.dockingConfig);
         if (config) {
@@ -339,29 +340,36 @@ export class CollectionDockingView extends CollectionSubView() {
     componentDidMount: () => void = async () => {
         this._props.setContentViewBox?.(this);
         this._unmounting = false;
+        console.log('MOUNTING');
         SetPropSetterCb('title', this.titleChanged); // this overrides any previously assigned callback for the property
         if (this._containerRef.current) {
-            this._lightboxReactionDisposer = reaction(
+            this._disposers.lightbox = reaction(
                 () => DocumentView.LightboxDoc(),
                 doc => setTimeout(() => !doc && this.onResize())
             );
             new ResizeObserver(this.onResize).observe(this._containerRef.current);
-            this._reactionDisposer = reaction(
+            this._disposers.docking = reaction(
                 () => StrCast(this.Document.dockingConfig),
                 config => {
                     if (!this._goldenLayout || this._ignoreStateChange !== config) {
+                        console.log('CONFIG CHANGED');
                         //  bcz: TODO! really need to diff config with ignoreStateChange and modify the current goldenLayout instead of building a new one.
                         this.setupGoldenLayout();
                     }
                     this._ignoreStateChange = '';
                 }
             );
-            reaction(
+            this._disposers.panel = reaction(
                 () => this._props.PanelWidth(),
-                width => !this._goldenLayout && width > 20 && setTimeout(() => this.setupGoldenLayout()), // need to wait for the collectiondockingview-container to have it's width/height since golden layout reads that to configure its windows
+                width => {
+                    if (!this._goldenLayout && width > 20) {
+                        console.log('PWIDTH = ' + width);
+                        setTimeout(() => this.setupGoldenLayout());
+                    }
+                }, // need to wait for the collectiondockingview-container to have it's width/height since golden layout reads that to configure its windows
                 { fireImmediately: true }
             );
-            reaction(
+            this._disposers.color = reaction(
                 () => [SnappingManager.userBackgroundColor, SnappingManager.userBackgroundColor],
                 () => {
                     clearStyleSheetRules(CollectionDockingView._highlightStyleSheet);
@@ -375,7 +383,9 @@ export class CollectionDockingView extends CollectionSubView() {
     };
 
     componentWillUnmount: () => void = () => {
+        console.log('UNMOUNTING');
         this._unmounting = true;
+        Object.values(this._disposers).forEach(d => d());
         try {
             this._goldenLayout.unbind('stackCreated', this.stackCreated);
             this._goldenLayout.unbind('tabDestroyed', this.tabDestroyed);
@@ -385,9 +395,6 @@ export class CollectionDockingView extends CollectionSubView() {
         setTimeout(() => this._goldenLayout?.destroy());
         window.removeEventListener('resize', this.onResize);
         window.removeEventListener('mouseup', this.onPointerUp);
-
-        this._reactionDisposer?.();
-        this._lightboxReactionDisposer?.();
     };
 
     // ViewBoxInterface overrides
@@ -412,6 +419,7 @@ export class CollectionDockingView extends CollectionSubView() {
                   .map(f => f as Doc);
         const changesMade = this.Document.dockingConfig !== json;
         if (changesMade) {
+            console.log('WRITING CONFIG');
             if (![AclAdmin, AclEdit].includes(GetEffectiveAcl(this.dataDoc))) {
                 this.layoutDoc.dockingConfig = json;
                 this.layoutDoc.data = new List<Doc>(docs);
@@ -426,7 +434,7 @@ export class CollectionDockingView extends CollectionSubView() {
 
     @action
     onPointerUp = (): void => {
-        window.removeEventListener('pointerup', this.onPointerUp);
+        window.removeEventListener('mouseup', this.onPointerUp);
         DragManager.CompleteWindowDrag = undefined;
         setTimeout(this.endUndoBatch, 100);
     };
-- 
cgit v1.2.3-70-g09d2


From 1256ea80f4f1feedf9344020d1bb5fbbaf8e21a4 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 5 Mar 2025 19:43:42 -0500
Subject: fixing compile/runtime errors.

---
 src/client/views/MainView.scss                         |  2 +-
 src/client/views/_nodeModuleOverrides.scss             | 12 ++++++------
 src/client/views/collections/CollectionDockingView.tsx |  7 -------
 3 files changed, 7 insertions(+), 14 deletions(-)

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

diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss
index e01e92101..db949285b 100644
--- a/src/client/views/MainView.scss
+++ b/src/client/views/MainView.scss
@@ -1,5 +1,5 @@
 @use 'global/globalCssVariables.module.scss' as global;
-@import 'nodeModuleOverrides';
+@use 'nodeModuleOverrides' as overrides;
 html {
     overscroll-behavior-x: none;
 }
diff --git a/src/client/views/_nodeModuleOverrides.scss b/src/client/views/_nodeModuleOverrides.scss
index db69d6e44..d06380271 100644
--- a/src/client/views/_nodeModuleOverrides.scss
+++ b/src/client/views/_nodeModuleOverrides.scss
@@ -1,9 +1,9 @@
-@import './global/globalCssVariables.module.scss';
+@use './global/globalCssVariables.module.scss' as global;
 // this file is for overriding all the css from installed node modules
 
 // goldenlayout stuff
 div .lm_header {
-    background: $dark-gray;
+    background: global.$dark-gray;
     overflow: hidden;
     height: 27px !important;
 }
@@ -30,13 +30,13 @@ div .lm_header {
 /* Handle */
 .lm_header:hover::-webkit-scrollbar-thumb {
     -webkit-appearance: none;
-    background: $dark-gray;
+    background: global.$dark-gray;
 }
 
 /* Handle on hover */
 .lm_header:hover::-webkit-scrollbar-thumb:hover {
     -webkit-appearance: none;
-    background: $dark-gray;
+    background: global.$dark-gray;
 }
 
 .lm_tabs {
@@ -44,7 +44,7 @@ div .lm_header {
     position: absolute;
     width: calc(100% - 60px);
     overflow: scroll;
-    background: transparent; //$dark-gray;
+    background: transparent; //global.$dark-gray;
     border-radius: 0px;
 }
 
@@ -54,7 +54,7 @@ div .lm_header {
     //   min-height: 1.35em;
     //   padding-bottom: 0px;
     //   border-radius: 5px;
-    font-family: $sans-serif !important;
+    font-family: global.$sans-serif !important;
 }
 
 // @TODO the ril__navgiation buttons in the img gallery are a lil messed up but I can't figure out
diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx
index 04e3b2663..e51bc18ef 100644
--- a/src/client/views/collections/CollectionDockingView.tsx
+++ b/src/client/views/collections/CollectionDockingView.tsx
@@ -65,7 +65,6 @@ export class CollectionDockingView extends CollectionSubView() {
     constructor(props: SubCollectionViewProps) {
         super(props);
         makeObservable(this);
-        console.log('CREATING DOCKING VIEW');
         if (this._props.renderDepth < 0) CollectionDockingView.Instance = this;
         // Why is this here?
         (window as unknown as { React: unknown }).React = React;
@@ -282,7 +281,6 @@ export class CollectionDockingView extends CollectionSubView() {
     }
     setupGoldenLayout = async () => {
         if (this._unmounting) return;
-        console.log('SETUP LAYOUT');
         // const config = StrCast(this.Document.dockingConfig, JSON.stringify(DashboardView.resetDashboard(this.Document)));
         const config = StrCast(this.Document.dockingConfig);
         if (config) {
@@ -340,7 +338,6 @@ export class CollectionDockingView extends CollectionSubView() {
     componentDidMount: () => void = async () => {
         this._props.setContentViewBox?.(this);
         this._unmounting = false;
-        console.log('MOUNTING');
         SetPropSetterCb('title', this.titleChanged); // this overrides any previously assigned callback for the property
         if (this._containerRef.current) {
             this._disposers.lightbox = reaction(
@@ -352,7 +349,6 @@ export class CollectionDockingView extends CollectionSubView() {
                 () => StrCast(this.Document.dockingConfig),
                 config => {
                     if (!this._goldenLayout || this._ignoreStateChange !== config) {
-                        console.log('CONFIG CHANGED');
                         //  bcz: TODO! really need to diff config with ignoreStateChange and modify the current goldenLayout instead of building a new one.
                         this.setupGoldenLayout();
                     }
@@ -363,7 +359,6 @@ export class CollectionDockingView extends CollectionSubView() {
                 () => this._props.PanelWidth(),
                 width => {
                     if (!this._goldenLayout && width > 20) {
-                        console.log('PWIDTH = ' + width);
                         setTimeout(() => this.setupGoldenLayout());
                     }
                 }, // need to wait for the collectiondockingview-container to have it's width/height since golden layout reads that to configure its windows
@@ -383,7 +378,6 @@ export class CollectionDockingView extends CollectionSubView() {
     };
 
     componentWillUnmount: () => void = () => {
-        console.log('UNMOUNTING');
         this._unmounting = true;
         Object.values(this._disposers).forEach(d => d());
         try {
@@ -419,7 +413,6 @@ export class CollectionDockingView extends CollectionSubView() {
                   .map(f => f as Doc);
         const changesMade = this.Document.dockingConfig !== json;
         if (changesMade) {
-            console.log('WRITING CONFIG');
             if (![AclAdmin, AclEdit].includes(GetEffectiveAcl(this.dataDoc))) {
                 this.layoutDoc.dockingConfig = json;
                 this.layoutDoc.data = new List<Doc>(docs);
-- 
cgit v1.2.3-70-g09d2

