-
-
Notifications
You must be signed in to change notification settings - Fork 756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve usability of search languages bar (1 of 2) #3908
Conversation
Hmm, I noticed something strange here and I'm not sure what's up. When switching the device's language to an RTL language, the |
I took a small peek and it does seem related to this constraint - I'm not sure why it causes problems but when I replace with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I'm concerned about is the size of tap targets for languages with short names.
That won't be an issue when the square icons are in place. If we think those will go in, then that solves the issue. Otherwise we might need a minimum width for a language (which will make the spacing look weird for short language names.)
} | ||
assert(selectedButtonCount == 1, "One button should be selected by now") | ||
updateSearchLanguageButtons() | ||
assert(searchLanguageButtons().filter { $0.isSelected }.count == 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the coding style. Should the reason string be moved over as well? In this case it's not necessarily clear there should be a selection by the time viewWillAppear()
is called, so it might be good to move it over as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another case where I was just converting over what existed previously. I'm just going to remove this assertion. Updated!
I think UIScrollView is supposed to do the correct thing if you just set the anchors for each side equal to each other. The constant of 8 should probably be a content inset of 8 instead of part of the constraint, since conceptually, the stack view should be the entire content area, just offset by 8 points. |
@staykids One other thing I wanted to mention - this would be new functionality but I suggest we automatically scroll to the highlighted language after it's selected. Now that the list can get long it's easy to get lost if it's highlighting off screen. I tried this in a suggestions branch here. I also noticed a couple of other layout things: Here I don't think the scrollView contentInset is adjusting based on RTL so the fade creeps in even though this is scrolled as much as possible: And seems like a safe area alignment is needed somewhere here (this is also scrolled as much as possible): |
@tonisevener Strange – I was wondering why that specific constraint previously existed in the XIB. Thanks for looking at and discovering this!
@dempseyatgithub Good point – I was just recreating the existing XIB |
@dempseyatgithub I agree, the minimized tappable width here with language name alone is not ideal. But yeah, the extra tappable space afforded by the language code square in that forthcoming PR helps. After merged, we'll put the Phab task in design QA for review. |
@dempseyatgithub I noticed this as well and agree, it's uncomfortable, but is the previously existing behavior/design of the bar. I'll include a screenshot of this scroll indicator when the task is moved to design QA. |
@tonisevener Thanks for catching these and the suggestion branch! I'm already working on some RTL updates in the 2nd PR for this task, so I think it's best I address these in that one. |
I believe this is ready for another look – let me know if I missed any of your comments, but I think the addressable ones I mention I'll handle in the part 2 PR I'm working on for this task. |
Since the remainder of the changes are coming in the next PR this looks fine to merge. |
Phabricator: https://phabricator.wikimedia.org/T277058
Notes
This is part 1 of 2 in improving the usability of the language bar in the search controller. The specific task elements addressed by this PR are:
The next PR will address the design updates.
Test Steps
Confirm there is behavioral parity with the existing search bar, excepting the changes noted above. Some examples include:
Screenshot