{typeof words === 'number' && (format === 'txt' || format === 'md') ? (
<>
@@ -185,6 +186,24 @@ const SpellcheckOptions: FunctionComponent<{
);
};
+const NOTE_SIZE_WARNING_THRESHOLD = 0.5 * BYTES_IN_ONE_MEGABYTE;
+
+const NoteSizeWarning: FunctionComponent<{
+ note: SNNote;
+}> = ({ note }) =>
+ new Blob([note.text]).size > NOTE_SIZE_WARNING_THRESHOLD ? (
+
+
+
+ This note may have trouble syncing to the mobile application due to its
+ size.
+
+
+ ) : null;
+
export const NotesOptions = observer(
({
application,
@@ -570,6 +589,7 @@ export const NotesOptions = observer(
+
>
) : null}
>
diff --git a/app/assets/javascripts/components/NotesOptionsPanel.tsx b/app/assets/javascripts/components/NotesOptionsPanel.tsx
index 72097cbbc..260608c26 100644
--- a/app/assets/javascripts/components/NotesOptionsPanel.tsx
+++ b/app/assets/javascripts/components/NotesOptionsPanel.tsx
@@ -86,7 +86,7 @@ export const NotesOptionsPanel = observer(
...position,
maxHeight,
}}
- className="sn-dropdown sn-dropdown--animated min-w-80 max-h-120 max-w-xs flex flex-col py-2 overflow-y-auto fixed"
+ className="sn-dropdown sn-dropdown--animated min-w-80 max-h-120 max-w-xs flex flex-col pt-2 overflow-y-auto fixed"
onBlur={closeOnBlur}
>
{open && (
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 df192d03a..b0093e5eb 100644
--- a/app/assets/javascripts/ui_models/app_state/notes_state.ts
+++ b/app/assets/javascripts/ui_models/app_state/notes_state.ts
@@ -314,7 +314,7 @@ export class NotesState {
let noteTitle = undefined;
if (this.selectedNotesCount === 1) {
const selectedNote = Object.values(this.selectedNotes)[0];
- noteTitle = selectedNote.safeTitle().length
+ noteTitle = selectedNote.title.length
? `'${selectedNote.title}'`
: 'this note';
}
diff --git a/app/assets/javascripts/views/constants.ts b/app/assets/javascripts/views/constants.ts
index dd83ea727..c2f6a61d5 100644
--- a/app/assets/javascripts/views/constants.ts
+++ b/app/assets/javascripts/views/constants.ts
@@ -9,3 +9,5 @@ export const MAX_MENU_SIZE_MULTIPLIER = 30;
export const FOCUSABLE_BUT_NOT_TABBABLE = -1;
export const NOTES_LIST_SCROLL_THRESHOLD = 200;
+
+export const BYTES_IN_ONE_MEGABYTE = 1000000;
diff --git a/app/assets/stylesheets/_sn.scss b/app/assets/stylesheets/_sn.scss
index 34d54f0c8..952075a9c 100644
--- a/app/assets/stylesheets/_sn.scss
+++ b/app/assets/stylesheets/_sn.scss
@@ -514,6 +514,11 @@
padding-bottom: 0.625rem;
}
+.py-3\.5 {
+ padding-top: 0.875rem;
+ padding-bottom: 0.875rem;
+}
+
.py-9 {
padding-top: 2.25rem;
padding-bottom: 2.25rem;
@@ -835,6 +840,10 @@
}
}
+.flex-shrink-0 {
+ flex-shrink: 0;
+}
+
.dimmed {
opacity: .5;
cursor: default;
@@ -844,3 +853,7 @@
.hide-if-last-child:last-child {
display: none;
}
+
+.bg-note-size-warning {
+ background-color: rgba(235, 173, 0, 0.08);
+}
diff --git a/package.json b/package.json
index ea6e4f311..eba71f912 100644
--- a/package.json
+++ b/package.json
@@ -84,7 +84,7 @@
"@reach/tooltip": "^0.16.2",
"@standardnotes/components": "1.5.0",
"@standardnotes/features": "1.27.0",
- "@standardnotes/snjs": "2.51.1",
+ "@standardnotes/snjs": "2.51.2",
"@standardnotes/settings": "^1.11.3",
"@standardnotes/sncrypto-web": "1.6.2",
"mobx": "^6.3.5",
diff --git a/yarn.lock b/yarn.lock
index d9d413900..55f085594 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2650,10 +2650,10 @@
buffer "^6.0.3"
libsodium-wrappers "^0.7.9"
-"@standardnotes/snjs@2.51.1":
- version "2.51.1"
- resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.51.1.tgz#404f0a407b0c0eb19ac847081336c1ce9deeee5f"
- integrity sha512-Aeeh++8nEg/FdV4Pxjbm9XmeLNRM57V+mvtVt08U8O+k11XndfjZIDWmPaOfcRBqQtBx47NcvxbXagABz2XSqA==
+"@standardnotes/snjs@2.51.2":
+ version "2.51.2"
+ resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.51.2.tgz#9804e27071a8d139bf72095d94231a1e29a61593"
+ integrity sha512-sxS/QnDnOqUx88Mv8BVR2sd4UAvrBQj0Daa9rH5+INryY5qkLdlTod6MqDfxy+MRkyioVpDAE+yYuBJbcPyqQw==
dependencies:
"@standardnotes/auth" "^3.15.3"
"@standardnotes/common" "^1.8.0"