From cd326d1ddee4295e547b88f04442132084ec0674 Mon Sep 17 00:00:00 2001 From: Anthony Cooper Date: Tue, 26 Aug 2025 13:11:17 -0400 Subject: [PATCH 1/9] need to commit to switch branch --- web/src/components/MemoActionMenu.tsx | 40 ++++++++++++-- web/src/themes/default.css | 80 +++++++++++---------------- 2 files changed, 68 insertions(+), 52 deletions(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index 051a9a8bcac68..fe49249418a94 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -89,10 +89,17 @@ const MemoActionMenu = observer((props: Props) => { return; } }; - + // const handleToggleMemoStatusClick = async () => { - const state = memo.state === State.ARCHIVED ? State.NORMAL : State.ARCHIVED; - const message = memo.state === State.ARCHIVED ? t("message.restored-successfully") : t("message.archived-successfully"); + //just review async in notes + //changing the state + const state = memo.state === State.ARCHIVED + ? State.NORMAL + : State.ARCHIVED; + //showing message depending on state + const message = memo.state === State.ARCHIVED + ? t("message.restored-successfully") + : t("message.archived-successfully"); try { await memoStore.updateMemo( { @@ -101,7 +108,32 @@ const MemoActionMenu = observer((props: Props) => { }, ["state"], ); - toast(message); + + // Show toast with Undo button + toast.custom((tToast) => ( +
+ {message} + +
+ )); + } catch (error: any) { toast.error(error.details); console.error(error); diff --git a/web/src/themes/default.css b/web/src/themes/default.css index 47da7189506e6..84364587979ed 100644 --- a/web/src/themes/default.css +++ b/web/src/themes/default.css @@ -1,52 +1,36 @@ :root { - --background: oklch(0.9818 0.0054 95.0986); - --foreground: oklch(0.2438 0.0269 95.7226); - --card: oklch(0.9818 0.0054 95.0986); - --card-foreground: oklch(0.1908 0.002 106.5859); - --popover: oklch(1 0 0); - --popover-foreground: oklch(0.2671 0.0196 98.939); - --primary: oklch(0.3918 0.0127 286.3); - --primary-foreground: oklch(0.9818 0.0054 95.0986); - --secondary: oklch(0.9245 0.0138 92.9892); - --secondary-foreground: oklch(0.4334 0.0177 98.6048); - --muted: oklch(0.9341 0.0153 90.239); - --muted-foreground: oklch(0.5559 0.0075 97.4233); - --accent: oklch(0.9245 0.0138 92.9892); - --accent-foreground: oklch(0.2671 0.0196 98.939); - --destructive: oklch(0.35 0.02 250); - --destructive-foreground: oklch(0.95 0.005 250); - --border: oklch(0.8847 0.0069 97.3627); - --input: oklch(0.7621 0.0156 98.3528); - --ring: oklch(0.5937 0.1673 253.063); - --chart-1: oklch(0.5583 0.1276 42.9956); - --chart-2: oklch(0.6898 0.1581 290.4107); - --chart-3: oklch(0.8816 0.0276 93.128); - --chart-4: oklch(0.8822 0.0403 298.1792); - --chart-5: oklch(0.5608 0.1348 42.0584); - --sidebar: oklch(0.9663 0.008 98.8792); - --sidebar-foreground: oklch(0.359 0.0051 106.6524); - --sidebar-primary: oklch(0.3918 0.0127 286.3); - --sidebar-primary-foreground: oklch(0.9818 0.0054 95.0986); - --sidebar-accent: oklch(0.9245 0.0138 92.9892); - --sidebar-accent-foreground: oklch(0.325 0 0); - --sidebar-border: oklch(0.9401 0 0); - --sidebar-ring: oklch(0.7731 0 0); - --font-sans: - ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, - "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; - --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; - --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; - --radius: 0.5rem; - --shadow-2xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05); - --shadow-xs: 0 1px 3px 0px hsl(0 0% 0% / 0.05); - --shadow-sm: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1); - --shadow: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 1px 2px -1px hsl(0 0% 0% / 0.1); - --shadow-md: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 2px 4px -1px hsl(0 0% 0% / 0.1); - --shadow-lg: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 4px 6px -1px hsl(0 0% 0% / 0.1); - --shadow-xl: 0 1px 3px 0px hsl(0 0% 0% / 0.1), 0 8px 10px -1px hsl(0 0% 0% / 0.1); - --shadow-2xl: 0 1px 3px 0px hsl(0 0% 0% / 0.25); - --tracking-normal: 0em; - --spacing: 0.25rem; + --background: oklch(22% 0.07 300); + --foreground: oklch(87% 0.08 300); + --card: oklch(22% 0.07 300); + --card-foreground: oklch(84% 0.07 302); + --popover: oklch(30% 0.02 300); + --popover-foreground: oklch(85% 0.02 300); + --primary: oklch(70% 0.09 300); + --primary-foreground: oklch(22% 0.07 300); + --secondary: oklch(34% 0.01 300); + --secondary-foreground: oklch(82% 0.02 300); + --muted: oklch(25% 0.01 300); + --muted-foreground: oklch(55% 0.04 300); + --accent: oklch(32% 0.02 300); + --accent-foreground: oklch(82% 0.02 300); + --destructive: oklch(55% 0.015 20); + --destructive-foreground: oklch(95% 0.01 20); + --border: oklch(36% 0.03 300); + --input: oklch(45% 0.015 300); + --ring: oklch(60% 0.15 300); + --chart-1: oklch(55% 0.12 40); + --chart-2: oklch(68% 0.15 300); + --chart-3: oklch(45% 0.02 245); + --chart-4: oklch(32% 0.05 300); + --chart-5: oklch(56% 0.13 40); + --sidebar: oklch(18% 0.05 300); + --sidebar-foreground: oklch(87% 0.08 300); + --sidebar-primary: oklch(12% 0.03 300); + --sidebar-primary-foreground: oklch(27% 0.01 300); + --sidebar-accent: oklch(25% 0.08 300); + --sidebar-accent-foreground: oklch(82% 0.02 300); + --sidebar-border: oklch(37% 0.01 110); + --sidebar-ring: oklch(60% 0.15 300); } @theme inline { From 8523f921db124a79423d7ccb16ca356fd669dae6 Mon Sep 17 00:00:00 2001 From: Anthony Cooper Date: Tue, 26 Aug 2025 13:13:30 -0400 Subject: [PATCH 2/9] need to commit to switch branch --- web/src/components/MemoActionMenu.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index fe49249418a94..638f2e0f659e8 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -89,7 +89,7 @@ const MemoActionMenu = observer((props: Props) => { return; } }; - // + //() => Promise.resolve(42) const handleToggleMemoStatusClick = async () => { //just review async in notes //changing the state @@ -104,7 +104,7 @@ const MemoActionMenu = observer((props: Props) => { await memoStore.updateMemo( { name: memo.name, - state, + state }, ["state"], ); From 3b4b90861c0a08c248671c1db15e0b2fa8d3f3cb Mon Sep 17 00:00:00 2001 From: Anthony Cooper Date: Tue, 26 Aug 2025 13:23:08 -0400 Subject: [PATCH 3/9] need to commit to switch branch --- web/src/components/MemoActionMenu.tsx | 63 ++++++++++++--------------- 1 file changed, 29 insertions(+), 34 deletions(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index 638f2e0f659e8..9131f91122869 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -89,51 +89,46 @@ const MemoActionMenu = observer((props: Props) => { return; } }; - //() => Promise.resolve(42) + //() => Promise.resolve({}) const handleToggleMemoStatusClick = async () => { - //just review async in notes //changing the state - const state = memo.state === State.ARCHIVED - ? State.NORMAL - : State.ARCHIVED; + const state = memo.state === State.ARCHIVED ? State.NORMAL : State.ARCHIVED; //showing message depending on state - const message = memo.state === State.ARCHIVED - ? t("message.restored-successfully") - : t("message.archived-successfully"); + const message = memo.state === State.ARCHIVED ? t("message.restored-successfully") : t("message.archived-successfully"); try { await memoStore.updateMemo( { name: memo.name, - state + state, }, ["state"], ); - // Show toast with Undo button - toast.custom((tToast) => ( -
- {message} - -
- )); - + // Show toast with Undo button + //input is function that takes in the toast object we will work with and it will be used in the output of the higher order function + toast.custom((tToast) => ( +
+ {message} + +
+ )); } catch (error: any) { toast.error(error.details); console.error(error); From c679bd6fdd17019e6834e6b5ecdbfd172e7cd31f Mon Sep 17 00:00:00 2001 From: Anthony Cooper Date: Wed, 27 Aug 2025 10:11:19 -0400 Subject: [PATCH 4/9] need to commit to switch branch --- web/src/components/MemoActionMenu.tsx | 61 ++++++++++++++++----------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index 9131f91122869..a894dfd38e23f 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -89,13 +89,17 @@ const MemoActionMenu = observer((props: Props) => { return; } }; - //() => Promise.resolve({}) + + //async () => {} = () => Promise.resolve({}) + //await promiseFunc, this just waits for the promise to be fulfilled + //use async just so we can use await inside, dont care about returned Promise const handleToggleMemoStatusClick = async () => { //changing the state const state = memo.state === State.ARCHIVED ? State.NORMAL : State.ARCHIVED; //showing message depending on state const message = memo.state === State.ARCHIVED ? t("message.restored-successfully") : t("message.archived-successfully"); try { + //must wait for this promise returned by updateMemo to be fulfileld before continuing await memoStore.updateMemo( { name: memo.name, @@ -104,31 +108,38 @@ const MemoActionMenu = observer((props: Props) => { ["state"], ); - // Show toast with Undo button + //Show toast with Undo button //input is function that takes in the toast object we will work with and it will be used in the output of the higher order function - toast.custom((tToast) => ( -
- {message} - -
- )); + toast.custom( + ( + tToast, + ) => ( + //div container +
+ {message} + +
+ ), + ); } catch (error: any) { toast.error(error.details); console.error(error); From 21baf2a55adfe14d5f6e53ffa1a1ab98ac0a07a7 Mon Sep 17 00:00:00 2001 From: Anthony Cooper Date: Sat, 30 Aug 2025 21:46:29 -0400 Subject: [PATCH 5/9] need to commit to switch branch --- web/src/components/MemoActionMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index a894dfd38e23f..7f35791b86aea 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -115,7 +115,7 @@ const MemoActionMenu = observer((props: Props) => { tToast, ) => ( //div container -
+
{message}
), diff --git a/web/src/locales/en.json b/web/src/locales/en.json index d3833b9a63bbb..2e9a855e346ef 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -93,6 +93,7 @@ "title": "Title", "tree-mode": "Tree mode", "type": "Type", + "undo": "Undo", "unpin": "Unpin", "update": "Update", "upload": "Upload", From 9d8b30ab85dd59154b096c29472c9abca541e249 Mon Sep 17 00:00:00 2001 From: Anthony Cooper Date: Sun, 31 Aug 2025 13:03:03 -0400 Subject: [PATCH 7/9] fixed style a bit --- web/src/components/MemoActionMenu.tsx | 8 +++++++- web/src/locales/en.json | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index 32b61f51abbc0..606e367aa8810 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -131,7 +131,13 @@ const MemoActionMenu = observer((props: Props) => { ["state"], ); toast.dismiss(tToast.id); // close the toast - toast.success(t("message.undo-successful")); // optional success toast + toast.custom( + (tToast) => ( +
+ {t("message.undo-successful")} +
+ ) + ); // optional success toast memoUpdatedCallback(); }} > diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 2e9a855e346ef..2ca539be7805f 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -189,6 +189,7 @@ "remove-completed-task-list-items-successfully": "The removal was successful", "restored-successfully": "Restored successfully", "succeed-copy-link": "Link copied successfully.", + "undo-successful": "Undo successful", "update-succeed": "Update succeeded", "user-not-found": "User not found" }, From a0d7b7c75b329cfa9ef61c92e0c65cdd59aa81d1 Mon Sep 17 00:00:00 2001 From: Anthony Cooper Date: Sun, 31 Aug 2025 13:11:42 -0400 Subject: [PATCH 8/9] fixed undo successful message size --- web/src/components/MemoActionMenu.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index 606e367aa8810..b455dac9a9ad1 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -133,7 +133,7 @@ const MemoActionMenu = observer((props: Props) => { toast.dismiss(tToast.id); // close the toast toast.custom( (tToast) => ( -
+
{t("message.undo-successful")}
) From 8d50cc0f1beb60c750d693f6d0a976703e6638e7 Mon Sep 17 00:00:00 2001 From: Anthony Cooper Date: Sun, 31 Aug 2025 22:12:53 -0400 Subject: [PATCH 9/9] fixed prettier issues for MemoActionMenu.tsx --- web/src/components/MemoActionMenu.tsx | 71 ++++++++++----------------- 1 file changed, 26 insertions(+), 45 deletions(-) diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index b455dac9a9ad1..e5d6e0976a647 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -90,16 +90,10 @@ const MemoActionMenu = observer((props: Props) => { } }; - //async () => {} = () => Promise.resolve({}) - //await promiseFunc, this just waits for the promise to be fulfilled - //use async just so we can use await inside, dont care about returned Promise const handleToggleMemoStatusClick = async () => { - //changing the state const state = memo.state === State.ARCHIVED ? State.NORMAL : State.ARCHIVED; - //showing message depending on state const message = memo.state === State.ARCHIVED ? t("message.restored-successfully") : t("message.archived-successfully"); try { - //must wait for this promise returned by updateMemo to be fulfileld before continuing await memoStore.updateMemo( { name: memo.name, @@ -108,44 +102,32 @@ const MemoActionMenu = observer((props: Props) => { ["state"], ); - //Show toast with Undo button - //input is function that takes in the toast object we will work with and it will be used in the output of the higher order function - toast.custom( - ( - tToast, - ) => ( - //div container -
- {message} - -
- ), - ); + toast.custom((tToast) => ( +
+ {message} + +
+ )); } catch (error: any) { toast.error(error.details); console.error(error); @@ -188,7 +170,6 @@ const MemoActionMenu = observer((props: Props) => { const children = node.listNode.children; for (let i = 0; i < children.length; i++) { if (children[i].type === NodeType.TASK_LIST_ITEM && children[i].taskListItemNode?.complete) { - // Remove completed taskList item and next line breaks children.splice(i, 1); if (children[i]?.type === NodeType.LINE_BREAK) { children.splice(i, 1);