Replies: 4 comments 13 replies
-
I won't want to make 10ten require an additional gyroscope / accelerometer access permission... |
Beta Was this translation helpful? Give feedback.
-
I agree the flow to turn on 10ten (well, any Web Extension that runs content scripts, really) is a pain, and these are really nice UX ideas. I imagine myself angrily shaking my phone upon not recognising a word, only for 10ten to come to the rescue. Unfortunately, Safari Extensions (whether we're talking about the newer iOS-compatible Web Extensions, which 10ten is, or the older macOS-only App Extensions) are very restrictive and there's no way to turn on an extension by any API call, because nothing is exposed to us. While we may be able to provide a button in the host app to improve the onboarding experience (by deeplinking you into the Given that the host app is a dead-end, let's assess what we can do with the iOS Web Extension. In short, not a lot. We don't have any access to Safari itself. We can't add an item like "Look up with 10ten" into the context menu (the UIMenuController) because we don't have access to the responder chain of those text elements (in fact, you couldn't access them even if you made your own web browser around WKWebView – WebKit doesn't expose the responder chain even to embedders 🥲). Even if we could access the context menu, or set up gesture handlers, or accelerometer monitors (all of which I think we can't, because the extension is conceptually more like a worker than a first-class corner of the app), there is no API to turn on/off a Web Extension, and if you think about it – if it hadn't been turned on yet, it'd be surprising if it could run code. I do wonder though, whether Shortcuts might have a hacky way to do it, if it supports accessible navigation 🤔 I'm not very familiar with it, but it can do some surprising tricks. It would be pretty neat if we could have the Assistive Touch button on-screen system-wide at all times (a sacrifice you have to make) and for it to be able to launch a Shortcuts script or something to go through the workflow to turn on 10ten. But still seems clunky, and now you'd have two pucks on screen at once. 😅 Maybe we could activate a Shortcuts script via Siri..? Or ask Siri to do it directly? But still, I think Siri is slow enough that I'd rather just pick the item out of the menu myself. |
Beta Was this translation helpful? Give feedback.
-
Thanks for bringing this up!
Just a side note here in case you're not aware, there's an option to show the popup when you hold a key like Ctrl and a lot of users find this even easier still. i.e. you leave 10ten enabled all the time and just hold Ctrl when your mouse is over a word you don't know.
I agree this would be convenient. Implementation might be hard though. I think we already register a context menu item via the standard Web extension API: Although you can disable/enable this from the options: Perhaps on iOS we have that setting disabled? More likely, I suspect Web extension context menu items don't show in that particular selection menu. Since Safari Web extensions include a native code component we could probably get an item added there but it would be a bit of work and wouldn't apply to Android. It would still be nice though so if someone's willing to dig into the iOS APIs and write the Swift code to implement this I'd be happy to assist.
That's an interesting idea. I'm not sure how reliable gestures are but it might be a nice option. I wonder, however, if the best thing might be to work on getting the Safari version to be able to be permanently enabled on all sites. On Android where we use a different permission model, once you activate the extension it remains activated for all pages. You can disable the puck by tapping it so that it becomes translucent. That way it's there for you to tap on all pages and you just enable it when you need it. If that seems like a suitable workflow for iOS too we should work out how to get the Safari version to be able to do the same. It will be quite a bit of risky work but we need to do it eventually and we commonly get requests from Safari users about this. |
Beta Was this translation helpful? Give feedback.
-
Glad to see this has generated some good discussion! @birtles, @shirakaba, you both know the code and technical restraints much better than I do, so I don't have a lot to add there, but I have a few thoughts from a (mostly) user perspective.
Yeah, unfortunately @shirakaba confirmed what I already suspected when he said this wasn't possible on iOS 😢.
I agree the always-on approach seems like the way forward. However, I also agree with @shirakaba that I don't want an omnipresent puck—at least, not without guarding it behind an option. So I think there are two alternatives here, ranked by desirableness (as I see it, at least):
Forgive me for the rather dense question, but what's the motivation behind that change? Again, speaking mostly from a user perspective here, but there are there are other browser extensions I've used that have to be toggled on a per-website basis and it winds up being a PITA—particularly with something as broad as a dictionary, which I'm using on numerous sites, including ones I might only visit once. Having to reactivate it all the time gets to be annoying. I do appreciate the extra layer of security with some extensions. But for 10ten, which is open source and I'm (fairly 😉) sure isn't yeeting all my data to the highest bidder, it's not such an issue. Again, just my perspective though.
This is an interesting interaction design problem, I definitely think we could definitely come up with something for this. If you all are interested, I could see about prototyping out some ideas for activation gestures. I have a few ideas, also welcome any you might have. None of the gesture code need find its way into the 10ten codebase yet—I could prototype it on a test webpage to prevent needing to muck with any of the current puck activation code, until we're happy with the gesture and ready to pull it into 10ten. Regardless, the key would be a lot of testing. My main concern is coming up with something that's easy to activate once you know how, but hard to activate on accident. I'm not particularly concerned with discoverability. I view this as being analogous to a keyboard shortcut. A power user feature, not necessarily discoverable unless you're looking for it. It would certainly be worth adding a toggle in the settings though, with an accompanying sentence or two explaining the gesture, just like is currently done with keyboard shortcuts.
I like what you've outlined here, and agree from a user perspective that having an auto-activation when there's Japanese on the page would be nice, as long as it doesn't cause lag.
That's my concern as well. Also, iterating over all text to look for CJK characters could get costly depending on the size of the document. Interestingly, I recently worked on a somewhat-adjacent problem, where I had a lot of text to process, more than JS could handle at once without causing noticeable UI lag. My solution was to chunk the text and break up the processing into a separate async task for each chunk. You then execute as many of these tasks as you can before reaching a certain millisecond threshold. After that you cede the remaining tasks to a This approach is not without its downsides. To borrow a DS analogy, it's kind of like moving to an eventual consistency model: helps with latency, but introduces a lot more potential sources of error. However, once MutationObservers get involved, a lot of that complexity will be there anyway. One additional thought on scanning for CJK characters—what about false positives on Chinese websites? It's not an issue I'm likely to have, but I imagine the overlap of people who study Japanese and Chinese to be pretty high. |
Beta Was this translation helpful? Give feedback.
-
It's super convenient that 10ten supports iOS and Android. However, my most frequent frustration is that activating it on a webpage on mobile is a bit inconvenient. In contrast to desktop, where I can just hit Alt+R and then start mousing over stuff, on iOS Safari I have to first go to the page's top-left menu and click "10ten" to get the puck.
RPReplay_Final1711412911.mov
I'm wondering if there's a better way. I had two possible ideas:
Allow 10ten to be activated via the context menu
I.e. here:
This is the same number of taps, but somehow feels more convenient to me, maybe because it satisfies the most common use case.
Typically my flow with 10ten goes like: open web page in Japanese, start reading, come across some word I don't know, then activate the extension. If I could just activate it inline with the sentence by selecting the word and hitting "look up with 10ten" or something similar, that feels like quite a nice solution compared to searching through the Safari menu in the upper left.
Allow 10ten to be activated with some sort of phone motion
This one is more speculative, but could be a better solution overall. It's also not mutually exclusive with the above.
What if you could do a sort of 'flick of the wrist' motion (as an example) with the phone that would toggle 10ten for the page? Obviously we would need to find a motion that worked well, didn't interfere with any existing motions (a hard shake of the phone triggers 'undo typing' on iOS, for example), make sure the motion triggers consistently, etc. But I think this could be kinda cool...
I am not sure about the feasibility of either of the above ideas w/r/t what iOS Safari extensions allow. Maybe having to activate the extension from the menu is an inherit Apple limitation? @shirakaba or @birtles might know the answer to this.
I also haven't used 10ten on Android, so I'm not sure if the current experience is similar there.
I welcome thoughts on the above, and any ideas others might have :).
Beta Was this translation helpful? Give feedback.
All reactions