From 8b591a2ee4eca01ebe702824e5afbd0faee05f4f Mon Sep 17 00:00:00 2001 From: Compositr Date: Sun, 8 Oct 2023 11:00:09 +1100 Subject: [PATCH 1/6] feat: sync on ctrl+s * addresses [Bug]: ctrl+s should sync #1685 --- .../src/components/Titlebar.tsx | 59 +++++++++++-------- 1 file changed, 35 insertions(+), 24 deletions(-) diff --git a/packages/desktop-client/src/components/Titlebar.tsx b/packages/desktop-client/src/components/Titlebar.tsx index 77a51757b1c..1237eb69f30 100644 --- a/packages/desktop-client/src/components/Titlebar.tsx +++ b/packages/desktop-client/src/components/Titlebar.tsx @@ -32,6 +32,7 @@ import Link from './common/Link'; import Paragraph from './common/Paragraph'; import Text from './common/Text'; import View from './common/View'; +import { KeyHandlers } from './KeyHandlers'; import LoggedInUser from './LoggedInUser'; import { useServerURL } from './ServerContext'; import { useSidebar } from './sidebar'; @@ -173,30 +174,40 @@ export function SyncButton({ style, isMobile = false }: SyncButtonProps) { : {}; return ( - + <> + { + sync(); + }, + }} + /> + + + ); } From 7d602da48987263ce3282a364478e930fd5dd7b6 Mon Sep 17 00:00:00 2001 From: Compositr Date: Sun, 8 Oct 2023 11:06:16 +1100 Subject: [PATCH 2/6] chore: write release note for #1770 --- upcoming-release-notes/1770.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 upcoming-release-notes/1770.md diff --git a/upcoming-release-notes/1770.md b/upcoming-release-notes/1770.md new file mode 100644 index 00000000000..973565a3d8c --- /dev/null +++ b/upcoming-release-notes/1770.md @@ -0,0 +1,6 @@ +--- +category: Enhancement +authors: [Compositr, shaankhosla] +--- + +Sync on Ctrl+S \ No newline at end of file From c792f42e685e3f5ac86c462ea776df2962751361 Mon Sep 17 00:00:00 2001 From: Compositr Date: Sun, 8 Oct 2023 11:07:42 +1100 Subject: [PATCH 3/6] chore: Enhancement -> Enhancements --- upcoming-release-notes/1770.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upcoming-release-notes/1770.md b/upcoming-release-notes/1770.md index 973565a3d8c..a73c4ca0ad8 100644 --- a/upcoming-release-notes/1770.md +++ b/upcoming-release-notes/1770.md @@ -1,5 +1,5 @@ --- -category: Enhancement +category: Enhancements authors: [Compositr, shaankhosla] --- From 37ef71b52de4b2ffb3cf1980b87a1542a10f79c4 Mon Sep 17 00:00:00 2001 From: Compositr Date: Tue, 10 Oct 2023 16:20:20 +1100 Subject: [PATCH 4/6] refactor: more consise Co-authored-by: MatissJanis Co-authored-by: Matiss Janis Aboltins --- packages/desktop-client/src/components/Titlebar.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/desktop-client/src/components/Titlebar.tsx b/packages/desktop-client/src/components/Titlebar.tsx index 1237eb69f30..a47f5208c24 100644 --- a/packages/desktop-client/src/components/Titlebar.tsx +++ b/packages/desktop-client/src/components/Titlebar.tsx @@ -177,9 +177,7 @@ export function SyncButton({ style, isMobile = false }: SyncButtonProps) { <> { - sync(); - }, + 'ctrl+s': sync, }} /> From 81446614a0c3f5c945d96d7d3cfbe37e25d64af7 Mon Sep 17 00:00:00 2001 From: Compositr Date: Tue, 10 Oct 2023 16:32:50 +1100 Subject: [PATCH 5/6] fix: revert 37ef71b due to typeerror * Keyhanders requires us to return void --- packages/desktop-client/src/components/Titlebar.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/desktop-client/src/components/Titlebar.tsx b/packages/desktop-client/src/components/Titlebar.tsx index a47f5208c24..1237eb69f30 100644 --- a/packages/desktop-client/src/components/Titlebar.tsx +++ b/packages/desktop-client/src/components/Titlebar.tsx @@ -177,7 +177,9 @@ export function SyncButton({ style, isMobile = false }: SyncButtonProps) { <> { + sync(); + }, }} /> From e2b3f2acc6348e816455454ae4c8be2e44cded8d Mon Sep 17 00:00:00 2001 From: Compositr Date: Tue, 10 Oct 2023 16:37:41 +1100 Subject: [PATCH 6/6] feat: mac command key support for sync keybind * added cmd+s support for triggering manual sync --- packages/desktop-client/src/components/Titlebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/desktop-client/src/components/Titlebar.tsx b/packages/desktop-client/src/components/Titlebar.tsx index 1237eb69f30..6c305f23787 100644 --- a/packages/desktop-client/src/components/Titlebar.tsx +++ b/packages/desktop-client/src/components/Titlebar.tsx @@ -177,7 +177,7 @@ export function SyncButton({ style, isMobile = false }: SyncButtonProps) { <> { + 'ctrl+s, cmd+s': () => { sync(); }, }}