Skip to content

Bug 1177597 & 1183210 - Search screen does not show on iOS9#715

Merged
thebnich merged 3 commits into
mozilla-mobile:masterfrom
codestergit:Bug-117759
Jul 29, 2015
Merged

Bug 1177597 & 1183210 - Search screen does not show on iOS9#715
thebnich merged 3 commits into
mozilla-mobile:masterfrom
codestergit:Bug-117759

Conversation

@codestergit
Copy link
Copy Markdown
Contributor

In iOS9 due to some bug UIKeyInput method insertText is not calling.
This commit resolve the issue.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Chracters -> Characters

@thebnich
Copy link
Copy Markdown
Contributor

Can you explain these changes, maybe adding some comments? I understand the insertText -> SELtextDidChange if insertText isn't working, but I'm not clear on what all the other changes are doing.

@codestergit codestergit force-pushed the Bug-117759 branch 2 times, most recently from 61b2b21 to 1429b8b Compare July 14, 2015 13:09
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removes autocompletion before changing any characters.

@codestergit
Copy link
Copy Markdown
Contributor Author

@thebnich added comments. We are doing same thing as previous. In insertText method before inserting any characters we are removing autocompletion. After inserting characters(i.e call to super.insertText) we are calculating autocompletion suggestion.

Please let me know if any further clarification needed.

@thebnich
Copy link
Copy Markdown
Contributor

This seems to work well on English keyboards, though I found a regression switching to Japanese.

Steps:

  1. Switch to Japanese keyboard.
  2. Click URL bar.
  3. Type "ha".

This should show the Hiragana symbol for "ha" (); however, it shows hあ, so it looks like this change is breaking text composition somehow. I filed bug 1183914 to get some automated tests for non-English text entry -- it's very fragile!

@codestergit
Copy link
Copy Markdown
Contributor Author

@thebnich updated the pull request. Fixed flicker issue and Japanese character issue. Please let me know your thoughts and if any clarification needed.

@codestergit codestergit force-pushed the Bug-117759 branch 3 times, most recently from 1f75631 to 25f6982 Compare July 22, 2015 16:45
@codestergit
Copy link
Copy Markdown
Contributor Author

Hi @thebnich,
updated the pull request to resolve conflicts. Now can be merged.

@codestergit codestergit changed the title Bug 1177597 - Search screen does not show on iOS9 Bug 1177597 & 1183210 - Search screen does not show on iOS9 Jul 22, 2015
@codestergit
Copy link
Copy Markdown
Contributor Author

Hi @thebnich It also resolve Bug-1183210 flicker issue while entering text.

@codestergit
Copy link
Copy Markdown
Contributor Author

@thebnich removed debounce added for Bug 1173162 . Done changes for hitting db when required i.e if user enter text does not match with saved suggestion.

@codestergit codestergit force-pushed the Bug-117759 branch 2 times, most recently from 19036fe to 87a2eb4 Compare July 23, 2015 15:52
@codestergit
Copy link
Copy Markdown
Contributor Author

@thebnich updated the pull request. Resolved conflicts.

@codestergit codestergit force-pushed the Bug-117759 branch 7 times, most recently from 8228108 to 187b23a Compare July 23, 2015 19:41
@codestergit
Copy link
Copy Markdown
Contributor Author

@thebnich updated the pull request to address comments. I have made separate commit for that and squashed in to "Hitting history db only when required". I hope that is fine :) .

@codestergit
Copy link
Copy Markdown
Contributor Author

Hi @thebnich
Due to lag between shouldChangeCharactersInRange and textDidChange event we need to do this. Detailed comment is here. I have already tried to find some alternative but no success. I need your thoughts further. Thanks for all your help :)

@codestergit
Copy link
Copy Markdown
Contributor Author

@thebnich
Updated the pull request. Thanks for your suggestion. I have simplified the patch.
Thanks

@codestergit codestergit force-pushed the Bug-117759 branch 2 times, most recently from a414cb4 to e035a98 Compare July 26, 2015 14:02
@codestergit
Copy link
Copy Markdown
Contributor Author

Hi @thebnich
Updated pull request and resolved conflicts.
During testing I have found two issues which is regression of Bug-1166781.
I have done separate pull request for them also.
#807
#808

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this change? I think it's safe to just use self.text here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thebnich Here we need enteredText because notifyTextChanged is also called from SELtextDidChange may be after some delay. So self.text may have complete string with auto completion, not the user entered text. So cached query in SearchLoader may save auto- completed string and may give bad results.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I see we are doing this enteredText calculation in lots of places. Maybe it would make sense to just store enteredText directly as a class variable, and remove enteredTextLength? If there are places we still need the entered text length, we could just use count(enteredText). And then we don't need to use substringToIndex everywhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@thebnich You always know what is best :).
Changed enteredTextLength to entredText working good.
As we are not calculating enteredTextLength when not in auto-completion mode so if user enters text in between somewhere than it will be calculated in SELtextDidChange so enteredText will work good. Thanks for your suggestion.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: } else if ... { on same line

@codestergit codestergit force-pushed the Bug-117759 branch 2 times, most recently from 7ede6e0 to 7441cdc Compare July 29, 2015 18:25
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we return early here and remove the if else below? Then, at the very bottom of this function outside of all the if statements, you do removeCompletion? That way, if the setting the suggestion fails for any reason, we always clear the existing completion if there is one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks great 👍.
Done that

@codestergit codestergit force-pushed the Bug-117759 branch 2 times, most recently from 4482355 to 82df592 Compare July 29, 2015 20:14
@codestergit
Copy link
Copy Markdown
Contributor Author

@thebnich Thanks for suggestion. Updated the pull request.
Please let me know if any other changes required.

thebnich added a commit that referenced this pull request Jul 29, 2015
Bug 1177597 & 1183210 - Search screen does not show on iOS9
@thebnich thebnich merged commit f496e89 into mozilla-mobile:master Jul 29, 2015
ecotopian referenced this pull request in ecosia/ios-browser Mar 1, 2022
isabelrios pushed a commit to isabelrios/firefox-ios that referenced this pull request Feb 19, 2024
* Start building add search engine settings screen

* add persisting custom search engines

* Add search engine editing

* add image

* a few changes to the custom search engine screens

* Add placeholder to UITextView

* Fix image display for custom search engines

* address ui issues

* address ui issues

* Add UI Tests

* adjust selected bg color and seperator

* change selected engine color

* remove unfinished tests and switch to leading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants