Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

improvement: adding zen mode to context menu (#2734)

Carl Sverre629341da4d1d
diff --git a/src/actions/shortcuts.ts b/src/actions/shortcuts.ts
index cab6526b0e..e2fcf595ac 100644
--- a/src/actions/shortcuts.ts
+++ b/src/actions/shortcuts.ts
@@ -20,6 +20,7 @@ export type ShortcutName =
| "group"
| "ungroup"
| "gridMode"
+ | "zenMode"
| "stats"
| "addToLibrary";
@@ -52,6 +53,7 @@ const shortcutMap: Record<ShortcutName, string[]> = {
group: [getShortcutKey("CtrlOrCmd+G")],
ungroup: [getShortcutKey("CtrlOrCmd+Shift+G")],
gridMode: [getShortcutKey("CtrlOrCmd+'")],
+ zenMode: [getShortcutKey("Alt+Z")],
stats: [],
addToLibrary: [],
};
diff --git a/src/components/App.tsx b/src/components/App.tsx
index a53fe52df2..cdee1645a0 100644
--- a/src/components/App.tsx
+++ b/src/components/App.tsx
@@ -3638,6 +3638,12 @@ class App extends React.Component<ExcalidrawProps, AppState> {
label: t("labels.gridMode"),
action: this.toggleGridMode,
},
+ {
+ checked: this.state.zenModeEnabled,
+ shortcutName: "zenMode",
+ label: t("buttons.zenMode"),
+ action: this.toggleZenMode,
+ },
{
checked: this.state.showStats,
shortcutName: "stats",
diff --git a/src/packages/excalidraw/CHANGELOG.md b/src/packages/excalidraw/CHANGELOG.md
index 4d6774a891..865a644702 100644
--- a/src/packages/excalidraw/CHANGELOG.md
+++ b/src/packages/excalidraw/CHANGELOG.md
@@ -44,6 +44,7 @@ Please add the latest change on the top under the correct section.
### Improvements
+- Added Zen Mode to the context menu [#2734](https://github.com/excalidraw/excalidraw/pull/2734)
- Do not reset to selection when using the draw tool [#2721](https://github.com/excalidraw/excalidraw/pull/2721)
- Display proper tooltip for 2-point lines during resize, and normalize modifier key labels in hints [#2655](https://github.com/excalidraw/excalidraw/pull/2655)
- Improve error message around importing images [#2619](https://github.com/excalidraw/excalidraw/pull/2619)
diff --git a/src/tests/regressionTests.test.tsx b/src/tests/regressionTests.test.tsx
index c6ef784294..95fb5662ec 100644
--- a/src/tests/regressionTests.test.tsx
+++ b/src/tests/regressionTests.test.tsx
@@ -621,6 +621,7 @@ describe("regression tests", () => {
const expectedShortcutNames: ShortcutName[] = [
"selectAll",
"gridMode",
+ "zenMode",
"stats",
];