Skip to content

Support icons for custom EditingAction items in text selection menus #788

@7enChan

Description

@7enChan

Describe the bug

Summary

Readium currently lets apps add custom text selection actions with EditingAction(title:action:).

However, custom actions are backed by UIMenuItem(title:action:), which does not provide an image API. This means custom actions cannot show icons in the expanded iOS edit menu, while system actions or actions built with modern UIMenuElement / UICommand can show icons.

Current behavior

Custom EditingAction items appear without icons in the expanded system edit menu.

Expected behavior

Readium should provide a way for apps to optionally attach an icon to custom editing actions, so UIKit can display that icon in the expanded edit menu when appropriate.

How to reproduce?

  1. In the TestApp or an integrating app, add a custom EPUB editing action using EditingAction(title:action:).
  2. Select text in an EPUB.
  3. Open the expanded iOS edit menu.
  4. The custom action appears without an icon.
Image

Readium version

3.8.0

OS version

iOS 26.4

Testing device

iPhone 16

Environment

Additional context

Use case

Apps may want to provide custom EPUB text selection actions such as Highlight, Add note, Translate, or Share, and have them appear visually consistent with native iOS edit menu actions.

For example, an app might want to express:

EditingAction(
    title: "Highlight",
    image: UIImage(systemName: "highlighter"),
    action: #selector(highlightSelection)
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions