WordPress-Editor-iOS
WordPress-Editor-iOS copied to clipboard
Dictation not working in iOS
Straight from the user report:
When you add a new paragraph using dictation, weird things happen like duplication of content.
I just created a new post with the app, opened Siri and said:
Testing full stop new paragraph what is the time?”
This is the output:
I’ve got an iPhone 4s. The user is on an iPhone 6. We’re both using version 5.0 of the app.
Another report from https://ios.forums.wordpress.org/topic/problems-with-ios-dictation?replies=1
Firstly, I want to say thanks for the WordPress iOS app. I love the idea of being able to dictate my blog posts, simply by talking to my iPhone. However, I've noticed that dictating text into the new post editor doesn't work properly.
To reproduce the problem, simply create a new post, and start dictating text. Now let's say that you make a mistake. Since the iOS dictator has no delete feature, you need to break out of it to fix a mistake. Hit Done to get out of the dictator and then press backspace.
I expected the last character dictated to be deleted, but instead the cursor just jumps up a line and then back down when you press backspace a second time. You can keep pressing backspace indefinitely, but it doesn't delete the text that you just dictated.
Also, sometimes the text that you just dictated gets inserted twice. This seems to depend on whether the dictator had finished correcting your text before you hit "Done".
I've also noticed that dictation mode often drops out of its own accord without me even pressing Done, which is really annoying.
Finally, "new line" doesn't always start a new paragraph, and "new paragraph" inserts multiple blank lines. Moving the cursor back to try and fix this doesn't seem to work properly. You end up with blank lines that are difficult to delete. To fix this, I found I needed to go to HTML mode and edit it there.
Adding some information for future reference.
I was testing this issue today and fount out that dictation started failing only after a new paragraph was requested by the user. I also started noticing error messages in Xcode showing the following message:
2016-01-07 01:00:25.335 WordPress[7576:4024723] Given text range '(null)' we could not find the last hypothesis "Testing.
What is your name?". The likely cause is that something modified the text store or the hypothesis during dictation.
I started thinking about what may be causing this problem. And then I noticed the dictation algorithm sometimes goes back to previous words to correct them. I realized our code manipulates how paragraphs are created quite heavily - which may make it more difficult for the dictation algorithm to go back to previous words. So I ended up commenting this line, which solved the dictation issues for me.
I'm not sure this is a good solution though, as I'd have to evaluate if there's any side effects of removing that line, though.
/cc @bummytime, @astralbodies - Any thoughts?
Some extra info - it seems like in addition to the line above, we would also need to remove this method and all calls to it. Unfortunately that doesn't seem possible for us at this point.
I'm dissociating myself from this task for the time being, and until we can find an alternative to UIWebView
and the hacks we applied to use it.