From 3a215bfddbc68ab314bcfb242c7c2d7652556fb1 Mon Sep 17 00:00:00 2001 From: bobzel Date: Wed, 19 May 2021 14:43:26 -0400 Subject: fixed problem with panning caused by document width/height changes not invalidating anything --- .../collectionFreeForm/CollectionFreeFormView.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx index 0f9dbe23b..accb80c5a 100644 --- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx +++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx @@ -1,4 +1,4 @@ -import { action, computed, IReactionDisposer, observable, ObservableMap, reaction, runInAction } from "mobx"; +import { action, computed, IReactionDisposer, observable, reaction, runInAction } from "mobx"; import { observer } from "mobx-react"; import { computedFn } from "mobx-utils"; import { Doc, HeightSym, Opt, StrListCast, WidthSym } from "../../../../fields/Doc"; @@ -48,7 +48,6 @@ import { CollectionFreeFormRemoteCursors } from "./CollectionFreeFormRemoteCurso import "./CollectionFreeFormView.scss"; import { MarqueeView } from "./MarqueeView"; import React = require("react"); -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; export const panZoomSchema = createSchema({ _panX: "number", @@ -90,8 +89,8 @@ export class CollectionFreeFormView extends CollectionSubView(); - private _layoutSizeData = new ObservableMap(); + private _layoutPoolData = observable.map(); + private _layoutSizeData = observable.map(); private _cachedPool: Map = new Map(); private _lastTap = 0; @@ -831,13 +830,14 @@ export class CollectionFreeFormView extends CollectionSubView pair.layout instanceof Doc).map(pair => pair.layout); - const measuredDocs = docs.filter(doc => doc && this.childDataProvider(doc, "")).map(doc => this.childDataProvider(doc, "")); + const measuredDocs = docs.filter(doc => doc && this.childDataProvider(doc, "") && this.childSizeProvider(doc, "")). + map(doc => ({ ...this.childDataProvider(doc, ""), ...this.childSizeProvider(doc, "") })); if (measuredDocs.length) { const ranges = measuredDocs.reduce(({ xrange, yrange }, { x, y, width, height }) => // computes range of content - ({ - xrange: { min: Math.min(xrange.min, x), max: Math.max(xrange.max, x + width) }, - yrange: { min: Math.min(yrange.min, y), max: Math.max(yrange.max, y + height) } - }) + ({ + xrange: { min: Math.min(xrange.min, x), max: Math.max(xrange.max, x + width) }, + yrange: { min: Math.min(yrange.min, y), max: Math.max(yrange.max, y + height) } + }) , { xrange: { min: Number.MAX_VALUE, max: -Number.MAX_VALUE }, yrange: { min: Number.MAX_VALUE, max: -Number.MAX_VALUE } -- cgit v1.2.3-70-g09d2 From f8de7d5bd84f989f4ca08b10d670345d6083ecdb Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 20 May 2021 17:32:12 -0400 Subject: changed size of filter buttons in sidebar --- src/client/views/SidebarAnnos.scss | 9 +++++---- src/client/views/SidebarAnnos.tsx | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/views/SidebarAnnos.scss b/src/client/views/SidebarAnnos.scss index 9686cce85..a0506cb3a 100644 --- a/src/client/views/SidebarAnnos.scss +++ b/src/client/views/SidebarAnnos.scss @@ -7,12 +7,13 @@ .sidebarAnnos-filterTag, .sidebarAnnos-filterTag-active, .sidebarAnnos-filterUser, .sidebarAnnos-filterUser-active { font-weight: bold; - padding-left: 6; - padding-right: 6; - box-shadow: black 1px 1px 4px; + font-size: 10px; + padding-left: 5; + padding-right: 5; + box-shadow: black 1px 1px 3px; border-radius: 5; margin: 2; - height: 20; + height: 15; background-color: lightgrey; } .sidebarAnnos-filterUser, .sidebarAnnos-filterUser-active { diff --git a/src/client/views/SidebarAnnos.tsx b/src/client/views/SidebarAnnos.tsx index bff4c95fc..59ff1c340 100644 --- a/src/client/views/SidebarAnnos.tsx +++ b/src/client/views/SidebarAnnos.tsx @@ -68,7 +68,7 @@ export class SidebarAnnos extends React.Component { return false; } sidebarKey = () => this.props.fieldKey + "-sidebar"; - filtersHeight = () => 50; + filtersHeight = () => 38; screenToLocalTransform = () => this.props.ScreenToLocalTransform().translate(Doc.NativeWidth(this.props.dataDoc), 0).scale(this.props.scaling?.() || 1); panelWidth = () => !this.props.layoutDoc._showSidebar ? 0 : this.props.layoutDoc.type === DocumentType.RTF ? this.props.PanelWidth() : (NumCast(this.props.layoutDoc.nativeWidth) - Doc.NativeWidth(this.props.dataDoc)) * this.props.PanelWidth() / NumCast(this.props.layoutDoc.nativeWidth); panelHeight = () => this.props.PanelHeight() - this.filtersHeight(); @@ -103,7 +103,8 @@ export class SidebarAnnos extends React.Component { width: `${this.panelWidth()}px`, height: "100%" }}> -
+
e.stopPropagation()}> {this.allUsers.map(renderUsers)} {this.allHashtags.map(renderTag)}
-- cgit v1.2.3-70-g09d2 From 4c1fc6bcfdf603bb8c620f9288da09ed69587bfb Mon Sep 17 00:00:00 2001 From: bobzel Date: Tue, 25 May 2021 09:58:55 -0400 Subject: fixed userColors to be set on mySharingDocs data document. fixed so that field is userColor everywhere (not color). --- src/client/util/CurrentUserUtils.ts | 2 +- src/client/util/SettingsManager.tsx | 2 +- src/client/util/SharingManager.tsx | 28 ++++++++++++++-------------- src/client/views/nodes/DocumentView.tsx | 2 +- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index 14bb87e89..12733e815 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -918,7 +918,7 @@ export class CurrentUserUtils { (sharedDocs as Doc)["acl-Public"] = (sharedDocs as Doc)[DataSym]["acl-Public"] = SharingPermissions.Add; } if (sharedDocs instanceof Doc) { - sharedDocs.userColor = sharedDocs.userColor || "rgb(202, 202, 202)"; + Doc.GetProto(sharedDocs).userColor = sharedDocs.userColor || "rgb(202, 202, 202)"; } doc.mySharedDocs = new PrefetchProxy(sharedDocs); } diff --git a/src/client/util/SettingsManager.tsx b/src/client/util/SettingsManager.tsx index ff7ce68ee..777394b05 100644 --- a/src/client/util/SettingsManager.tsx +++ b/src/client/util/SettingsManager.tsx @@ -58,7 +58,7 @@ export class SettingsManager extends React.Component<{}> { @undoBatch changeFontFamily = action((e: React.ChangeEvent) => Doc.UserDoc().fontFamily = (e.currentTarget as any).value); @undoBatch changeFontSize = action((e: React.ChangeEvent) => Doc.UserDoc().fontSize = (e.currentTarget as any).value); @undoBatch switchActiveBackgroundColor = action((color: ColorState) => Doc.UserDoc().activeCollectionBackground = String(color.hex)); - @undoBatch switchUserColor = action((color: ColorState) => Doc.SharingDoc().userColor = String(color.hex)); + @undoBatch switchUserColor = action((color: ColorState) => { Doc.SharingDoc().userColor = undefined; Doc.GetProto(Doc.SharingDoc()).userColor = String(color.hex); }); @undoBatch playgroundModeToggle = action(() => { this.playgroundMode = !this.playgroundMode; diff --git a/src/client/util/SharingManager.tsx b/src/client/util/SharingManager.tsx index 5a247730e..dc5f488b2 100644 --- a/src/client/util/SharingManager.tsx +++ b/src/client/util/SharingManager.tsx @@ -147,7 +147,7 @@ export class SharingManager extends React.Component<{}> { const a1 = await Cast(link?.anchor1, Doc, null); const a2 = await Cast(link?.anchor2, Doc, null); }); - sharingDocs.push({ user, sharingDoc, linkDatabase, userColor: StrCast(sharingDoc.color) }); + sharingDocs.push({ user, sharingDoc, linkDatabase, userColor: StrCast(sharingDoc.userColor) }); } } }); @@ -340,11 +340,11 @@ export class SharingManager extends React.Component<{}> { if (!uniform) dropdownValues.unshift("-multiple-"); if (override) dropdownValues.unshift("None"); return dropdownValues.filter(permission => permission !== SharingPermissions.View).map(permission => - ( - - ) + ( + + ) ); } @@ -518,10 +518,10 @@ export class SharingManager extends React.Component<{}> { {this.sharingOptions(uniform)} ) : ( -
- {permissions === SharingPermissions.Add ? "Can Augment" : permissions} -
- )} +
+ {permissions === SharingPermissions.Add ? "Can Augment" : permissions} +
+ )}
); @@ -592,10 +592,10 @@ export class SharingManager extends React.Component<{}> { {this.sharingOptions(uniform, group.title === "Override")} ) : ( -
- {permissions} -
- )} +
+ {permissions} +
+ )} ); diff --git a/src/client/views/nodes/DocumentView.tsx b/src/client/views/nodes/DocumentView.tsx index 7ec9f5f74..b861669f8 100644 --- a/src/client/views/nodes/DocumentView.tsx +++ b/src/client/views/nodes/DocumentView.tsx @@ -927,7 +927,7 @@ export class DocumentViewInternal extends DocComponent users.user.email === this.dataDoc.author)?.userColor || (this.rootDoc.type === DocumentType.RTF ? StrCast(Doc.SharingDoc().userColor) : "rgba(0,0,0,0.4)"), + background: StrCast(SharingManager.Instance.users.find(users => users.user.email === this.dataDoc.author)?.sharingDoc.userColor, this.rootDoc.type === DocumentType.RTF ? StrCast(Doc.SharingDoc().userColor) : "rgba(0,0,0,0.4)"), pointerEvents: this.onClickHandler || this.Document.ignoreClick ? "none" : undefined, }}>