Skip to content

Commit ab1479f

Browse files
authored
Merge pull request #384 from andrewjpoole/dev
feat: add enable and disable Zen Mode actions for demos
2 parents 1fc8b58 + dc13763 commit ab1479f

File tree

9 files changed

+98
-1
lines changed

9 files changed

+98
-1
lines changed

apps/vscode-extension/src/services/DemoRunner.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,17 @@ export class DemoRunner {
988988
return;
989989
}
990990

991+
if (step.action === Action.EnableZenMode) {
992+
await commands.executeCommand('workbench.action.exitZenMode');
993+
await commands.executeCommand('workbench.action.toggleZenMode');
994+
return;
995+
}
996+
997+
if (step.action === Action.DisableZenMode) {
998+
await commands.executeCommand('workbench.action.exitZenMode');
999+
return;
1000+
}
1001+
9911002
// Open a new terminal
9921003
if (step.action === Action.OpenTerminal) {
9931004
await TerminalService.openTerminal(step.terminalId);

apps/vscode-extension/src/utils/getActionOptions.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,16 @@ export const getActionOptions = (): QuickPickItem[] => {
301301
description: 'Reset the editor zoom level',
302302
} as QuickPickItem);
303303

304+
actions.push({
305+
label: Action.EnableZenMode,
306+
description: 'Enable Zen Mode',
307+
} as QuickPickItem);
308+
309+
actions.push({
310+
label: Action.DisableZenMode,
311+
description: 'Disable Zen Mode',
312+
} as QuickPickItem);
313+
304314
/**
305315
* Extensibility actions
306316
*/

apps/vscode-extension/src/utils/getActionTemplate.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,18 @@ export const getActionTemplate = (selectedAction: QuickPickItem): any => {
352352
};
353353
}
354354

355+
if (action === Action.EnableZenMode) {
356+
return {
357+
action: Action.EnableZenMode,
358+
};
359+
}
360+
361+
if (action === Action.DisableZenMode) {
362+
return {
363+
action: Action.DisableZenMode,
364+
};
365+
}
366+
355367
/**
356368
* Extensibility actions
357369
*/

apps/webviews/src/types/demo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ export const CATEGORIZED_ACTIONS: {
8888
Action.ZoomIn,
8989
Action.ZoomOut,
9090
Action.ZoomReset,
91+
Action.EnableZenMode,
92+
Action.DisableZenMode,
9193
],
9294
},
9395
{

apps/webviews/src/utils/actionHelpers.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ export const getActionIcon = (action: Action): string => {
8989
[Action.ZoomIn]: 'zoom-in',
9090
[Action.ZoomOut]: 'zoom-out',
9191
[Action.ZoomReset]: 'refresh-cw',
92+
[Action.EnableZenMode]: 'maximize',
93+
[Action.DisableZenMode]: 'minimize',
9294
};
9395
return iconMap[action] || 'circle';
9496
};
@@ -241,6 +243,8 @@ export const getRequiredFields = (action: Action): string[] => {
241243
[Action.ZoomIn]: [],
242244
[Action.ZoomOut]: [],
243245
[Action.ZoomReset]: [],
246+
[Action.EnableZenMode]: [],
247+
[Action.DisableZenMode]: [],
244248
};
245249
return requiredMap[action] || [];
246250
};
@@ -367,6 +371,8 @@ export const getFieldsForAction = (action: Action): string[] => {
367371
[Action.ZoomIn]: ['zoom'],
368372
[Action.ZoomOut]: ['zoom'],
369373
[Action.ZoomReset]: [],
374+
[Action.EnableZenMode]: [],
375+
[Action.DisableZenMode]: [],
370376
};
371377

372378
return fieldMap[action] || [];

docs/changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
- [#343](https://github.com/estruyf/vscode-demo-time/issues/343): added the zoom
1111
actions: `zoomIn`, `zoomOut`, and `zoomReset` to control the editor zoom level
1212
during your demo
13+
- [`#383`](https://github.com/estruyf/vscode-demo-time/issues/383): Added the `enableZenMode` and `disableZenMode` actions to control Zen Mode
14+
during Scenes
1315
- [#348](https://github.com/estruyf/vscode-demo-time/issues/348): Added the
1416
analytics PRO feature
1517

docs/public/demo-time.schema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@
112112
"zoomIn",
113113
"zoomOut",
114114
"zoomReset",
115+
"enableZenMode",
116+
"disableZenMode",
115117
"openTerminal",
116118
"focusTerminal",
117119
"executeTerminalCommand",

docs/src/content/docs/actions/vscode.mdx

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Visual Studio Code actions
33
description: Perform Visual Studio Code actions in your demos like executing commands or showing an information message.
4-
lastmod: 2025-12-19T00:00:00.000Z
4+
lastmod: 2026-02-04T00:00:00.000Z
55
---
66

77
import { Image } from 'astro:assets';
@@ -295,3 +295,53 @@ openInVSCode: <true/false>
295295

296296
</TabItem>
297297
</Tabs>
298+
299+
## Zen Mode actions
300+
301+
Control Zen Mode during your Scene.
302+
303+
### Enable Zen Mode
304+
305+
Enable Zen Mode using the `enableZenMode` action in a Move.
306+
307+
<Tabs syncKey="vscode-zen-enable">
308+
<TabItem label="JSON">
309+
310+
```json
311+
{
312+
"action": "enableZenMode"
313+
}
314+
```
315+
316+
</TabItem>
317+
<TabItem label="YAML">
318+
319+
```yaml
320+
action: enableZenMode
321+
```
322+
323+
</TabItem>
324+
</Tabs>
325+
326+
### Disable Zen Mode
327+
328+
Disable Zen Mode using the `disableZenMode` action in a Move.
329+
330+
<Tabs syncKey="vscode-zen-disable">
331+
<TabItem label="JSON">
332+
333+
```json
334+
{
335+
"action": "disableZenMode"
336+
}
337+
```
338+
339+
</TabItem>
340+
<TabItem label="YAML">
341+
342+
```yaml
343+
action: disableZenMode
344+
```
345+
346+
</TabItem>
347+
</Tabs>

packages/common/src/models/Action.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ export enum Action {
4444
ZoomIn = 'zoomIn',
4545
ZoomOut = 'zoomOut',
4646
ZoomReset = 'zoomReset',
47+
EnableZenMode = 'enableZenMode',
48+
DisableZenMode = 'disableZenMode',
4749
// Terminal
4850
OpenTerminal = 'openTerminal',
4951
FocusTerminal = 'focusTerminal',

0 commit comments

Comments
 (0)