From 71ebece4a97547ac9bec32cd30957d38c96fb755 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Fri, 6 Dec 2019 21:19:25 -0500 Subject: performance fixes for sidebar. stop re-rendering docking view when sidebar expands. fixed lightbox. --- src/client/views/MainView.scss | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/client/views/MainView.scss') diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss index 0ee30f117..a8924c6b1 100644 --- a/src/client/views/MainView.scss +++ b/src/client/views/MainView.scss @@ -7,11 +7,18 @@ width: 100%; } +.mainContent-div { + position: relative; + width:100%; + height:100%; +} + // add nodes menu. Note that the + button is actually an input label, not an actual button. .mainView-docButtons { position: absolute; bottom: 20px; - left: 250px; + left: calc(100% + 5px); + z-index: 1; } #mainView-container { @@ -27,13 +34,13 @@ width: 100%; height: 100%; position: absolute; + display: flex; } .mainView-flyoutContainer { display: flex; flex-direction: column; - position: absolute; - width: 100%; + position: relative; height: 100%; .documentView-node-topmost { @@ -59,9 +66,11 @@ .mainView-libraryFlyout { height: 100%; + width:100%; position: absolute; display: flex; flex-direction: column; + z-index: 1; } .mainView-expandFlyoutButton { @@ -73,6 +82,7 @@ .mainView-libraryHandle { width: 20px; + left: calc(100% - 10px); height: 40px; top: 50%; border: 1px solid black; @@ -80,6 +90,7 @@ position: absolute; z-index: 1; touch-action: none; + cursor: ew-resize; } .mainView-workspace { -- cgit v1.2.3-70-g09d2 From 16c84a8042fc3e9d7af3d74fce2758bf6862a5a2 Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Tue, 17 Dec 2019 20:55:38 -0500 Subject: warnings and fix to doc decorations close button to deselect first --- src/client/views/DocumentDecorations.tsx | 5 +++-- src/client/views/GlobalKeyHandler.ts | 2 +- src/client/views/MainView.scss | 4 ++-- src/client/views/collections/ParentDocumentSelector.tsx | 2 +- src/client/views/nodes/DocumentBox.tsx | 3 +++ 5 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/client/views/MainView.scss') diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx index fdaca87a9..228cea00e 100644 --- a/src/client/views/DocumentDecorations.tsx +++ b/src/client/views/DocumentDecorations.tsx @@ -233,11 +233,12 @@ export class DocumentDecorations extends React.Component<{}, { value: string }> e.stopPropagation(); if (e.button === 0) { const recent = Cast(CurrentUserUtils.UserDocument.recentlyClosed, Doc) as Doc; - SelectionManager.SelectedDocuments().map(dv => { + let selected = SelectionManager.SelectedDocuments().slice(); + SelectionManager.DeselectAll(); + selected.map(dv => { recent && Doc.AddDocToList(recent, "data", dv.props.Document, undefined, true, true); dv.props.removeDocument && dv.props.removeDocument(dv.props.Document); }); - SelectionManager.DeselectAll(); document.removeEventListener("pointermove", this.onCloseMove); document.removeEventListener("pointerup", this.onCloseUp); } diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts index c48e1df4f..979687ffb 100644 --- a/src/client/views/GlobalKeyHandler.ts +++ b/src/client/views/GlobalKeyHandler.ts @@ -127,7 +127,7 @@ export default class KeyManager { switch (keyname) { case "f": - let dv = SelectionManager.SelectedDocuments()?.[0]; + const dv = SelectionManager.SelectedDocuments()?.[0]; if (dv) { const ex = dv.props.ScreenToLocalTransform().inverse().transformPoint(0, 0)[0]; const ey = dv.props.ScreenToLocalTransform().inverse().transformPoint(0, 0)[1]; diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss index a8924c6b1..51a062118 100644 --- a/src/client/views/MainView.scss +++ b/src/client/views/MainView.scss @@ -70,7 +70,7 @@ position: absolute; display: flex; flex-direction: column; - z-index: 1; + z-index: 2; } .mainView-expandFlyoutButton { @@ -88,7 +88,7 @@ border: 1px solid black; border-radius: 5px; position: absolute; - z-index: 1; + z-index: 2; touch-action: none; cursor: ew-resize; } diff --git a/src/client/views/collections/ParentDocumentSelector.tsx b/src/client/views/collections/ParentDocumentSelector.tsx index ffaf41b91..422d01cee 100644 --- a/src/client/views/collections/ParentDocumentSelector.tsx +++ b/src/client/views/collections/ParentDocumentSelector.tsx @@ -118,7 +118,7 @@ export class ButtonSelector extends React.Component<{ Document: Doc, Stack: any render() { const view = DocumentManager.Instance.getDocumentView(this.props.Document); - let flyout = ( + const flyout = (
diff --git a/src/client/views/nodes/DocumentBox.tsx b/src/client/views/nodes/DocumentBox.tsx index 6be0289d7..94755afec 100644 --- a/src/client/views/nodes/DocumentBox.tsx +++ b/src/client/views/nodes/DocumentBox.tsx @@ -33,6 +33,9 @@ export class DocumentBox extends DocComponent(DocB } }); } + componentWillUnmount() { + this._prevSelectionDisposer && this._prevSelectionDisposer(); + } specificContextMenu = (e: React.MouseEvent): void => { const funcs: ContextMenuProps[] = []; funcs.push({ description: (this.isSelectionLocked() ? "Show" : "Lock") + " Selection", event: () => this.toggleLockSelection, icon: "expand-arrows-alt" }); -- cgit v1.2.3-70-g09d2 From 8907ea70352d07c80233ff4c3e06c9c543c5be83 Mon Sep 17 00:00:00 2001 From: bob Date: Thu, 19 Dec 2019 13:00:18 -0500 Subject: fixing minor details with tree view opening workspace, moving documents in stacking views, avoiding search exceptions, --- src/client/util/SearchUtil.ts | 6 +++--- src/client/views/MainView.scss | 4 ++-- src/client/views/collections/CollectionDockingView.tsx | 3 +-- src/client/views/collections/CollectionTreeView.tsx | 1 - src/client/views/nodes/DocumentView.tsx | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/client/views/MainView.scss') diff --git a/src/client/util/SearchUtil.ts b/src/client/util/SearchUtil.ts index 1fda82880..4f6211d94 100644 --- a/src/client/util/SearchUtil.ts +++ b/src/client/util/SearchUtil.ts @@ -34,9 +34,9 @@ export namespace SearchUtil { export function Search(query: string, returnDocs: false, options?: SearchParams): Promise; export async function Search(query: string, returnDocs: boolean, options: SearchParams = {}) { query = query || "*"; //If we just have a filter query, search for * as the query - const result: IdSearchResult = JSON.parse(await rp.get(Utils.prepend("/search"), { - qs: { ...options, q: query }, - })); + let rpquery = Utils.prepend("/search"); + let gotten = await rp.get(rpquery, { qs: { ...options, q: query } }); + const result: IdSearchResult = gotten.startsWith("<") ? { ids: [], docs: [], numFound: 0, lines: [] } : JSON.parse(gotten); if (!returnDocs) { return result; } diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss index 51a062118..4c8c95529 100644 --- a/src/client/views/MainView.scss +++ b/src/client/views/MainView.scss @@ -59,8 +59,8 @@ .mainView-logout { position: absolute; - right: 0; - bottom: 0; + right: 5; + bottom: 5; font-size: 8px; } diff --git a/src/client/views/collections/CollectionDockingView.tsx b/src/client/views/collections/CollectionDockingView.tsx index 08b9fd216..232722f48 100644 --- a/src/client/views/collections/CollectionDockingView.tsx +++ b/src/client/views/collections/CollectionDockingView.tsx @@ -649,8 +649,7 @@ export class DockedFrameRenderer extends React.Component { addDocTab = (doc: Doc, dataDoc: Opt, location: string, libraryPath?: Doc[]) => { SelectionManager.DeselectAll(); if (doc.dockingConfig) { - MainView.Instance.openWorkspace(doc); - return true; + return MainView.Instance.openWorkspace(doc); } else if (location === "onRight") { return CollectionDockingView.AddRightSplit(doc, dataDoc, undefined, libraryPath); } else if (location === "close") { diff --git a/src/client/views/collections/CollectionTreeView.tsx b/src/client/views/collections/CollectionTreeView.tsx index 9f5db5faf..2b13d87ee 100644 --- a/src/client/views/collections/CollectionTreeView.tsx +++ b/src/client/views/collections/CollectionTreeView.tsx @@ -202,7 +202,6 @@ class TreeView extends React.Component { } ContextMenu.Instance.addItem({ description: "Delete Item", event: () => this.props.deleteDoc(this.props.document), icon: "trash-alt" }); } else { - ContextMenu.Instance.addItem({ description: "Open as Workspace", event: () => MainView.Instance.openWorkspace(this.dataDoc), icon: "caret-square-right" }); ContextMenu.Instance.addItem({ description: "Delete Workspace", event: () => this.props.deleteDoc(this.props.document), icon: "trash-alt" }); ContextMenu.Instance.addItem({ description: "Create New Workspace", event: () => MainView.Instance.createNewWorkspace(), icon: "plus" }); } diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 0753ad632..6ea5b2d2a 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -130,7 +130,7 @@ export class DocumentView extends DocComponent(Docu const [left, top] = this.props.ScreenToLocalTransform().scale(this.props.ContentScaling()).inverse().transformPoint(0, 0); dragData.offset = this.props.ScreenToLocalTransform().scale(this.props.ContentScaling()).transformDirection(x - left, y - top); dragData.dropAction = dropAction; - dragData.moveDocument = this.Document.onDragStart ? undefined : this.props.moveDocument; + dragData.moveDocument = this.props.moveDocument;// this.Document.onDragStart ? undefined : this.props.moveDocument; dragData.applyAsTemplate = applyAsTemplate; dragData.dragDivName = this.props.dragDivName; DragManager.StartDocumentDrag([this._mainCont.current], dragData, x, y, { hideSource: !dropAction && !this.Document.onDragStart }); -- cgit v1.2.3-70-g09d2 From e410cde0e430553002d4e1a2f64364b57b65fdbc Mon Sep 17 00:00:00 2001 From: Bob Zeleznik Date: Thu, 16 Jan 2020 09:59:21 -0500 Subject: fixed context menu on mac. fixed exceptions with contentScaling and contentfittingviews. fixed sizing of mainview's contents --- src/client/views/MainView.scss | 8 ++++++++ src/client/views/nodes/ContentFittingDocumentView.tsx | 6 +++--- src/client/views/nodes/DocumentView.tsx | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) (limited to 'src/client/views/MainView.scss') diff --git a/src/client/views/MainView.scss b/src/client/views/MainView.scss index 4c8c95529..c7fc6096a 100644 --- a/src/client/views/MainView.scss +++ b/src/client/views/MainView.scss @@ -5,6 +5,9 @@ .mainView-tabButtons { position: relative; width: 100%; + .documentView-node-topmost { + height: 200% !important; + } } .mainContent-div { @@ -13,6 +16,11 @@ height:100%; } +.mainView-contentArea { + .documentView-node-topmost { + height: 200% !important; + } +} // add nodes menu. Note that the + button is actually an input label, not an actual button. .mainView-docButtons { position: absolute; diff --git a/src/client/views/nodes/ContentFittingDocumentView.tsx b/src/client/views/nodes/ContentFittingDocumentView.tsx index bbec66233..e97445f27 100644 --- a/src/client/views/nodes/ContentFittingDocumentView.tsx +++ b/src/client/views/nodes/ContentFittingDocumentView.tsx @@ -48,11 +48,11 @@ export class ContentFittingDocumentView extends React.Component { - const wscale = this.props.PanelWidth() / (this.nativeWidth ? this.nativeWidth : this.props.PanelWidth()); + const wscale = this.props.PanelWidth() / (this.nativeWidth || this.props.PanelWidth() || 1); if (wscale * this.nativeHeight > this.props.PanelHeight()) { - return this.props.PanelHeight() / (this.nativeHeight ? this.nativeHeight : this.props.PanelHeight()); + return (this.props.PanelHeight() / (this.nativeHeight || this.props.PanelHeight() || 1)) || 1; } - return wscale; + return wscale || 1; } @undoBatch diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index b2c2ccff5..dabe5a7aa 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -583,7 +583,7 @@ export class DocumentView extends DocComponent(Docu @action onContextMenu = async (e: React.MouseEvent): Promise => { // the touch onContextMenu is button 0, the pointer onContextMenu is button 2 - if (e.button === 0) { + if (e.button === 0 && !e.ctrlKey) { e.preventDefault(); return; } -- cgit v1.2.3-70-g09d2