From db97d6d4b602f37c69657419d3dd907b2dabf628 Mon Sep 17 00:00:00 2001 From: Anton Emelyanov Date: Tue, 1 Jun 2021 17:52:30 +0300 Subject: [PATCH 1/7] fix missing whitespace in permissions-modal (#568) --- app/assets/templates/directives/permissions-modal.pug | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/templates/directives/permissions-modal.pug b/app/assets/templates/directives/permissions-modal.pug index 52f452083..0ae709c0e 100644 --- a/app/assets/templates/directives/permissions-modal.pug +++ b/app/assets/templates/directives/permissions-modal.pug @@ -15,6 +15,7 @@ .sk-panel-row p.sk-p | Extensions use an offline messaging system to communicate. Learn more at + | a.sk-a.info( href='https://standardnotes.org/permissions', rel='noopener', From 3823836863781f930fce29d67059fb23242a85fa Mon Sep 17 00:00:00 2001 From: Antonella Sgarlatta Date: Wed, 2 Jun 2021 11:20:24 -0300 Subject: [PATCH 2/7] fix: disregard modifiers for note selection if user hasn't triggered the action --- .../javascripts/ui_models/app_state/notes_state.ts | 12 ++++++++---- app/assets/javascripts/views/notes/notes-view.pug | 2 +- app/assets/javascripts/views/notes/notes_view.ts | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/ui_models/app_state/notes_state.ts b/app/assets/javascripts/ui_models/app_state/notes_state.ts index 6688e4e97..3a4e79724 100644 --- a/app/assets/javascripts/ui_models/app_state/notes_state.ts +++ b/app/assets/javascripts/ui_models/app_state/notes_state.ts @@ -108,13 +108,14 @@ export class NotesState { } } - async selectNote(uuid: UuidString): Promise { + async selectNote(uuid: UuidString, userTriggered?: boolean): Promise { const note = this.application.findItem(uuid) as SNNote; if (note) { if ( - this.io.activeModifiers.has(KeyboardModifier.Meta) || - this.io.activeModifiers.has(KeyboardModifier.Ctrl) + userTriggered && + (this.io.activeModifiers.has(KeyboardModifier.Meta) || + this.io.activeModifiers.has(KeyboardModifier.Ctrl)) ) { if (this.selectedNotes[uuid]) { delete this.selectedNotes[uuid]; @@ -124,7 +125,10 @@ export class NotesState { this.lastSelectedNote = note; }); } - } else if (this.io.activeModifiers.has(KeyboardModifier.Shift)) { + } else if ( + userTriggered && + this.io.activeModifiers.has(KeyboardModifier.Shift) + ) { await this.selectNotesRange(note); } else { const shouldSelectNote = diff --git a/app/assets/javascripts/views/notes/notes-view.pug b/app/assets/javascripts/views/notes/notes-view.pug index 7f97da3b8..26287723b 100644 --- a/app/assets/javascripts/views/notes/notes-view.pug +++ b/app/assets/javascripts/views/notes/notes-view.pug @@ -130,7 +130,7 @@ ng-attr-id='note-{{note.uuid}}' ng-repeat='note in self.state.renderedNotes track by note.uuid' ng-class="{'selected' : self.isNoteSelected(note.uuid) }" - ng-click='self.selectNote(note)' + ng-click='self.selectNote(note, true)' ) .note-flags(ng-show='self.noteFlags[note.uuid].length > 0') .flag(ng-class='flag.class', ng-repeat='flag in self.noteFlags[note.uuid]') diff --git a/app/assets/javascripts/views/notes/notes_view.ts b/app/assets/javascripts/views/notes/notes_view.ts index 1708d0db6..1db7ff1b6 100644 --- a/app/assets/javascripts/views/notes/notes_view.ts +++ b/app/assets/javascripts/views/notes/notes_view.ts @@ -305,7 +305,7 @@ class NotesViewCtrl extends PureViewCtrl { private async openNotesContextMenu(e: MouseEvent, note: SNNote) { e.preventDefault(); if (!this.state.selectedNotes[note.uuid]) { - await this.selectNote(note); + await this.selectNote(note, true); } if (this.state.selectedNotes[note.uuid]) { const { clientHeight } = document.documentElement; @@ -395,8 +395,8 @@ class NotesViewCtrl extends PureViewCtrl { } } - async selectNote(note: SNNote): Promise { - await this.appState.notes.selectNote(note.uuid); + async selectNote(note: SNNote, userTriggered?: boolean): Promise { + await this.appState.notes.selectNote(note.uuid, userTriggered); } async createNewNote() { From 75cefc122ecb0f91026ce7de34515efd497d6b71 Mon Sep 17 00:00:00 2001 From: Antonella Sgarlatta Date: Thu, 3 Jun 2021 18:48:04 -0300 Subject: [PATCH 3/7] fix: add ellipsis overflow to tag text on note options --- .../javascripts/components/NotesOptions.tsx | 18 +++++++++--------- app/assets/stylesheets/_sn.scss | 12 ++++++++++++ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/components/NotesOptions.tsx b/app/assets/javascripts/components/NotesOptions.tsx index 8c80f5f54..b2a0ac3b4 100644 --- a/app/assets/javascripts/components/NotesOptions.tsx +++ b/app/assets/javascripts/components/NotesOptions.tsx @@ -72,11 +72,11 @@ export const NotesOptions = observer( const buttonRect = tagsButtonRef.current.getBoundingClientRect(); const footerHeight = 32; - if ((buttonRect.top + maxTagsMenuSize) > (clientHeight - footerHeight)) { + if (buttonRect.top + maxTagsMenuSize > clientHeight - footerHeight) { setTagsMenuMaxHeight(clientHeight - buttonRect.top - footerHeight - 2); } - if ((buttonRect.right + maxTagsMenuSize) > clientWidth) { + if (buttonRect.right + maxTagsMenuSize > clientWidth) { setTagsMenuPosition({ top: buttonRect.top, right: clientWidth - buttonRect.left, @@ -88,7 +88,6 @@ export const NotesOptions = observer( }); } - setTagsMenuOpen(!tagsMenuOpen); }; @@ -169,7 +168,7 @@ export const NotesOptions = observer( {appState.tags.tags.map((tag) => (