From bf16eca7a84adfdf1c5970e7e4793568ee70325d Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Tue, 13 Jun 2023 22:14:29 -0400
Subject: fixed updating cached docs when opening a backlinks collection. 
 added some FieldInfo types and added 'enumeration' field display in schema
 view.  fixed bug in schema view column sizing.   updated a bunch of standard
 field names to be more consistent.

---
 src/client/views/DocumentButtonBar.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/client/views/DocumentButtonBar.tsx')

diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 547d844ca..35b0b22a8 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -589,7 +589,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
                         <LinkPopup
                             key="popup"
                             showPopup={this._showLinkPopup}
-                            linkCreated={link => (link.layout_linkDisplay = !IsFollowLinkScript(this.props.views().lastElement()?.rootDoc.onClick))}
+                            linkCreated={link => (link.link_displayLine = !IsFollowLinkScript(this.props.views().lastElement()?.rootDoc.onClick))}
                             linkCreateAnchor={() => this.props.views().lastElement()?.ComponentView?.getAnchor?.(true)}
                             linkFrom={() => this.props.views().lastElement()?.rootDoc}
                         />
-- 
cgit v1.2.3-70-g09d2


From c99238c8b1e027099b2cd3f4b31b4c0b06d488d0 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Thu, 29 Jun 2023 14:59:29 -0400
Subject: made recording annotation undoable.  fixed doc filters for dates,
 change filter to use :: instead of :

---
 src/client/documents/Documents.ts      |  4 ++--
 src/client/views/DocumentButtonBar.tsx |  1 +
 src/client/views/FilterPanel.tsx       | 14 +++++++-------
 src/fields/Doc.ts                      |  6 ++++--
 4 files changed, 14 insertions(+), 11 deletions(-)

(limited to 'src/client/views/DocumentButtonBar.tsx')

diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts
index acd323eca..00864c6fd 100644
--- a/src/client/documents/Documents.ts
+++ b/src/client/documents/Documents.ts
@@ -1213,7 +1213,7 @@ export namespace DocUtils {
 
         const filterFacets: { [key: string]: { [value: string]: string } } = {}; // maps each filter key to an object with value=>modifier fields
         childFilters.forEach(filter => {
-            const fields = filter.split(':');
+            const fields = filter.split(Doc.FilterSep);
             const key = fields[0];
             const value = fields[1];
             const modifiers = fields[2];
@@ -1231,7 +1231,7 @@ export namespace DocUtils {
                       return false;
                   }
 
-                  for (const facetKey of Object.keys(filterFacets).filter(fkey => fkey !== 'cookies' && fkey !== Utils.noDragsDocFilter.split(':')[0])) {
+                  for (const facetKey of Object.keys(filterFacets).filter(fkey => fkey !== 'cookies' && fkey !== Utils.noDragsDocFilter.split(Doc.FilterSep)[0])) {
                       const facet = filterFacets[facetKey];
 
                       // facets that match some value in the field of the document (e.g. some text field)
diff --git a/src/client/views/DocumentButtonBar.tsx b/src/client/views/DocumentButtonBar.tsx
index 35b0b22a8..16f5ad168 100644
--- a/src/client/views/DocumentButtonBar.tsx
+++ b/src/client/views/DocumentButtonBar.tsx
@@ -464,6 +464,7 @@ export class DocumentButtonBar extends React.Component<{ views: () => (DocumentV
                             action(() => {
                                 this._isRecording = false;
                                 this._stopFunc();
+                                b.end();
                             }),
                             emptyFunction
                         );
diff --git a/src/client/views/FilterPanel.tsx b/src/client/views/FilterPanel.tsx
index fe42628cd..a5c18cd8b 100644
--- a/src/client/views/FilterPanel.tsx
+++ b/src/client/views/FilterPanel.tsx
@@ -71,7 +71,7 @@ export class FilterPanel extends React.Component<filterProps> {
      * @returns a string array of the current attributes
      */
     @computed get currentFacets() {
-        return this.activeFilters.map(filter => filter.split(':')[0]);
+        return this.activeFilters.map(filter => filter.split(Doc.FilterSep)[0]);
     }
 
     gatherFieldValues(childDocs: Doc[], facetKey: string) {
@@ -108,8 +108,8 @@ export class FilterPanel extends React.Component<filterProps> {
     @observable _chosenFacets = new ObservableMap<string, 'text' | 'checkbox' | 'slider' | 'range'>();
     @computed get activeFacets() {
         const facets = new Map<string, 'text' | 'checkbox' | 'slider' | 'range'>(this._chosenFacets);
-        StrListCast(this.targetDoc?._childFilters).map(filter => facets.set(filter.split(':')[0], filter.split(':')[2] === 'match' ? 'text' : 'checkbox'));
-        setTimeout(() => StrListCast(this.targetDoc?._childFilters).map(action(filter => this._chosenFacets.set(filter.split(':')[0], filter.split(':')[2] === 'match' ? 'text' : 'checkbox'))));
+        StrListCast(this.targetDoc?._childFilters).map(filter => facets.set(filter.split(Doc.FilterSep)[0], filter.split(Doc.FilterSep)[2] === 'match' ? 'text' : 'checkbox'));
+        setTimeout(() => StrListCast(this.targetDoc?._childFilters).map(action(filter => this._chosenFacets.set(filter.split(Doc.FilterSep)[0], filter.split(Doc.FilterSep)[2] === 'match' ? 'text' : 'checkbox'))));
         return facets;
     }
     /**
@@ -203,8 +203,8 @@ export class FilterPanel extends React.Component<filterProps> {
                     <input
                         placeholder={
                             StrListCast(this.targetDoc._childFilters)
-                                .find(filter => filter.split(':')[0] === facetHeader)
-                                ?.split(':')[1] ?? '-empty-'
+                                .find(filter => filter.split(Doc.FilterSep)[0] === facetHeader)
+                                ?.split(Doc.FilterSep)[1] ?? '-empty-'
                         }
                         onBlur={undoable(e => Doc.setDocFilter(this.targetDoc, facetHeader, e.currentTarget.value, !e.currentTarget.value ? 'remove' : 'match'), 'set text filter')}
                         onKeyDown={e => e.key === 'Enter' && undoable(e => Doc.setDocFilter(this.targetDoc, facetHeader, e.currentTarget.value, !e.currentTarget.value ? 'remove' : 'match'), 'set text filter')(e)}
@@ -219,8 +219,8 @@ export class FilterPanel extends React.Component<filterProps> {
                                 style={{ width: 20, marginLeft: 20 }}
                                 checked={
                                     StrListCast(this.targetDoc._childFilters)
-                                        .find(filter => filter.split(':')[0] === facetHeader && filter.split(':')[1] == facetValue)
-                                        ?.split(':')[2] === 'check'
+                                        .find(filter => filter.split(Doc.FilterSep)[0] === facetHeader && filter.split(Doc.FilterSep)[1] == facetValue)
+                                        ?.split(Doc.FilterSep)[2] === 'check'
                                 }
                                 type={type}
                                 onChange={undoable(e => Doc.setDocFilter(this.targetDoc, facetHeader, fval, e.target.checked ? 'check' : 'remove'), 'set filter')}
diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts
index c9f7e4114..f13dab68c 100644
--- a/src/fields/Doc.ts
+++ b/src/fields/Doc.ts
@@ -1430,6 +1430,8 @@ export namespace Doc {
         }
     }
 
+    export const FilterSep = '::';
+
     // filters document in a container collection:
     // all documents with the specified value for the specified key are included/excluded
     // based on the modifiers :"check", "x", undefined
@@ -1439,7 +1441,7 @@ export namespace Doc {
         const childFilters = StrListCast(container[filterField]);
         runInAction(() => {
             for (let i = 0; i < childFilters.length; i++) {
-                const fields = childFilters[i].split(':'); // split key:value:modifier
+                const fields = childFilters[i].split(FilterSep); // split key:value:modifier
                 if (fields[0] === key && (fields[1] === value || modifiers === 'match' || (fields[2] === 'match' && modifiers === 'remove'))) {
                     if (fields[2] === modifiers && modifiers && fields[1] === value) {
                         if (toggle) modifiers = 'remove';
@@ -1454,7 +1456,7 @@ export namespace Doc {
                 container[filterField] = undefined;
             } else if (modifiers !== 'remove') {
                 !append && (childFilters.length = 0);
-                childFilters.push(key + ':' + value + ':' + modifiers);
+                childFilters.push(key + FilterSep + value + FilterSep + modifiers);
                 container[filterField] = new List<string>(childFilters);
             }
         });
-- 
cgit v1.2.3-70-g09d2

