Skip to content

Commit e6b639c

Browse files
authored
feat: isolate run button (#1952)
* feat: isolate run button Assisted-by: Claude Opus 4.7 * chore: address code review feedback Assisted-by: Claude Opus 4.7
1 parent c4a4888 commit e6b639c

37 files changed

Lines changed: 1031 additions & 279 deletions

forge.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const config: ForgeConfig = {
3636
name: '@electron-forge/plugin-webpack',
3737
config: {
3838
devContentSecurityPolicy:
39-
"default-src 'none'; img-src 'self' https: data:; media-src 'none'; child-src 'self'; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; font-src 'self' https:;",
39+
"default-src 'none'; img-src 'self' https: data:; media-src 'none'; child-src 'self' isolated-actions:; object-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; connect-src 'self' https:; font-src 'self' https:;",
4040
devServer: {
4141
// Disallow browser from opening/reloading with HMR in development mode.
4242
open: false,
@@ -55,6 +55,11 @@ const config: ForgeConfig = {
5555
js: path.join(root, 'src/preload/preload.ts'),
5656
},
5757
},
58+
{
59+
html: path.join(root, './static/isolated-run-button.html'),
60+
js: path.join(root, './src/isolated-run-button.ts'),
61+
name: 'isolated_run_button',
62+
},
5863
],
5964
},
6065
},

src/ambient.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@ declare global {
167167
setShowMeTemplate(template?: string): void;
168168
showWarningDialog(messageOptions: MessageOptions): void;
169169
showWindow(): void;
170-
startFiddle(): Promise<void>;
171170
stopFiddle(): void;
172171
themePath: string;
173172
uncacheTypes(ver: RunnableVersion): Promise<void>;

src/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ export const ELECTRON_DTS = 'electron.d.ts';
77
// We use these to fail fast locally when creating/updating a new gist.
88
export const GIST_MAX_FILE_SIZE = 10 * 1024 * 1024; // 10 MB per file
99
export const GIST_MAX_FILE_COUNT = 300;
10+
11+
export const PREFERS_DARK_MEDIA_QUERY = '(prefers-color-scheme: dark)';

src/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export type FiddleEvent =
188188
| 'select-all-in-editor'
189189
| 'set-show-me-template'
190190
| 'show-welcome-tour'
191+
| 'theme-loaded'
191192
| 'toggle-bisect'
192193
| 'toggle-monaco-option'
193194
| 'undo-in-editor'

src/ipc-events.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export enum IpcEvents {
3838
OPEN_THEME_FOLDER = 'OPEN_THEME_FOLDER',
3939
READ_THEME_FILE = 'READ_THEME_FILE',
4040
GET_THEME_PATH = 'GET_THEME_PATH',
41+
THEME_LOADED = 'THEME_LOADED',
4142
IS_DEV_MODE = 'IS_DEV_MODE',
4243
NPM_ADD_MODULES = 'NPM_ADD_MODULES',
4344
NPM_IS_PM_INSTALLED = 'NPM_IS_PM_INSTALLED',

0 commit comments

Comments
 (0)