mathewthe2 / immersion_reader

iOS Reader with Japanese popup dictionary
MIT License
28 stars 1 forks source link

Feature request: Highlight selected word #10

Open miya-sans opened 1 year ago

miya-sans commented 1 year ago

Highlight word like yomichan, rikaikun, etc. This allows for easy copy, look up, translation, web search, and visual clarity of the currently selected word.

I've referenced 10ten's iOS safari plugin using the web version of ttu reader:

https://apps.apple.com/us/app/10ten-japanese-reader/id1573540634 https://github.com/birchill/10ten-ja-reader/

https://user-images.githubusercontent.com/42623210/227712164-ce16031b-bc25-40f9-914b-500072808725.mp4

mathewthe2 commented 1 year ago

I have experimented with text selection on Safari (webkit), and text selection itself is not the hardest part.

I will verify if the context menu comes up automatically when text selection is programmatically invoked later.

Related Issue

I have plans for a highlighting feature, which cannot be easily integrated with the default context menu that Safari provides.

Allowing Safari itself to show its context menu, and then showing a custom menu on the top or bottom of the screen seems viable. An extra option to completely hide Safari's context menu could work, but really janky in my initial experiments.

Figuring out the where to show our custom context bar, especially when the reader is in full screen, could be problematic, unless we know exactly the behavior of Safari's context menu in relation to the selection.