diff options
| author | bobzel <zzzman@gmail.com> | 2024-09-20 14:49:46 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-09-20 14:49:46 -0400 |
| commit | 702949ed50a1d9819d58a6154fee20d086664505 (patch) | |
| tree | ea1e8fc9300b8ea96f7c6ee1e63023ba5f7c1620 /src/client/views/collections | |
| parent | 77e087625bd02cfa170e3f1903b0a744b81380ce (diff) | |
| parent | 650ddd4c72510ed29d023d4861dedede0737d3b9 (diff) | |
Merge branch 'master' into zach-starter
Diffstat (limited to 'src/client/views/collections')
| -rw-r--r-- | src/client/views/collections/CollectionCardDeckView.scss | 6 | ||||
| -rw-r--r-- | src/client/views/collections/CollectionCardDeckView.tsx | 45 |
2 files changed, 11 insertions, 40 deletions
diff --git a/src/client/views/collections/CollectionCardDeckView.scss b/src/client/views/collections/CollectionCardDeckView.scss index e5fb7aba6..d1731c244 100644 --- a/src/client/views/collections/CollectionCardDeckView.scss +++ b/src/client/views/collections/CollectionCardDeckView.scss @@ -8,11 +8,7 @@ overflow: hidden; button { - width: 35px; - height: 35px; border-radius: 50%; - background-color: $dark-gray; - margin: 5px; // transform: translateY(-50px); } } @@ -40,7 +36,7 @@ .card-item-active, .card-item { position: relative; - transition: transform 0.5s ease-in-out; + transition: transform 0.3s ease-in-out; display: flex; flex-direction: column; } diff --git a/src/client/views/collections/CollectionCardDeckView.tsx b/src/client/views/collections/CollectionCardDeckView.tsx index bcb42111f..d9c27254a 100644 --- a/src/client/views/collections/CollectionCardDeckView.tsx +++ b/src/client/views/collections/CollectionCardDeckView.tsx @@ -3,7 +3,7 @@ import { observer } from 'mobx-react'; import * as React from 'react'; import { ClientUtils, DashColor, returnFalse, returnZero } from '../../../ClientUtils'; import { emptyFunction } from '../../../Utils'; -import { Doc, StrListCast } from '../../../fields/Doc'; +import { Doc } from '../../../fields/Doc'; import { DocData } from '../../../fields/DocSymbols'; import { Id } from '../../../fields/FieldSymbols'; import { List } from '../../../fields/List'; @@ -18,6 +18,7 @@ import { SnappingManager } from '../../util/SnappingManager'; import { Transform } from '../../util/Transform'; import { undoable } from '../../util/UndoManager'; import { StyleProp } from '../StyleProp'; +import { TagItem } from '../TagsView'; import { DocumentView } from '../nodes/DocumentView'; import { GPTPopup, GPTPopupMode } from '../pdf/GPTPopup/GPTPopup'; import './CollectionCardDeckView.scss'; @@ -242,7 +243,6 @@ export class CollectionCardView extends CollectionSubView() { const currRow = Math.floor((mouseY - 100) / rowHeight); //rows start at 0 if (adjustedX < 0) { - console.log('DROP INDEX NO '); return 0; // Before the first column } @@ -257,7 +257,6 @@ export class CollectionCardView extends CollectionSubView() { index = Math.floor(adjustedX / cardWidth) + currRow * this._maxRowCount; } - console.log('DROP INDEX = ' + index); return index; }; @@ -327,35 +326,11 @@ export class CollectionCardView extends CollectionSubView() { * @returns its value based on its tags */ - tagValue = (doc: Doc) => { - const keys = Doc.MyFilterHotKeys; - - const isTagActive = (key: Doc) => BoolCast(key.active); - - let base = ''; - let fraction = ''; - - keys.forEach(key => { - if (isTagActive(key)) { - if (base === '') { - base = StrCast(key.toolType); // First active tag becomes the base - } else { - fraction += StrCast(key.toolType); // Subsequent active tags become part of the fraction - } - } - }); - - // If no tag was active, return 0 by default - if (base === '') { - return 0; - } - - // Construct the final number by appending the fraction if it exists - const numberString = fraction ? `${base}.${fraction}` : base; - - // Convert the result to a number and return - return Number(numberString); - }; + tagValue = (doc: Doc) => + Doc.MyFilterHotKeys.map((key, i) => ({ has: TagItem.docHasTag(doc, StrCast(key.toolType)), i })) + .filter(({ has }) => has) + .map(({ i }) => i) + .join('.'); /** * Called in the sortedDocsType method. Compares the cards' value in regards to the desired sort type-- earlier cards are move to the @@ -492,7 +467,7 @@ export class CollectionCardView extends CollectionSubView() { }; const docTextPromises = this.childDocsWithoutLinks.map(async doc => { const docText = (await docToText(doc)) ?? ''; - doc['gptInputText'] = docText; + doc.gptInputText = docText; this._textToDoc.set(docText.replace(/\n/g, ' ').trim(), doc); return `======${docText.replace(/\n/g, ' ').trim()}======`; }); @@ -532,7 +507,7 @@ export class CollectionCardView extends CollectionSubView() { if (questionType === '2' || questionType === '4') { this.childDocs.forEach(d => { - d['chatFilter'] = false; + d.chatFilter = false; }); } @@ -573,7 +548,7 @@ export class CollectionCardView extends CollectionSubView() { } case '2': case '4': - doc['chatFilter'] = true; + doc.chatFilter = true; Doc.setDocFilter(DocCast(this.Document.embedContainer), 'chatFilter', true, 'match'); break; } |
