Repository navigation
Studio: open the tile's own menu on a right-click in the Images strip - #15276
danielhanchen merged 4 commits into
Conversation
A right-click on a strip thumbnail showed the webview's native image menu. Its Open Image in New Window and Copy Image items cannot act on the strip's blob: object URLs inside the desktop app, so they silently did nothing. The tile now cancels the native menu and opens its existing actions menu (Edit image, Pin, Favorites, Download, Project, Archive, Delete), the same one its hover button opens. GalleryItemMenu gains optional open and onOpenChange props for this; callers that pass neither are unchanged. Fixes unslothai#15272
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #15272
Before: right-clicking a thumbnail in the Images strip showed the webview's native image menu (Open Image in New Window, Save Image As, Copy Image, Copy Image Address). The thumbnails are
blob:object URLs, and inside the desktop app Open Image in New Window and Copy Image do nothing with them, so the menu offered actions that silently failed.After: right-clicking a strip tile opens that tile's own actions menu (Edit image, Pin, Add to Favorites, Download, Project, Archive, Delete), the same menu the tile's hover button opens, anchored at the tile. The native menu no longer appears there. The keyboard context-menu key and Shift+F10 open it too, since they fire the same event.
How: the tile wrapper handles
contextmenu, callspreventDefault(), and records which tile asked.GalleryItemMenutakes optionalopen/onOpenChangeprops so the page can open it; when they are omitted it keeps its own state as before, so the Video, Audio and toolbar uses are unchanged. The request is dropped when the page goes off-tab or the tile is removed, in the same render-time way the viewer'sviewerIdalready is, so a stale request cannot reopen the menu later.Copy Image is not added to the menu: the desktop app can't write images to the clipboard today (see
canCopyVideoFrameinfeatures/browser/video-registry.ts), so offering it would repeat the bug. Download covers saving the file.Testing
tests/images-strip-context-menu.test.ts(fails on main, passes here).npm run typecheckpasses. ESLint on the two changed files reports the same findings as on main and nothing new.contextmenuwithdefaultPrevented === trueand opens that tile's menu; Escape closes it; right-clicking another tile while it is open moves the menu to that tile; the hover button still opens the menu. On main the same script finds no menu.I tested on Windows in Chromium. I don't have Fedora or a WebKitGTK build of the desktop app here, so I couldn't try the native menu suppression in that webview directly; it relies on the standard
preventDefault()oncontextmenu, which WebKitGTK honours.Desktop only
The right-click handler only acts inside the desktop app (
isTauri). In a browser the native image menu works on these thumbnails (Copy Image, Open Image in New Tab, Save Image As), so browser Studio keeps it unchanged. Both the tile menu and the hover button are otherwise identical everywhere.Screenshots
Right-click on the first strip tile, production build of Studio, menu code as in this PR. The desktop webview cannot be driven here, so the shot is from Chromium with the desktop gate off; inside the desktop app the AFTER menu is what a right-click opens, and in a browser the BEFORE behaviour is kept.