From 8087490d041d1618f64ea03be5d222f57c15fc41 Mon Sep 17 00:00:00 2001 From: Fernando Silva Date: Sat, 25 Jan 2025 21:31:13 -0300 Subject: [PATCH 01/38] fix(search): fix create shortcut to use filter as name --- src/ts/component/popup/search.tsx | 12 +++++++++++- src/ts/lib/keyboard.ts | 6 ++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/ts/component/popup/search.tsx b/src/ts/component/popup/search.tsx index 1ebef99642..93a9344056 100644 --- a/src/ts/component/popup/search.tsx +++ b/src/ts/component/popup/search.tsx @@ -436,6 +436,12 @@ const PopupSearch = observer(class PopupSearch extends React.Component { + e.preventDefault(); + + this.pageCreate(filter); + }) }; onArrow (dir: number) { @@ -775,6 +781,10 @@ const PopupSearch = observer(class PopupSearch extends React.Component { - e.preventDefault(); - this.pageCreate({}, analytics.route.shortcut, [ I.ObjectFlag.SelectType, I.ObjectFlag.SelectTemplate, I.ObjectFlag.DeleteEmpty ]); + if (!S.Popup.isOpen('search')) { + e.preventDefault(); + this.pageCreate({}, analytics.route.shortcut, [ I.ObjectFlag.SelectType, I.ObjectFlag.SelectTemplate, I.ObjectFlag.DeleteEmpty ]); + } }); // Lock/Unlock From 36460ea03295e4f6eac0f3040efdfeab2a085172 Mon Sep 17 00:00:00 2001 From: Fernando Silva Date: Mon, 27 Jan 2025 10:53:00 -0300 Subject: [PATCH 02/38] fix(search): fix formatting and pageCreate route --- src/ts/component/popup/search.tsx | 6 +++--- src/ts/lib/keyboard.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/ts/component/popup/search.tsx b/src/ts/component/popup/search.tsx index 93a9344056..f3e8f98b19 100644 --- a/src/ts/component/popup/search.tsx +++ b/src/ts/component/popup/search.tsx @@ -781,9 +781,9 @@ const PopupSearch = observer(class PopupSearch extends React.Component { - if (!S.Popup.isOpen('search')) { + if (!S.Popup.isOpen('search')) { + this.shortcut(`${cmd}+n`, e, () => { e.preventDefault(); this.pageCreate({}, analytics.route.shortcut, [ I.ObjectFlag.SelectType, I.ObjectFlag.SelectTemplate, I.ObjectFlag.DeleteEmpty ]); - } - }); + }); + }; // Lock/Unlock this.shortcut(`ctrl+shift+l`, e, () => { From b24804242563d48e843e9aa93a4a54f91fbad845 Mon Sep 17 00:00:00 2001 From: Mike Mhlv Date: Mon, 27 Jan 2025 14:19:37 +0000 Subject: [PATCH 03/38] update --- src/scss/component/editor.scss | 3 +- src/ts/docs/help/whatsNew.ts | 55 +++++++++++++++++++++++----------- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/src/scss/component/editor.scss b/src/scss/component/editor.scss index 9070a4e422..65d9314752 100644 --- a/src/scss/component/editor.scss +++ b/src/scss/component/editor.scss @@ -98,6 +98,7 @@ .full, .c100 { width: 100%; } .half, .c50 { width: 50%; } + .c40 { width: 40%; } .c60 { width: 60%; } .c70 { width: 70%; } .screen { box-shadow: 0px 0px 25px rgba(0,0,0,0.2); } @@ -271,4 +272,4 @@ &.withIconAndCover { .controlButtons { left: 0px !important; } } -} \ No newline at end of file +} diff --git a/src/ts/docs/help/whatsNew.ts b/src/ts/docs/help/whatsNew.ts index 958c2fba37..3a87a22b21 100644 --- a/src/ts/docs/help/whatsNew.ts +++ b/src/ts/docs/help/whatsNew.ts @@ -22,51 +22,70 @@ export default [ //{ type: I.BlockType.IconPage, icon: '🎄' }, title(`Desktop 0.45.0 Released!`), - text('We are really excited to announce such a big update to Anytype, bringing important features that have been several months in the making – features that many of you have been asking for a long time: Web Publishing, Raycast extension and RTL support. As you explore them, please kindly note that they represent the huge step toward a more powerful Anytype. We’ll be enriching these experiences with more features in the coming months, so your feedback is, as always, warmly welcomed.'), + text('Hello Anytypers! We’re excited to share a major update you’ve been eagerly awaiting. Version 0.45.0 introduces Web Publishing, a Raycast extension, RTL support, and a host of quality-of-life improvements — all inspired by your requests and feedback. Thank you for helping us shape Anytype into a friendlier, more powerful tool for everyone.'), text(''), h2(`Highlights`), h3(`Redesigned Space Panel & Navigation`), - text(`The left sidebar now functions as a navigation panel, as a Space Panel. It serves as a hub for quick and compact access to the main space controls, provides easy navigation to its contents, and is visually distinct from the customisable widgets. You can also view the synchronization status of the space here.`), - text(`For even quicker access, or if the sidebar is hidden, use ${hl(`${cmd} + S`)} to open the Global Search and ${hl(`${cmd} + N`)} to create a new Object.`), + text(`We’ve relocated the navigation controls to the Space Panel for a smoother experience. You can now navigate back and forth, search for Objects, and create new ones from a familiar place.`), + text(`Pro tip: if your sidebar is hidden, press ${hl(`${cmd} + S`)} to open Global Search or ${hl(`${cmd} + N`)} to create a new Object.`), img(`45/1.png`), text(``), h3(`Web Publishing`), - text(`One of the most requested features is finally here: the ability to publish Objects as static pages available on the web (HTTPS links). The published Object will be uploaded to our server and accessible via the URL as an unencrypted HTML page. If you have an any-name, your pages will be published on your personal subdomain.`), - text(`Note: Linked objects and some blocks such as Sets, Collections and Relations are not supported at this stage. More enhancements along with multi-page support will be implemented in the future to cover more use cases.`), + text(`You can now publish Objects as static web pages (HTTPS links) on your personal subdomain if you have *any name. These pages are uploaded to our servers as unencrypted HTML files.`), + text(`This is an early version — mobile optimization, linked Objects, and blocks like Sets, Collections and Relations aren’t supported yet. Multi-page publishing and other enhancements are on the way, and we’d love your feedback to guide these improvements.`), img(`45/2.png`), text(``), h3(`Raycast Extension (macOS)`), - text(`The first implementation based on our local API, currently in prototype form and not yet open. Raycast integration v1 works via local endpoint, which supports a limited amount of operations (create, read, delete) for spaces, objects, types, and allows you to search across spaces.`), - text(`Right now, the extension is available only for Mac users, but we plan to release an open API with use cases such as Bulk Import and Export, NoCode tools and integrations in the future.`), + text(`Our long-awaited API is beginning to take shape! The first step is Raycast integration, allowing you to create, read, and delete Spaces, Objects, and Types, as well as search across them, all from Raycast on macOS.`), + text(`While this initial version focuses on a basic set of features, we’re laying the groundwork for an open API that will eventually support bulk import and export, NoCode tools, and more integrations. We’re excited to see what you’ll build!`), + text(`${link('https://www.raycast.com/any/anytype', 'Install the Raycast Extension here')}`), img(`45/3.png`), text(``), h3(`RTL Support`), - text(`Introducing Right-to-Left language support. Since this is our first implementation, we are looking forward to your testing and feedback to help address any specific cases requiring further adjustments.`), + text(`We’re happy to introduce right-to-left language support! This first iteration might need some extra polish, so your feedback is invaluable. Let us know what works and what needs a bit more attention.`), video(`45/4.mp4`), text(``), h2(`Quality-of-Life`), - bullet(`Added a new option to add existing Objects to Collection, available in the updated arrow menu alongside other content-related settings.`), - img(`45/5.png`, `c60`), + text(``), + text(`Add Existing Objects to a Collection`), + text(`We’ve added an option to add existing Objects into a Collection. Look for it in the updated arrow menu alongside other content settings.`), + img(`45/5.png`, `c50`), text(``), - bullet(`Horizontal alignment has been added to the Grid layout: each column can be set to align left, center or right.`), + text(`Horizontal Alignment in Grid Layout`), + text(`Columns in the Grid layout can now be aligned left, center, or right.`), img(`45/6.png`, `c60`), text(``), - bullet(`Updated Widget Settings menu: removed the ability to change widget source and ${hl('Edit Widgets')} action. The appearance section now contains only options to change widget view (Compact List, List, View, Link) and the number of objects has been moved to a separate section.`), - img(`45/7.png`, `c60`), + text(`Simplified Widget Settings Menu`), + bullet(`Appearance options are now limited to changing the widget’s view (Compact List, List, View, Link).`), + bullet(`The "Number of Objects" setting has moved to its own section.`), + img(`45/7.png`, `c40`), text(``), - bullet(`Diagrams in the Kroki embed block support links. Thanks, @${link('https://community.anytype.io/t/kroki-links-are-not-usable/25543', 'siousu')}!`), - bullet(`Updated the color of text selection in dark mode to improve visibility. Thanks, @${link('https://community.anytype.io/t/selected-text-background-color-on-a-given-object-heavily-dependent-on-monitor-settings/25509', 'kermit_frog')}!`), - bullet(`Inline Set header adapts to resizing, preventing controls from overlapping a block next to it.`), - bullet(`Images copied from the Safari browser (macOS) are now pasted into the object editor as files, not URLs.`), - bullet(`The QR code appearance has been standardized.`), + text(`Clickable Links in Kroki Diagrams`), + text(`Kroki embed blocks now support links within diagrams. Thanks to @${link('https://community.anytype.io/t/kroki-links-are-not-usable/25543', 'siousu')} for the suggestion!`), + text(``), + + text(`Improved Dark Mode Text Selection`), + text(`We tweaked the selection color for better visibility. Shout-out to @${link('https://community.anytype.io/t/selected-text-background-color-on-a-given-object-heavily-dependent-on-monitor-settings/25509', 'kermit_frog')} for flagging this!`), + text(``), + + text(`Inline Set Header Resize Adjustments`), + text(`Inline Set headers now adapt when resizing to keep controls from overlapping neighboring blocks.`), + text(``), + + text(`Better Image Pasting on macOS Safari`), + text(`Images copied from Safari will now paste into the object editor as files instead of URLs.`), + text(``), + + text(`Standardized QR Code Appearance`), + text(`All QR codes in Anytype now follow a consistent style.`), text(``), h2(`Bug Fixes`), From ca40ef0938936727a887c334382e4b4a159d4330 Mon Sep 17 00:00:00 2001 From: Mike Mhlv Date: Mon, 27 Jan 2025 14:25:36 +0000 Subject: [PATCH 04/38] update --- src/ts/docs/help/whatsNew.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ts/docs/help/whatsNew.ts b/src/ts/docs/help/whatsNew.ts index 3a87a22b21..3213374083 100644 --- a/src/ts/docs/help/whatsNew.ts +++ b/src/ts/docs/help/whatsNew.ts @@ -52,39 +52,39 @@ export default [ h2(`Quality-of-Life`), text(``), - text(`Add Existing Objects to a Collection`), + h3(`Add Existing Objects to a Collection`), text(`We’ve added an option to add existing Objects into a Collection. Look for it in the updated arrow menu alongside other content settings.`), img(`45/5.png`, `c50`), text(``), - text(`Horizontal Alignment in Grid Layout`), + h3(`Horizontal Alignment in Grid Layout`), text(`Columns in the Grid layout can now be aligned left, center, or right.`), img(`45/6.png`, `c60`), text(``), - text(`Simplified Widget Settings Menu`), + h3(`Simplified Widget Settings Menu`), bullet(`Appearance options are now limited to changing the widget’s view (Compact List, List, View, Link).`), bullet(`The "Number of Objects" setting has moved to its own section.`), img(`45/7.png`, `c40`), text(``), - text(`Clickable Links in Kroki Diagrams`), + h3(`Clickable Links in Kroki Diagrams`), text(`Kroki embed blocks now support links within diagrams. Thanks to @${link('https://community.anytype.io/t/kroki-links-are-not-usable/25543', 'siousu')} for the suggestion!`), text(``), - text(`Improved Dark Mode Text Selection`), + h3(`Improved Dark Mode Text Selection`), text(`We tweaked the selection color for better visibility. Shout-out to @${link('https://community.anytype.io/t/selected-text-background-color-on-a-given-object-heavily-dependent-on-monitor-settings/25509', 'kermit_frog')} for flagging this!`), text(``), - text(`Inline Set Header Resize Adjustments`), + h3(`Inline Set Header Resize Adjustments`), text(`Inline Set headers now adapt when resizing to keep controls from overlapping neighboring blocks.`), text(``), - text(`Better Image Pasting on macOS Safari`), + h3(`Better Image Pasting on macOS Safari`), text(`Images copied from Safari will now paste into the object editor as files instead of URLs.`), text(``), - text(`Standardized QR Code Appearance`), + h3(`Standardized QR Code Appearance`), text(`All QR codes in Anytype now follow a consistent style.`), text(``), From 1cbefc3f133403186447853a195bae9034e28d8c Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 27 Jan 2025 18:14:14 +0100 Subject: [PATCH 05/38] JS-6316: fix --- src/ts/component/widget/space.tsx | 3 ++- src/ts/lib/keyboard.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ts/component/widget/space.tsx b/src/ts/component/widget/space.tsx index b1d38404c6..7c5b168dae 100644 --- a/src/ts/component/widget/space.tsx +++ b/src/ts/component/widget/space.tsx @@ -12,6 +12,7 @@ const WidgetSpace = observer(forwardRef<{}, I.WidgetComponent>((props, ref) => { const isSpaceOwner = U.Space.isMyOwner(); const cn = [ 'body' ]; const cmd = keyboard.cmdSymbol(); + const alt = keyboard.altSymbol(); const buttons = [ space.chatId && U.Object.isAllowedChat() ? { id: 'chat', name: translate('commonMainChat') } : null, space.isShared ? { id: 'member', name: translate('commonMembers') } : null, @@ -269,7 +270,7 @@ const WidgetSpace = observer(forwardRef<{}, I.WidgetComponent>((props, ref) => {
- +
diff --git a/src/ts/lib/keyboard.ts b/src/ts/lib/keyboard.ts index 34fd2ce680..7993738bfb 100644 --- a/src/ts/lib/keyboard.ts +++ b/src/ts/lib/keyboard.ts @@ -237,6 +237,11 @@ class Keyboard { $('#button-header-relation').trigger('click'); }); + // Select type + this.shortcut(`${cmd}+alt+n`, e, () => { + $('#widget-space #widget-space-arrow').trigger('click'); + }); + // Switch dark/light mode this.shortcut(`${cmd}+shift+m`, e, () => { Action.themeSet(!theme ? 'dark' : ''); From cc06d3ec28abbcc31b47f2f1dbeb357e8c22f34c Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 27 Jan 2025 18:26:35 +0100 Subject: [PATCH 06/38] JS-6316: update --- src/scss/widget/space.scss | 8 ++++++-- src/ts/component/popup/settings/onboarding.tsx | 5 ++--- src/ts/component/widget/space.tsx | 18 ++++++++++++++---- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/scss/widget/space.scss b/src/scss/widget/space.scss index deb65b4745..a48a84e3d1 100644 --- a/src/scss/widget/space.scss +++ b/src/scss/widget/space.scss @@ -18,10 +18,14 @@ .side.right { flex-shrink: 0; display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 0px 4px; } .side.right { - .icon { width: 24px !important; height: 24px !important; flex-shrink: 0; } + .icon { width: 24px !important; height: 24px !important; flex-shrink: 0; border-radius: 4px; } .icon.search { background-image: url('~img/icon/widget/button/search.svg'); } + + .plusWrapper { border-radius: 4px; } + .plusWrapper:hover { background-color: var(--color-shape-highlight-medium); } + .icon.plus { background-image: url('~img/icon/widget/button/plus.svg'); } - .icon.arrow { background-image: url('~img/icon/widget/button/arrow.svg'); } + .icon.arrow { width: 20px !important; background-image: url('~img/icon/widget/button/arrow.svg'); } } } diff --git a/src/ts/component/popup/settings/onboarding.tsx b/src/ts/component/popup/settings/onboarding.tsx index 5b39dddcb9..85ed377f50 100644 --- a/src/ts/component/popup/settings/onboarding.tsx +++ b/src/ts/component/popup/settings/onboarding.tsx @@ -226,10 +226,9 @@ const PopupSettingsOnboarding = observer(class PopupSettingsOnboarding extends R }; onTooltipShow (e: any, text: string) { - if (!text) { - return; + if (text) { + Preview.tooltipShow({ text, element: $(e.currentTarget) }); }; - Preview.tooltipShow({ text, element: $(e.currentTarget) }); }; onTooltipHide () { diff --git a/src/ts/component/widget/space.tsx b/src/ts/component/widget/space.tsx index 7c5b168dae..0c293c2523 100644 --- a/src/ts/component/widget/space.tsx +++ b/src/ts/component/widget/space.tsx @@ -1,12 +1,13 @@ -import React, { forwardRef, MouseEvent } from 'react'; +import React, { forwardRef, useRef, MouseEvent } from 'react'; import { observer } from 'mobx-react'; import { Icon, IconObject, ObjectName } from 'Component'; -import { I, S, U, C, J, translate, sidebar, keyboard, analytics, Storage, Action } from 'Lib'; +import { I, S, U, C, J, translate, sidebar, keyboard, analytics, Storage, Action, Preview } from 'Lib'; const WidgetSpace = observer(forwardRef<{}, I.WidgetComponent>((props, ref) => { const { parent } = props; const space = U.Space.getSpaceview(); + const plusRef = useRef(null); const participants = U.Space.getParticipantsList([ I.ParticipantStatus.Active, I.ParticipantStatus.Joining, I.ParticipantStatus.Removing ]); const requestCnt = participants.filter(it => it.isJoining || it.isRemoving).length; const isSpaceOwner = U.Space.isMyOwner(); @@ -249,6 +250,12 @@ const WidgetSpace = observer(forwardRef<{}, I.WidgetComponent>((props, ref) => { }; }; + const onPlusHover = (e: MouseEvent) => { + const t = Preview.tooltipCaption(translate('commonCreateNewObject'), `${cmd} + N / ${cmd} + ${alt} + N`); + + Preview.tooltipShow({ text: t, element: $(plusRef.current) }); + }; + return (
((props, ref) => {
- - + +
Preview.tooltipHide()}> + + +
From 04bc67d70207273bcfb0b5bc6a459015f9c2a3cc Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Mon, 27 Jan 2025 20:30:15 +0100 Subject: [PATCH 07/38] JS-6279: fix --- src/ts/component/widget/space.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ts/component/widget/space.tsx b/src/ts/component/widget/space.tsx index 0c293c2523..2760d1d195 100644 --- a/src/ts/component/widget/space.tsx +++ b/src/ts/component/widget/space.tsx @@ -11,6 +11,7 @@ const WidgetSpace = observer(forwardRef<{}, I.WidgetComponent>((props, ref) => { const participants = U.Space.getParticipantsList([ I.ParticipantStatus.Active, I.ParticipantStatus.Joining, I.ParticipantStatus.Removing ]); const requestCnt = participants.filter(it => it.isJoining || it.isRemoving).length; const isSpaceOwner = U.Space.isMyOwner(); + const canWrite = U.Space.canMyParticipantWrite(); const cn = [ 'body' ]; const cmd = keyboard.cmdSymbol(); const alt = keyboard.altSymbol(); @@ -277,10 +278,12 @@ const WidgetSpace = observer(forwardRef<{}, I.WidgetComponent>((props, ref) => {
-
Preview.tooltipHide()}> - - -
+ {canWrite ? ( +
Preview.tooltipHide()}> + + +
+ ) : ''}
From 256800884c15a229e83b475bbee2278708d023b7 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Tue, 28 Jan 2025 12:58:59 +0100 Subject: [PATCH 08/38] JS-6330: fix --- src/scss/block/dataview/view/common.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/block/dataview/view/common.scss b/src/scss/block/dataview/view/common.scss index d04b6a9152..157d3e59b5 100644 --- a/src/scss/block/dataview/view/common.scss +++ b/src/scss/block/dataview/view/common.scss @@ -25,7 +25,7 @@ .cardContent > .inner { padding: 16px; } .cover { - position: relative; aspect-ratio: 7/3; background-position: top center; display: flex; align-items: center; + position: relative; aspect-ratio: 16/9; background-position: top center; display: flex; align-items: center; background-color: var(--color-shape-highlight-medium); width: 100%; justify-content: center; border-radius: 8px 8px 0px 0px; overflow: hidden; } From 5024c76fbcf91628886c71f3f5b705f127200807 Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Tue, 28 Jan 2025 13:55:00 +0100 Subject: [PATCH 09/38] JS-6237: fix --- src/ts/lib/preview.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ts/lib/preview.ts b/src/ts/lib/preview.ts index dc02a5ea30..62654af733 100644 --- a/src/ts/lib/preview.ts +++ b/src/ts/lib/preview.ts @@ -132,6 +132,13 @@ class Preview { window.clearTimeout(this.timeout.delay); this.timeout.delay = window.setTimeout(() => this.delayTooltip = delay, 500); this.delayTooltip = 100; + + win.off('click.tooltip').on('click.tooltip', () => { + this.tooltipHide(true); + + win.off('click.tooltip'); + }); + }, this.delayTooltip); }; From ba319fcbf1ff669f713de14069f61a8d0c7915ae Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Tue, 28 Jan 2025 14:52:47 +0100 Subject: [PATCH 10/38] JS-6256: fix --- src/scss/menu/publish.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/menu/publish.scss b/src/scss/menu/publish.scss index 35a1a637a7..f9eade5bdb 100644 --- a/src/scss/menu/publish.scss +++ b/src/scss/menu/publish.scss @@ -27,7 +27,7 @@ .label { color: var(--color-text-secondary); } } - .error { margin: 0px; } + .error { margin: 0px; text-align: center; } .outer { position: absolute; left: 0px; bottom: 0px; transform: translateY(calc(100% + 8px)); width: 100%; box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.2); From 08961e661a03fd4aabcfa15770037637aa029ca0 Mon Sep 17 00:00:00 2001 From: Mike Mhlv Date: Tue, 28 Jan 2025 15:40:50 +0000 Subject: [PATCH 11/38] fix --- src/ts/component/menu/publish.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/menu/publish.tsx b/src/ts/component/menu/publish.tsx index 955d37f13a..95747e651d 100644 --- a/src/ts/component/menu/publish.tsx +++ b/src/ts/component/menu/publish.tsx @@ -144,7 +144,7 @@ const MenuPublish = observer(forwardRef((props, ref) => { if (isStatusLoaded && isOnline) { if (status === null) { - buttons.push({ text: translate('menuPublishButtonPublish'), ref: publishRef, onClick: onPublish }); + buttons.push({ text: translate('menuPublishButtonPublish'), ref: publishRef, onClick: () => onPublish() }); } else { buttons = buttons.concat([ { text: translate('menuPublishButtonUnpublish'), color: 'blank', ref: unpublishRef, onClick: onUnpublish }, From 1b84a7f7f451395cbd82069d24d084fcf7c805ae Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Tue, 28 Jan 2025 19:11:40 +0100 Subject: [PATCH 12/38] JS-6180: fix --- src/ts/component/menu/dataview/relation/list.tsx | 7 +++++-- src/ts/lib/analytics.ts | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ts/component/menu/dataview/relation/list.tsx b/src/ts/component/menu/dataview/relation/list.tsx index 71f810b29f..f6b6680f46 100644 --- a/src/ts/component/menu/dataview/relation/list.tsx +++ b/src/ts/component/menu/dataview/relation/list.tsx @@ -5,7 +5,7 @@ import arrayMove from 'array-move'; import { AutoSizer, CellMeasurer, InfiniteLoader, List as VList, CellMeasurerCache } from 'react-virtualized'; import { SortableContainer, SortableElement, SortableHandle } from 'react-sortable-hoc'; import { Icon, Switch } from 'Component'; -import { I, C, S, J, Relation, keyboard, Dataview, translate } from 'Lib'; +import { I, C, S, J, Relation, keyboard, Dataview, translate, analytics } from 'Lib'; const HEIGHT = 28; const LIMIT = 20; @@ -288,7 +288,6 @@ const MenuRelationList = observer(class MenuRelationList extends React.Component }; onSortEnd (result: any) { - const { config } = S.Common; const { oldIndex, newIndex } = result; const { param } = this.props; const { data } = param; @@ -305,8 +304,12 @@ const MenuRelationList = observer(class MenuRelationList extends React.Component const { data } = param; const { rootId, blockId, getView } = data; const view = getView(); + const object = S.Detail.get(rootId, rootId); + const relation = S.Record.getRelationByKey(item.relationKey); C.BlockDataviewViewRelationReplace(rootId, blockId, view.id, item.relationKey, { ...item, isVisible: v }); + + analytics.event('ShowDataviewRelation', { type: v ? 'True' : 'False', relationKey: item.relationKey, format: relation.format, objectType: object.type }); }; onScroll ({ scrollTop }) { diff --git a/src/ts/lib/analytics.ts b/src/ts/lib/analytics.ts index 8ff8f085f1..f90ba36b9f 100644 --- a/src/ts/lib/analytics.ts +++ b/src/ts/lib/analytics.ts @@ -377,6 +377,7 @@ class Analytics { break; }; + case 'ShowDataviewRelation': case 'DeleteRelationValue': case 'ChangeRelationValue': case 'FeatureRelation': From 3c666fc5fc9b5daddecfab238e80f262ef04b04c Mon Sep 17 00:00:00 2001 From: "Sergey G." Date: Wed, 29 Jan 2025 15:53:20 +0400 Subject: [PATCH 13/38] feat(config): allow both 'yml' and 'yaml' file --- src/ts/component/popup/settings/onboarding.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/popup/settings/onboarding.tsx b/src/ts/component/popup/settings/onboarding.tsx index 85ed377f50..02e19f8832 100644 --- a/src/ts/component/popup/settings/onboarding.tsx +++ b/src/ts/component/popup/settings/onboarding.tsx @@ -128,7 +128,7 @@ const PopupSettingsOnboarding = observer(class PopupSettingsOnboarding extends R }; onUpload () { - Action.openFileDialog({ extensions: [ 'yml' ] }, (paths: string[]) => this.onChange('path', paths[0])); + Action.openFileDialog({ extensions: [ 'yml', 'yaml' ] }, (paths: string[]) => this.onChange('path', paths[0])); }; onSave () { From 8949321b371677d3fbce7a9796d8195a4dce591d Mon Sep 17 00:00:00 2001 From: Andrew Simachev Date: Wed, 29 Jan 2025 15:04:41 +0100 Subject: [PATCH 14/38] remove experimental flags --- src/ts/component/block/chat.tsx | 4 ---- src/ts/component/header/main/object.tsx | 2 +- .../popup/page/settings/data/index.tsx | 23 ++++++++----------- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/ts/component/block/chat.tsx b/src/ts/component/block/chat.tsx index 5d03da07bb..7a17834c04 100644 --- a/src/ts/component/block/chat.tsx +++ b/src/ts/component/block/chat.tsx @@ -617,10 +617,6 @@ const BlockChat = observer(class BlockChat extends React.Component((props, ref) const isLocked = root ? root.isLocked() : false; const isTypeOrRelation = U.Object.isTypeOrRelationLayout(object.layout); const isDate = U.Object.isDateLayout(object.layout); - const showShare = S.Block.isAllowed(object.restrictions, [ I.RestrictionObject.Publish ], true) && config.experimental && !isDeleted; + const showShare = S.Block.isAllowed(object.restrictions, [ I.RestrictionObject.Publish ], true) && !isDeleted; const showRelations = !isTypeOrRelation && !isDate && !isDeleted; const showMenu = !isTypeOrRelation && !isDeleted; const cmd = keyboard.cmdSymbol(); diff --git a/src/ts/component/popup/page/settings/data/index.tsx b/src/ts/component/popup/page/settings/data/index.tsx index 7781b8e2ff..add76a2050 100644 --- a/src/ts/component/popup/page/settings/data/index.tsx +++ b/src/ts/component/popup/page/settings/data/index.tsx @@ -25,7 +25,6 @@ const PopupSettingsPageDataIndex = observer(class PopupSettingsPageDataIndex ext }; render () { - const { config } = S.Common; const { onPage } = this.props; const { list } = this.state; const { dataPath, spaceStorage } = S.Common; @@ -54,21 +53,19 @@ const PopupSettingsPageDataIndex = observer(class PopupSettingsPageDataIndex ext - {config.experimental ? ( -
-
- +
+
+ -
- - <Label text={size} /> - </div> - </div> - <div className="side right"> - <Button color="blank" className="c28" text={translate(`commonManage`)} onClick={() => onPage('dataPublish')} /> + <div className="txt"> + <Title text={translate('popupSettingsDataManagementDataPublishTitle')} /> + <Label text={size} /> </div> </div> - ) : ''} + <div className="side right"> + <Button color="blank" className="c28" text={translate(`commonManage`)} onClick={() => onPage('dataPublish')} /> + </div> + </div> <div className="item"> <div className="side left"> From 081b123929a688072721031d952d7cdcb3175fcb Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 29 Jan 2025 15:07:16 +0100 Subject: [PATCH 15/38] #1186: fix --- src/ts/component/popup/settings/onboarding.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/popup/settings/onboarding.tsx b/src/ts/component/popup/settings/onboarding.tsx index 85ed377f50..02e19f8832 100644 --- a/src/ts/component/popup/settings/onboarding.tsx +++ b/src/ts/component/popup/settings/onboarding.tsx @@ -128,7 +128,7 @@ const PopupSettingsOnboarding = observer(class PopupSettingsOnboarding extends R }; onUpload () { - Action.openFileDialog({ extensions: [ 'yml' ] }, (paths: string[]) => this.onChange('path', paths[0])); + Action.openFileDialog({ extensions: [ 'yml', 'yaml' ] }, (paths: string[]) => this.onChange('path', paths[0])); }; onSave () { From 8553f45601b4f2f02c8d942f91cc169b3b067775 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 29 Jan 2025 15:22:10 +0100 Subject: [PATCH 16/38] JS-6333: add DebugRunProfiler integration --- electron/js/menu.js | 1 + src/json/text.json | 1 + .../popup/page/settings/data/index.tsx | 4 ++-- .../component/popup/settings/onboarding.tsx | 2 +- src/ts/lib/action.ts | 8 +++---- src/ts/lib/api/command.ts | 10 +++++++- src/ts/lib/api/dispatcher.ts | 2 +- src/ts/lib/api/response.ts | 6 +++++ src/ts/lib/keyboard.ts | 23 +++++++++++++------ src/ts/lib/util/common.ts | 2 +- 10 files changed, 41 insertions(+), 18 deletions(-) diff --git a/electron/js/menu.js b/electron/js/menu.js index 5848a4e4ac..ee0e407332 100644 --- a/electron/js/menu.js +++ b/electron/js/menu.js @@ -261,6 +261,7 @@ class MenuManager { { label: Util.translate('electronMenuDebugReconcile'), click: () => Util.send(this.win, 'commandGlobal', 'debugReconcile') }, { label: Util.translate('electronMenuDebugNet'), click: () => Util.send(this.win, 'commandGlobal', 'debugNet') }, { label: Util.translate('electronMenuDebugLog'), click: () => Util.send(this.win, 'commandGlobal', 'debugLog') }, + { label: Util.translate('electronMenuDebugProfiler'), click: () => Util.send(this.win, 'commandGlobal', 'debugProfiler') }, Separator, diff --git a/src/json/text.json b/src/json/text.json index 47175ecddc..f28dac36f0 100644 --- a/src/json/text.json +++ b/src/json/text.json @@ -247,6 +247,7 @@ "electronMenuDebugReconcile": "Reconcile", "electronMenuDebugNet": "Network", "electronMenuDebugLog": "Export log", + "electronMenuDebugProfiler": "Export CPU trace", "electronMenuClose": "Close Window", "electronMenuEdit": "Edit", "electronMenuUndo": "Undo", diff --git a/src/ts/component/popup/page/settings/data/index.tsx b/src/ts/component/popup/page/settings/data/index.tsx index add76a2050..da1bba1175 100644 --- a/src/ts/component/popup/page/settings/data/index.tsx +++ b/src/ts/component/popup/page/settings/data/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Title, Label, IconObject, Button } from 'Component'; -import { I, C, S, U, translate, Renderer, analytics } from 'Lib'; +import { I, C, S, U, translate, Renderer, analytics, Action } from 'Lib'; import { observer } from 'mobx-react'; interface State { @@ -138,7 +138,7 @@ const PopupSettingsPageDataIndex = observer(class PopupSettingsPageDataIndex ext }; onOpenDataLocation () { - Renderer.send('openPath', S.Common.dataPath); + Action.openPath(S.Common.dataPath); analytics.event('ClickSettingsDataManagementLocation', { route: analytics.route.settings }); }; diff --git a/src/ts/component/popup/settings/onboarding.tsx b/src/ts/component/popup/settings/onboarding.tsx index 02e19f8832..170b5496ba 100644 --- a/src/ts/component/popup/settings/onboarding.tsx +++ b/src/ts/component/popup/settings/onboarding.tsx @@ -180,7 +180,7 @@ const PopupSettingsOnboarding = observer(class PopupSettingsOnboarding extends R onPathClick (path: string) { if (path) { - Renderer.send('openPath', U.Common.getElectron().dirName(path)); + Action.openPath(U.Common.getElectron().dirName(path)); }; }; diff --git a/src/ts/lib/action.ts b/src/ts/lib/action.ts index ce6fa1ee1a..aeec782fd1 100644 --- a/src/ts/lib/action.ts +++ b/src/ts/lib/action.ts @@ -221,10 +221,8 @@ class Action { }; C.FileDownload(id, U.Common.getElectron().tmpPath, (message: any) => { - if (message.path) { - Renderer.send('openPath', message.path); - analytics.event('OpenMedia', { route }); - }; + this.openPath(message.path); + analytics.event('OpenMedia', { route }); }); }; @@ -554,7 +552,7 @@ class Action { return; }; - Renderer.send('openPath', paths[0]); + this.openPath(paths[0]); analytics.event('Export', { type, middleTime: message.middleTime, route }); if (callBack) { diff --git a/src/ts/lib/api/command.ts b/src/ts/lib/api/command.ts index 4bed093d74..5f52b375b9 100644 --- a/src/ts/lib/api/command.ts +++ b/src/ts/lib/api/command.ts @@ -1941,7 +1941,15 @@ export const DebugExportLog = (path: string, callBack?: (message: any) => void) request.setDir(path); dispatcher.request(DebugExportLog.name, request, callBack); -} +}; + +export const DebugRunProfiler = (duration: number, callBack?: (message: any) => void) => { + const request = new Rpc.Debug.RunProfiler.Request(); + + request.setDurationinseconds(duration); + + dispatcher.request(DebugRunProfiler.name, request, callBack); +}; // ---------------------- NOTIFICATION ---------------------- // diff --git a/src/ts/lib/api/dispatcher.ts b/src/ts/lib/api/dispatcher.ts index 3aeb5fd939..99d922a1ae 100644 --- a/src/ts/lib/api/dispatcher.ts +++ b/src/ts/lib/api/dispatcher.ts @@ -5,7 +5,7 @@ import { observable, set } from 'mobx'; import Commands from 'dist/lib/pb/protos/commands_pb'; import Events from 'dist/lib/pb/protos/events_pb'; import Service from 'dist/lib/pb/protos/service/service_grpc_web_pb'; -import { I, M, S, U, J, translate, analytics, Renderer, Action, Dataview, Mapper, Storage, keyboard } from 'Lib'; +import { I, M, S, U, J, analytics, Renderer, Action, Dataview, Mapper, keyboard } from 'Lib'; import * as Response from './response'; import { ClientReadableStream } from 'grpc-web'; diff --git a/src/ts/lib/api/response.ts b/src/ts/lib/api/response.ts index 562e3c8151..2457adb889 100644 --- a/src/ts/lib/api/response.ts +++ b/src/ts/lib/api/response.ts @@ -62,6 +62,12 @@ export const DebugNetCheck = (response: Rpc.Debug.NetCheck.Response) => { }; }; +export const DebugRunProfiler = (response: Rpc.Debug.RunProfiler.Response) => { + return { + path: response.getPath(), + }; +}; + export const Export = (response: any) => { return { path: response.getPath(), diff --git a/src/ts/lib/keyboard.ts b/src/ts/lib/keyboard.ts index 6759b4bb07..4cc984a111 100644 --- a/src/ts/lib/keyboard.ts +++ b/src/ts/lib/keyboard.ts @@ -532,7 +532,7 @@ class Keyboard { return; }; - Renderer.send('openPath', paths[0]); + Action.openPath(paths[0]); }); }); break; @@ -542,7 +542,7 @@ class Keyboard { Action.openDirectoryDialog({ buttonLabel: translate('commonExport') }, paths => { C.DebugExportLocalstore(paths[0], [], (message: any) => { if (!message.error.code) { - Renderer.send('openPath', paths[0]); + Action.openPath(paths[0]); }; }); }); @@ -553,7 +553,7 @@ class Keyboard { C.DebugSpaceSummary(S.Common.space, (message: any) => { if (!message.error.code) { U.Common.getElectron().fileWrite('debug-space-summary.json', JSON.stringify(message, null, 5), { encoding: 'utf8' }); - Renderer.send('openPath', tmpPath); + Action.openPath(tmpPath); }; }); break; @@ -563,7 +563,7 @@ class Keyboard { C.DebugStat((message: any) => { if (!message.error.code) { U.Common.getElectron().fileWrite('debug-stat.json', JSON.stringify(message, null, 5), { encoding: 'utf8' }); - Renderer.send('openPath', tmpPath); + Action.openPath(tmpPath); }; }); break; @@ -572,7 +572,7 @@ class Keyboard { case 'debugTree': { C.DebugTree(rootId, logPath, false, (message: any) => { if (!message.error.code) { - Renderer.send('openPath', logPath); + Action.openPath(logPath); }; }); break; @@ -581,7 +581,7 @@ class Keyboard { case 'debugProcess': { C.DebugStackGoroutines(logPath, (message: any) => { if (!message.error.code) { - Renderer.send('openPath', logPath); + Action.openPath(logPath); }; }); break; @@ -632,7 +632,16 @@ class Keyboard { case 'debugLog': { C.DebugExportLog(tmpPath, (message: any) => { if (!message.error.code) { - Renderer.send('openPath', tmpPath); + Action.openPath(tmpPath); + }; + }); + break; + }; + + case 'debugProfiler': { + C.DebugRunProfiler(30, (message: any) => { + if (!message.error.code) { + Action.openPath(message.path); }; }); break; diff --git a/src/ts/lib/util/common.ts b/src/ts/lib/util/common.ts index e2da6b8616..ad3f908d84 100644 --- a/src/ts/lib/util/common.ts +++ b/src/ts/lib/util/common.ts @@ -580,7 +580,7 @@ class UtilCommon { onConfirm: () => { C.DebugTree(rootId, logPath, false, (message: any) => { if (!message.error.code) { - Renderer.send('openPath', logPath); + Action.openPath(logPath); }; }); From 5ab6cc0b7097af30395f20deddbf94b0e61e39e1 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 29 Jan 2025 15:27:02 +0100 Subject: [PATCH 17/38] bump middleware version --- middleware.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware.version b/middleware.version index 2635752090..99fb022a36 100644 --- a/middleware.version +++ b/middleware.version @@ -1 +1 @@ -0.39.0-rc08 \ No newline at end of file +0.39.0-rc09 \ No newline at end of file From 3320527b7753fe9059319cb54f05c4899dcb921a Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 29 Jan 2025 15:27:17 +0100 Subject: [PATCH 18/38] 0.44.12-alpha --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5b9b3dee7a..a5566a4678 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.44.11-alpha", + "version": "0.44.12-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.44.11-alpha", + "version": "0.44.12-alpha", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index 2d77255c44..00da81dba0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.44.11-alpha", + "version": "0.44.12-alpha", "description": "Anytype", "main": "electron.js", "scripts": { From a35de455b232a342c6dcc82e9ba7b9ed4a2df611 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 29 Jan 2025 16:17:42 +0100 Subject: [PATCH 19/38] 0.44.13-beta --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a5566a4678..bd21b3c91c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.44.12-alpha", + "version": "0.44.13-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.44.12-alpha", + "version": "0.44.13-beta", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index 00da81dba0..282553a9e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.44.12-alpha", + "version": "0.44.13-beta", "description": "Anytype", "main": "electron.js", "scripts": { From 107f690f2e5e7ace7e896f6f21f9b6302e22c04b Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 29 Jan 2025 19:04:08 +0100 Subject: [PATCH 20/38] fix whatsNew --- src/ts/docs/help/whatsNew.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/docs/help/whatsNew.ts b/src/ts/docs/help/whatsNew.ts index 3213374083..02cf55c940 100644 --- a/src/ts/docs/help/whatsNew.ts +++ b/src/ts/docs/help/whatsNew.ts @@ -94,7 +94,7 @@ export default [ bullet(`Dragging headers in the Grid to rearrange columns no longer highlights the text of other headers. Thanks, @${link('https://community.anytype.io/t/moving-column-headers-in-the-grid-to-swap-columns-selects-all-headers/26100', 'Code-Jack')}!`), bullet(`Fixed keyboard navigation in the Command menu. Thanks, @${link('https://community.anytype.io/t/adding-a-link-cursor-jumps-too-deep-in-the-selection-box/25763', 'Code-Jack')}!`), bullet(`Bin Search works correctly, without causing Objects to be filtered out.`), - bullet(`Relations containing angle brackets (e.g., <abc>) are saved correctly. Thanks, @${link('https://community.anytype.io/t/angle-brackets-in-relation-will-disappear-when-clicking-it/25534', 'CoolGuy')}!`), + bullet(`Relations containing angle brackets (e.g., ${hl('<abc>')}) are saved correctly. Thanks, @${link('https://community.anytype.io/t/angle-brackets-in-relation-will-disappear-when-clicking-it/25534', 'CoolGuy')}!`), bullet(`Input to Date type relations works correctly. Thanks, @${link('https://community.anytype.io/t/date-entry-not-working/26112', 'flypenguin')}!`), bullet(`Removed the option to paste YouTube channel links as Embed. Thanks, @${link('https://community.anytype.io/t/pasting-a-link-to-an-yt-channel-paste-as-embed-shouldnt-appear/26297', 'Code-Jack')}!`), bullet(`Fixed an issue where pasting with all blocks selected in the object editor would wipe out content without pasting from the clipboard. Thanks, @${link('https://community.anytype.io/t/pasting-when-all-blocks-in-the-object-editor-are-selected-will-wipe-out-everything-but-will-not-paste-whats-in-the-clipboard/25040', 'sky1')}!`), From c501943913e64619947be1918928a1c9836fe9f1 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Wed, 29 Jan 2025 19:12:04 +0100 Subject: [PATCH 21/38] fix sentry crash --- src/ts/component/menu/publish.tsx | 8 ++++---- src/ts/component/popup/page/settings/space/share.tsx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ts/component/menu/publish.tsx b/src/ts/component/menu/publish.tsx index 95747e651d..8ce37e3bc9 100644 --- a/src/ts/component/menu/publish.tsx +++ b/src/ts/component/menu/publish.tsx @@ -58,10 +58,10 @@ const MenuPublish = observer(forwardRef<I.MenuRef, I.Menu>((props, ref) => { const onPublish = (isUpdate?: boolean) => { const analyticsName = isUpdate ? 'ShareObjectUpdate' : 'ShareObjectPublish'; - publishRef.current.setLoading(true); + publishRef.current?.setLoading(true); C.PublishingCreate(S.Common.space, rootId, slug, joinRef.current?.getValue(), (message: any) => { - publishRef.current.setLoading(false); + publishRef.current?.setLoading(false); if (message.error.code) { setError(message.error.description); @@ -80,10 +80,10 @@ const MenuPublish = observer(forwardRef<I.MenuRef, I.Menu>((props, ref) => { }; const onUnpublish = () => { - unpublishRef.current.setLoading(true); + unpublishRef.current?.setLoading(true); C.PublishingRemove(S.Common.space, rootId, (message: any) => { - unpublishRef.current.setLoading(false); + unpublishRef.current?.setLoading(false); if (message.error.code) { setError(message.error.description); diff --git a/src/ts/component/popup/page/settings/space/share.tsx b/src/ts/component/popup/page/settings/space/share.tsx index 771a13c99b..e1e92c2291 100644 --- a/src/ts/component/popup/page/settings/space/share.tsx +++ b/src/ts/component/popup/page/settings/space/share.tsx @@ -84,7 +84,7 @@ const PopupSettingsSpaceShare = observer(class PopupSettingsSpaceShare extends R }; const Member = (item: any) => { - const isCurrent = item.id == participant.id; + const isCurrent = item.id == participant?.id; let tag = null; let button = null; From 8d8e51a7fe87d1d6353c688b086db8ddd0ca43ae Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 00:22:34 +0100 Subject: [PATCH 22/38] fix sentry crash --- src/ts/component/page/main/chat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/page/main/chat.tsx b/src/ts/component/page/main/chat.tsx index 176d10c884..d748ecc42e 100644 --- a/src/ts/component/page/main/chat.tsx +++ b/src/ts/component/page/main/chat.tsx @@ -43,7 +43,7 @@ const PageMainChat = observer(forwardRef<{}, I.PageComponent>((props, ref) => { return; }; - headerRef.current.forceUpdate(); + headerRef.current?.forceUpdate(); resize(); }); }; From 61d18cfc3abbf17f806525acc8f77cc41973386b Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 12:02:24 +0100 Subject: [PATCH 23/38] JS-6345: Publishing filter --- .../popup/page/settings/data/index.tsx | 4 ++-- .../popup/page/settings/data/publish.tsx | 20 ++++++------------- src/ts/interface/publish.ts | 1 + src/ts/lib/api/mapper.ts | 1 + 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/ts/component/popup/page/settings/data/index.tsx b/src/ts/component/popup/page/settings/data/index.tsx index da1bba1175..b6c1f88dc6 100644 --- a/src/ts/component/popup/page/settings/data/index.tsx +++ b/src/ts/component/popup/page/settings/data/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Title, Label, IconObject, Button } from 'Component'; -import { I, C, S, U, translate, Renderer, analytics, Action } from 'Lib'; +import { I, C, S, U, translate, analytics, Action } from 'Lib'; import { observer } from 'mobx-react'; interface State { @@ -90,7 +90,7 @@ const PopupSettingsPageDataIndex = observer(class PopupSettingsPageDataIndex ext }; componentDidMount(): void { - C.PublishingList(S.Common.space, (message: any) => { + C.PublishingList('', (message: any) => { if (!message.error.code) { this.setState({ list: message.list }); }; diff --git a/src/ts/component/popup/page/settings/data/publish.tsx b/src/ts/component/popup/page/settings/data/publish.tsx index b8311d1e5a..6c747c2295 100644 --- a/src/ts/component/popup/page/settings/data/publish.tsx +++ b/src/ts/component/popup/page/settings/data/publish.tsx @@ -21,7 +21,7 @@ const PopupSettingsPageDataPublish = observer(class PopupSettingsPageDataPublish const { list } = this.state; const Row = (item: any) => { - const object = S.Detail.get(SUB_ID, item.objectId); + const object = S.Detail.mapper(item.details); return ( <div className="row"> @@ -65,18 +65,9 @@ const PopupSettingsPageDataPublish = observer(class PopupSettingsPageDataPublish }; load () { - C.PublishingList(S.Common.space, (message: any) => { + C.PublishingList('', (message: any) => { if (!message.error.code) { - const list = message.list; - const ids = list.map(item => item.objectId); - - U.Data.subscribeIds({ - subId: SUB_ID, - ids, - noDeps: true, - }, () => { - this.setState({ list }); - }); + this.setState({ list: message.list }); }; }); }; @@ -88,6 +79,7 @@ const PopupSettingsPageDataPublish = observer(class PopupSettingsPageDataPublish onMore (item: any) { const { getId } = this.props; const element = $(`#${getId()} #icon-more-${item.objectId}`); + const object = S.Detail.mapper(item.details); const options: any[] = [ { id: 'open', name: translate('menuPublishButtonOpen') }, { isDiv: true }, @@ -108,7 +100,7 @@ const PopupSettingsPageDataPublish = observer(class PopupSettingsPageDataPublish onSelect: (e: any, element: any) => { switch (element.id) { case 'open': { - U.Object.openAuto(S.Detail.get(SUB_ID, item.objectId)); + U.Object.openAuto(object); break; }; @@ -133,7 +125,7 @@ const PopupSettingsPageDataPublish = observer(class PopupSettingsPageDataPublish }; onUnpublish (item: any) { - const object = S.Detail.get(SUB_ID, item.objectId); + const object = S.Detail.mapper(item.details); C.PublishingRemove(S.Common.space, item.objectId, (message: any) => { if (!message.error.code) { diff --git a/src/ts/interface/publish.ts b/src/ts/interface/publish.ts index 68da8af83e..274b8006c1 100644 --- a/src/ts/interface/publish.ts +++ b/src/ts/interface/publish.ts @@ -11,4 +11,5 @@ export interface PublishState { version: string; timestamp: number; size: number; + details: any; }; \ No newline at end of file diff --git a/src/ts/lib/api/mapper.ts b/src/ts/lib/api/mapper.ts index 2d8a80c537..90b47ab613 100644 --- a/src/ts/lib/api/mapper.ts +++ b/src/ts/lib/api/mapper.ts @@ -691,6 +691,7 @@ export const Mapper = { version: obj.getVersion(), timestamp: obj.getTimestamp(), size: obj.getSize(), + details: Decode.struct(obj.getDetails()), }; }, From 29e5f25cadb95fbad84d4912fb1d83f7d7899295 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 12:54:07 +0100 Subject: [PATCH 24/38] fix routing checks --- src/ts/component/page/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ts/component/page/index.tsx b/src/ts/component/page/index.tsx index 5d40c6fa3e..ad87e74f03 100644 --- a/src/ts/component/page/index.tsx +++ b/src/ts/component/page/index.tsx @@ -148,7 +148,7 @@ const Page = observer(class Page extends React.Component<I.PageComponent> { const ret = (isPopup ? matchPopup : match) || { params: {} }; // Universal object route - if (pathname.match('/object')) { + if (pathname.match(/^\/object/)) { ret.params.page = 'main'; ret.params.action = 'object'; ret.params.id = data.objectId; @@ -158,13 +158,13 @@ const Page = observer(class Page extends React.Component<I.PageComponent> { }; // Invite route - if (pathname.match('/invite')) { + if (pathname.match(/^\/invite/)) { ret.params.page = 'main'; ret.params.action = 'invite'; }; // Membership route - if (pathname.match('/membership')) { + if (pathname.match(/^\/membership/)) { ret.params.page = 'main'; ret.params.action = 'membership'; }; From b2602ebf3f8435b105a9c7b67ad5e619b9a6eedf Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 13:45:25 +0100 Subject: [PATCH 25/38] add copy link button --- src/scss/menu/publish.scss | 6 ++++++ src/ts/component/menu/publish.tsx | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/scss/menu/publish.scss b/src/scss/menu/publish.scss index f9eade5bdb..69e5642fc1 100644 --- a/src/scss/menu/publish.scss +++ b/src/scss/menu/publish.scss @@ -20,6 +20,12 @@ .value { display: flex; flex-direction: row; align-items: center; justify-content: flex-end; flex-shrink: 0; } } + .urlWrapper { display: flex; flex-direction: row; align-items: center; gap: 0px 8px; } + .urlWrapper { + .label { flex-grow: 1; } + .button { flex-shrink: 0; font-weight: 500; } + } + .buttons { display: flex; flex-direction: row; align-items: center; gap: 0px 8px; justify-content: space-evenly; height: 36px; } .buttons { .button { flex-grow: 1; width: 100%; } diff --git a/src/ts/component/menu/publish.tsx b/src/ts/component/menu/publish.tsx index 8ce37e3bc9..6562b6f74d 100644 --- a/src/ts/component/menu/publish.tsx +++ b/src/ts/component/menu/publish.tsx @@ -186,7 +186,15 @@ const MenuPublish = observer(forwardRef<I.MenuRef, I.Menu>((props, ref) => { onChange={(e, v) => setSlugHander(v)} maxLength={300} /> - <Label className="small" text={url} onClick={onUrlClick} /> + <div className="urlWrapper"> + <Label className="small" text={url} onClick={onUrlClick} /> + <Button + color="blank" + className="simple" + text={translate('commonCopy')} + onClick={() => U.Common.copyToast(translate('commonLink'), url)} + /> + </div> {space.isShared ? ( <div className="flex"> From 9c66e89cfe160f8ac6b5244bb1946bce4bf08fbd Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 13:50:55 +0100 Subject: [PATCH 26/38] add copy link button --- src/scss/menu/publish.scss | 2 +- src/ts/component/editor/page.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scss/menu/publish.scss b/src/scss/menu/publish.scss index 69e5642fc1..c82b7ebbf1 100644 --- a/src/scss/menu/publish.scss +++ b/src/scss/menu/publish.scss @@ -22,7 +22,7 @@ .urlWrapper { display: flex; flex-direction: row; align-items: center; gap: 0px 8px; } .urlWrapper { - .label { flex-grow: 1; } + .label { flex-grow: 1; user-select: text !important; } .button { flex-shrink: 0; font-weight: 500; } } diff --git a/src/ts/component/editor/page.tsx b/src/ts/component/editor/page.tsx index 874f130f75..0c5cbc0c29 100644 --- a/src/ts/component/editor/page.tsx +++ b/src/ts/component/editor/page.tsx @@ -1487,7 +1487,7 @@ const EditorPage = observer(class EditorPage extends React.Component<Props, Stat }; menuCheck () { - return S.Menu.isOpen('', '', [ 'blockContext', 'searchText', 'onboarding' ]); + return S.Menu.isOpen('', '', [ 'blockContext', 'searchText', 'onboarding', 'publish' ]); }; onArrowVertical (e: any, pressed: string, range: I.TextRange, length: number, props: any) { From 3231ba0f77b6af31352bea1a6ed1eda428e32531 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 13:51:18 +0100 Subject: [PATCH 27/38] add copy link button --- src/ts/component/menu/publish.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ts/component/menu/publish.tsx b/src/ts/component/menu/publish.tsx index 6562b6f74d..357eb9838d 100644 --- a/src/ts/component/menu/publish.tsx +++ b/src/ts/component/menu/publish.tsx @@ -138,7 +138,6 @@ const MenuPublish = observer(forwardRef<I.MenuRef, I.Menu>((props, ref) => { }; const setSlugHander = v => setSlug(U.Common.slug(v)); - const onUrlClick = () => Action.openUrl(url); let buttons = []; @@ -187,7 +186,7 @@ const MenuPublish = observer(forwardRef<I.MenuRef, I.Menu>((props, ref) => { maxLength={300} /> <div className="urlWrapper"> - <Label className="small" text={url} onClick={onUrlClick} /> + <Label className="small" text={url} /> <Button color="blank" className="simple" From 7da03b9c45cb738b38394ca96cacb0271c2b6041 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 13:52:00 +0100 Subject: [PATCH 28/38] add copy link button --- src/ts/component/menu/publish.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ts/component/menu/publish.tsx b/src/ts/component/menu/publish.tsx index 357eb9838d..482367c717 100644 --- a/src/ts/component/menu/publish.tsx +++ b/src/ts/component/menu/publish.tsx @@ -191,7 +191,7 @@ const MenuPublish = observer(forwardRef<I.MenuRef, I.Menu>((props, ref) => { color="blank" className="simple" text={translate('commonCopy')} - onClick={() => U.Common.copyToast(translate('commonLink'), url)} + onClick={() => U.Common.copyToast(translate('commonLink'), `https://${url}`)} /> </div> From 5880948297df895070937a1abd612502b6fe3c98 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 14:40:56 +0100 Subject: [PATCH 29/38] add copy link button --- src/scss/component/toast.scss | 2 +- src/scss/menu/publish.scss | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/scss/component/toast.scss b/src/scss/component/toast.scss index c52a69f992..81696009e8 100644 --- a/src/scss/component/toast.scss +++ b/src/scss/component/toast.scss @@ -2,7 +2,7 @@ .toast { position: fixed; left: 0px; top: 0px; border-radius: 8px; background: var(--color-control-accent); padding: 11px 16px; text-transform: none; - @include text-common; color: var(--color-bg-primary); display: none; z-index: 1000; white-space: nowrap; transition-duration: 0.25s; + @include text-common; color: var(--color-bg-primary); display: none; z-index: 2000; white-space: nowrap; transition-duration: 0.25s; transition-property: opacity, transform; transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); max-width: 50%; } diff --git a/src/scss/menu/publish.scss b/src/scss/menu/publish.scss index c82b7ebbf1..060e5f134e 100644 --- a/src/scss/menu/publish.scss +++ b/src/scss/menu/publish.scss @@ -22,8 +22,16 @@ .urlWrapper { display: flex; flex-direction: row; align-items: center; gap: 0px 8px; } .urlWrapper { - .label { flex-grow: 1; user-select: text !important; } - .button { flex-shrink: 0; font-weight: 500; } + .label { flex-grow: 1; user-select: text !important; position: relative; } + .label::after { + content: ''; display: block; position: absolute; right: -22px; top: 0px; width: 46px; height: 100%; z-index: 1; + background: linear-gradient(90deg, rgba(255, 255, 255, 0) -22.83%, var(--color-bg-primary) 34.78%); + } + .button { + flex-shrink: 0; font-weight: 500; @include text-small; color: var(--color-text-primary); height: 18px; padding: 0px 4px; + border-radius: 4px; transition: $transitionAllCommon; + } + .button:hover { background-color: var(--color-shape-highlight-medium) !important; } } .buttons { display: flex; flex-direction: row; align-items: center; gap: 0px 8px; justify-content: space-evenly; height: 36px; } From f84cbcb595794dd7ac01a7a16e718352fe23fd6f Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 16:20:32 +0100 Subject: [PATCH 30/38] small style fix --- src/scss/block/dataview/view/gallery.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/block/dataview/view/gallery.scss b/src/scss/block/dataview/view/gallery.scss index 2bed1eccac..3718e593bb 100644 --- a/src/scss/block/dataview/view/gallery.scss +++ b/src/scss/block/dataview/view/gallery.scss @@ -13,7 +13,7 @@ } .card.add { box-shadow: 0px 0px; } - .card.add::after { + .card.add::before { content: ''; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; background-image: url('~img/icon/plus/menu0.svg'); margin: -10px 0px 0px -10px; } From 6a914747da3647a1d3423e9d6a36b4d797661b12 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 16:35:00 +0100 Subject: [PATCH 31/38] bump middleware version --- middleware.version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleware.version b/middleware.version index 99fb022a36..8459c1847f 100644 --- a/middleware.version +++ b/middleware.version @@ -1 +1 @@ -0.39.0-rc09 \ No newline at end of file +0.39.2 \ No newline at end of file From a26413e3ae97c9994a750668764eff56e983dad1 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 16:35:40 +0100 Subject: [PATCH 32/38] 0.44.14-alpha --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd21b3c91c..a6ea0b2a97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.44.13-beta", + "version": "0.44.14-alpha", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.44.13-beta", + "version": "0.44.14-alpha", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index 282553a9e7..932a44344a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.44.13-beta", + "version": "0.44.14-alpha", "description": "Anytype", "main": "electron.js", "scripts": { From eb18bd31c03b0d511b85483ccb48aaa262bf9983 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 17:07:43 +0100 Subject: [PATCH 33/38] 0.44.15-beta --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a6ea0b2a97..444aafc6f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "anytype", - "version": "0.44.14-alpha", + "version": "0.44.15-beta", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "anytype", - "version": "0.44.14-alpha", + "version": "0.44.15-beta", "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { diff --git a/package.json b/package.json index 932a44344a..23d142b31a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "anytype", - "version": "0.44.14-alpha", + "version": "0.44.15-beta", "description": "Anytype", "main": "electron.js", "scripts": { From 4bfd3fdb28f6733ed35b21debab16dd8725c0cd3 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Thu, 30 Jan 2025 19:13:09 +0100 Subject: [PATCH 34/38] fix long url --- src/scss/menu/publish.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scss/menu/publish.scss b/src/scss/menu/publish.scss index 060e5f134e..992d2b1fff 100644 --- a/src/scss/menu/publish.scss +++ b/src/scss/menu/publish.scss @@ -22,7 +22,7 @@ .urlWrapper { display: flex; flex-direction: row; align-items: center; gap: 0px 8px; } .urlWrapper { - .label { flex-grow: 1; user-select: text !important; position: relative; } + .label { flex-grow: 1; user-select: text !important; position: relative; @include text-overflow-nw; } .label::after { content: ''; display: block; position: absolute; right: -22px; top: 0px; width: 46px; height: 100%; z-index: 1; background: linear-gradient(90deg, rgba(255, 255, 255, 0) -22.83%, var(--color-bg-primary) 34.78%); From 95aa460b4a4a9ed9c5ac7c0665170acc57d9aabc Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 31 Jan 2025 08:40:58 +0100 Subject: [PATCH 35/38] JS-6344: fix --- src/json/url.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json/url.ts b/src/json/url.ts index 8dbfee0468..8881e15b72 100644 --- a/src/json/url.ts +++ b/src/json/url.ts @@ -24,7 +24,7 @@ export default { share: 'https://join.anytype.io/', notionFAQ: 'https://doc.anytype.io/anytype-docs/basics/space/import-export#notion-import-faq', publishDomain: '%s.org', - publish: 'https://any.coop/%s/', + publish: 'any.coop/%s/', api: '127.0.0.1:31009', survey: { From 05249ef366cc273437d7cb4428f76f088c5329cd Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 31 Jan 2025 08:55:17 +0100 Subject: [PATCH 36/38] JS-6344: fix --- src/json/url.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json/url.ts b/src/json/url.ts index 8881e15b72..e0cf7ab18a 100644 --- a/src/json/url.ts +++ b/src/json/url.ts @@ -24,7 +24,7 @@ export default { share: 'https://join.anytype.io/', notionFAQ: 'https://doc.anytype.io/anytype-docs/basics/space/import-export#notion-import-faq', publishDomain: '%s.org', - publish: 'any.coop/%s/', + publish: 'any.coop/%s', api: '127.0.0.1:31009', survey: { From 2e412254a3fd4b70191f3aded035408248b21799 Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 31 Jan 2025 09:58:26 +0100 Subject: [PATCH 37/38] fix gallery reorder styles --- src/scss/block/dataview/view/common.scss | 2 +- src/scss/block/dataview/view/gallery.scss | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scss/block/dataview/view/common.scss b/src/scss/block/dataview/view/common.scss index 157d3e59b5..6a3ae02ef9 100644 --- a/src/scss/block/dataview/view/common.scss +++ b/src/scss/block/dataview/view/common.scss @@ -30,7 +30,7 @@ } .cover { - img { width: 100%; height: 100%; object-fit: cover; } + img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; } .mediaVideo { height: 100%; } .mediaVideo { diff --git a/src/scss/block/dataview/view/gallery.scss b/src/scss/block/dataview/view/gallery.scss index 3718e593bb..0fcfaae811 100644 --- a/src/scss/block/dataview/view/gallery.scss +++ b/src/scss/block/dataview/view/gallery.scss @@ -9,7 +9,7 @@ .card { width: 100%; border: 1px solid var(--color-shape-highlight-medium); transition-property: border-color, background; transition-duration: 0.1s; transition-timing-function: $easeInQuint; border-radius: 8px; display: inline-block; background: var(--color-bg-primary); - box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.05); min-height: 72px; position: relative; overflow: hidden; + box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.05); min-height: 72px; position: relative; } .card.add { box-shadow: 0px 0px; } From c20b775b05309d5b276c04a86bfad995a7d9253e Mon Sep 17 00:00:00 2001 From: Andrew Simachev <andrew.simachev@gmail.com> Date: Fri, 31 Jan 2025 13:50:30 +0100 Subject: [PATCH 38/38] JS-6354: fix --- src/ts/component/sidebar/index.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ts/component/sidebar/index.tsx b/src/ts/component/sidebar/index.tsx index 826e7cd33e..46005a3d5f 100644 --- a/src/ts/component/sidebar/index.tsx +++ b/src/ts/component/sidebar/index.tsx @@ -45,6 +45,7 @@ const Sidebar = observer(class Sidebar extends React.Component<{}, State> { }; render() { + const { showVault } = S.Common; const page = this.state.page || 'widget'; const cmd = keyboard.cmdSymbol(); const Component = Components[page]; @@ -98,13 +99,8 @@ const Sidebar = observer(class Sidebar extends React.Component<{}, State> { const node = $(this.node); const vault = $(S.Common.getRef('vault').node); - if (showVault) { - node.addClass('withVault'); - vault.removeClass('isHidden'); - } else { - node.removeClass('withVault'); - vault.addClass('isHidden'); - }; + node.toggleClass('withVault', showVault); + vault.toggleClass('isHidden', !showVault); }; setActive (id: string): void {