Conversation
On the desktop the upload screen's recent list duplicated what a native app puts in File › Recent Projects, so drop it there and build the real menu instead: Open Project…, Reopen Last Project and a Recent Projects submenu. The list lives in the renderer's IndexedDB, which the main process can't read, so the renderer publishes an (id, name) snapshot whenever it can have changed and the menu sends commands back. Commands wait for a window: the menu bar outlives the last window on macOS, so a click opens one and the command queues until the renderer announces it is listening, then until the page is cross-origin isolated and can actually take media. Closing the window while a project is open now returns to the upload screen instead of quitting — the autosave is flushed first, and the next close (on the upload screen) is a real one. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Chromium only shows a file chooser under user activation, and an IPC message doesn't carry one — the input.click() the menu triggered was dropped without a word. The main process now calls window.rescriptOpenFilePicker via executeJavaScript with userGesture, which grants the activation, so opening the picker leaves the command channel entirely. A file chosen before the page is cross-origin isolated waits until it is rather than failing in the pipeline. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On desktop, the upload screen's in-page "Recent" list duplicated what a native app puts in File › Recent Projects. This hides that list under Electron and builds the real menu instead.
File menu
Replacing the menu drops Electron's default one wholesale, so
electron/menu.tsrestates the standard App/Edit/View/Window items alongside File.How the list gets there
The projects live in the renderer's IndexedDB, which the main process can't read. The renderer publishes an
(id, name)snapshot on mount, on project/status change and on window focus; the menu sends commands back overmenu:command.Commands no longer require a live window:
dispatchMenuCommanduses the focused window, else any window, else creates one — the menu bar outlives the last window on macOS.webContentsuntil preload sendsmenu:renderer-ready, then flush. A cross-document navigation clears readiness so a reload re-announces.open-projectis additionally held renderer-side until the page is cross-origin isolated, otherwise a menu-opened window would drop it while the media engine was still starting.Open Project… is the exception. Chromium only shows a file chooser under user activation, which an IPC message doesn't carry — the first cut silently did nothing. The main process calls
window.rescriptOpenFilePickerthroughexecuteJavaScript(code, /* userGesture */ true)instead, which grants the activation. A file chosen before isolation settles waits rather than failing in the pipeline.Closing the window in the editor
Closing while a project is open now returns to the upload screen rather than closing:
win.on("close")cancels only when the window is inexpandedmode and the renderer is responsive, sendsclose-project, and the renderer flushes the debounced autosave beforereset(). The next close — now on the upload screen — is a real close. ⌘Q still quits (guarded by aquittingflag onbefore-quit).Note: on Windows/Linux this also means closing from the editor keeps the app alive on the upload screen and takes a second close. Easy to make that platform close outright if preferred.
Testing
tsc --noEmit(app + electron), eslint andnpm run build:electronclean.npm run electron:dev: recent list gone from the upload screen; menu entries populate, open and reopen projects.🤖 Generated with Claude Code