Support icons for custom EditingAction items in text selection menus
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by reading the EditingAction(title:action:) API and the code that turns custom actions into UIKit UIMenuItem items. Check how UIKit's modern UIMenuElement or UICommand APIs represent images, then assess where an optional image can fit. Done means apps can provide an icon for a custom EPUB selection action and UIKit can display it in the expanded edit menu when appropriate.
Written by the indexing model from the issue text.
Description
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?
- In the TestApp or an integrating app, add a custom EPUB editing action using EditingAction(title:action:).
- Select text in an EPUB.
- Open the expanded iOS edit menu.
- The custom action appears without an icon.
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)
)
- Dominant language
- Swift
- Stars
- 557
- Forks
- 249
- Avg merge
- 3h 52m
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from readium/swift-toolkit
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
readium/swift-toolkit#954 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
readium/swift-toolkit#841 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 57/100
readium/swift-toolkit#961 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
readium/swift-toolkit#959 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
readium/swift-toolkit#953 ·
Maintainers usually reply within 1 day
All issues in readium/swift-toolkit
Similar issues
-
area: models enhancement needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rexmhall09/TUFF#69 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nikitabobko/AeroSpace#2427 · 1 comment ·
Maintainers usually reply within 8 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
A second click on the Control Center widget doesn't close Control CenterPossibly taken @MaHofseth claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100