Add image conversion actions to Drop Shelf#1303
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1873921dcc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| @MainActor | ||
| private func showConvertImageDialog(for imageURL: URL, format: ImageConversionFormat) { | ||
| let selected = ShelfSelectionModel.shared.selectedItems(in: ShelfStateViewModel.shared.items) | ||
| guard selected.count == 1 else { return } |
There was a problem hiding this comment.
Avoid showing a conversion action that no-ops
When a user selects exactly one image together with any non-image file, presentContextMenu still adds the Convert Image submenu because it only checks imageURLs.count == 1, but selecting a target format reaches this guard and immediately returns because the overall selection has more than one item. That leaves a visible conversion command that silently does nothing for mixed selections; either hide the submenu unless the whole selection is a single item, or allow the single image URL through here.
Useful? React with 👍 / 👎.
|
Is this not already available on the |
Fixes #1291.
What changed
This adds image conversion actions to the Drop Shelf context menu.
When a supported image is in the Shelf, the user can now choose:
Image Actions → Convert Image → [Format]
The available output formats are detected at runtime using native macOS Image I/O write support, so unsupported formats are not shown. The image’s current format is also excluded from the conversion list.
Scope
This PR keeps the feature focused on image conversion only.
Supported target formats:
This does not add video conversion, batch conversion, compression controls, or a separate converter interface.
Notes
The conversion is handled through the existing Shelf image-processing flow and keeps the UI small by exposing conversion as a contextual file action instead of adding a new panel or tab.
Converted files are written as new files rather than overwriting the original.
Testing
Tested:
Image Actions → Convert Imageappears