Skip to content

Add image conversion actions to Drop Shelf#1303

Open
TheBestVivBoy wants to merge 3 commits into
TheBoredTeam:devfrom
TheBestVivBoy:vivan/add-shelf-image-conversion-menu
Open

Add image conversion actions to Drop Shelf#1303
TheBestVivBoy wants to merge 3 commits into
TheBoredTeam:devfrom
TheBestVivBoy:vivan/add-shelf-image-conversion-menu

Conversation

@TheBestVivBoy

@TheBestVivBoy TheBestVivBoy commented Jun 4, 2026

Copy link
Copy Markdown

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:

  • PNG
  • JPG/JPEG
  • HEIC
  • WEBP

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:

  • Added image files to the Drop Shelf
  • Opened the Shelf context menu for supported image files
  • Verified Image Actions → Convert Image appears
  • Verified the current source format is excluded from the output choices
  • Verified unsupported output formats are hidden when not writable on the current macOS runtime
  • Converted PNG → JPG
  • Converted JPG → PNG
  • Confirmed the original file is not overwritten

@TheBestVivBoy TheBestVivBoy changed the title Add runtime-aware image conversion menu for shelf images Add image conversion actions to Drop Shelf Jun 4, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@Alexander5015

Copy link
Copy Markdown
Member

Is this not already available on the dev branch? How does this differ from the existing Image Actions → Convert Image... option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants