Fix renderer scope collisions, editor bugs; add welcome screen
Bug fixes from code review: - Wrap renderer modules (canvas/dialogs/editor/app) in IIFEs: duplicate top-level 'const api' across plain scripts threw a SyntaxError that prevented app.js from ever running (blank window), and dialogs.js/ editor.js silently overrode each other's labeledRow/makeSelect - Focused-view toggle now writes step.focusedView.enabled instead of a nonexistent flat field that the schema dropped on save - Annotation property edits no longer rebuild the panel on every keystroke (focus was stolen mid-typing); debounced save instead - flushStep/undo/redo keep this.steps in sync with stepMap so the step list stops going stale after the first save - Escape now deselects the annotation; Delete remains the delete key Welcome screen (per spec): app opens to a title at top and three buttons at the bottom — New Capture (creates a guide, opens the editor, starts a capture session), Existing Workspace (library), Settings. Brand click returns to the welcome screen. Adds an env-gated dev screenshot hook (STEPFORGE_SCREENSHOT[_JS]) used to visually verify welcome/library/editor views under WSLg. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+23
-1
@@ -76,7 +76,29 @@ function createWindow() {
|
||||
},
|
||||
});
|
||||
mainWindow.loadFile(path.join(__dirname, 'renderer', 'index.html'));
|
||||
mainWindow.once('ready-to-show', () => mainWindow.show());
|
||||
mainWindow.once('ready-to-show', () => {
|
||||
mainWindow.show();
|
||||
// Dev-only verification hook: optionally navigate, then write a
|
||||
// screenshot locally and exit. Used by the smoke tooling.
|
||||
if (process.env.STEPFORGE_SCREENSHOT) {
|
||||
const target = process.env.STEPFORGE_SCREENSHOT;
|
||||
const navigate = process.env.STEPFORGE_SCREENSHOT_JS || '';
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
if (navigate) {
|
||||
await mainWindow.webContents.executeJavaScript(navigate, true);
|
||||
await new Promise((r) => setTimeout(r, 900));
|
||||
}
|
||||
const image = await mainWindow.webContents.capturePage();
|
||||
fs.writeFileSync(target, image.toPNG());
|
||||
} catch (err) {
|
||||
console.error('screenshot failed:', err.message);
|
||||
} finally {
|
||||
app.quit();
|
||||
}
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
mainWindow.on('closed', () => { mainWindow = null; });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user