-
Notifications
You must be signed in to change notification settings - Fork 346
home: Add icons label on main navigation bar. #1879
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
base: main
Are you sure you want to change the base?
Conversation
|
There is a lot of text to read in that PR description. Did you use ChatGPT or another LLM to write it? If so, we'd much rather see whatever prompt you used, instead of the LLM output — the LLM fundamentally doesn't add any information that wasn't there already, and the prompt should be a lot shorter and so less work to read. There's also no need to repeat information that's there in the diffs, like the names of files you touched and identifiers you added there. |
|
Please also add a test for this change, and organize into clear and coherent commits according to the Zulip style — those are our two general requirements for a PR. See the repo's README for details, and links to further details. Once those are met, this will be ready for a review. After another maintainer has reviewed it and you've revised to address their comments, I'll review the PR. |
Although i did write the whole description in a paragraph, I use LLM to fine tune my description into a formatted output like a pointer and reformat it output again myself. I have changed the description to a brief one. |
Alright Greg |
Added Gesture Detector over Column, Temporary set the onPressed of the Icon Button to null. Fixes: zulip#1808 home: Improve performace and fix bug. Replaced IconButton widgets to Icon improve significantly performace of switching screens and wrote test for the semantic labels for App Bar. Fixes: zulip#1879
55f7e12 to
1f1a1ee
Compare
|
@chrisbobbe This is the PR for which we discussed in the chats For Design reference i have attached the difference.
I have made the commits coherent as well as minimal as request by Greg. |
e8fc538 to
406a86f
Compare
lib/widgets/home.dart
Outdated
| // TODO(#535): Decide if we find it helpful to use something like | ||
| // [SemanticsProperties.namesRoute] to structure this UI better | ||
| // for screen-reader software. | ||
| Offstage(offstage: tab != _tab.value, child: body), | ||
| Offstage( | ||
| offstage: tab != _tab.value, | ||
| child: Semantics( | ||
| namesRoute: true, | ||
| child: body)) |
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.
It looks like you read the TODO and decided that SemanticsProperties.namesRoute is helpful. Could you explain what you considered when making that decision?
406a86f to
88de8b2
Compare
|
Thank you @chrisbobbe for pointing out the issue in sematics! I have updated the semantic using SematicServices.sendAnnouncement for better interoperability. I can provide the TalkBack working on android recording for confirmation. |
2d51fd6 to
adc6013
Compare
Hmm, in #1879 (comment) , I didn't intend to point out any issue. 🙂 I just meant to ask for information that could help us understand your proposal. Did you find some issue with |
Thank you @chrisbobbe for the review, I think the main reason is offstage do not allow the semantic to access its property for semantic widget to correctly get the label to speak out, I also tested it using TalkBack and the semantic widget even with a label was not able to make TalkBack trigger when the change in page body was detected. |
|
It sounds like you were expected to hear something from TalkBack when you changed tabs, and you didn't hear anything, so you assumed it wasn't a valid fix for the TODO. I these are the main requirements to resolve the TODO:
It's entirely possible that a If it gets at all complicated, let's not try to resolve the TODO in this PR, to keep it focused on #1857. |
adc6013 to
ed0b571
Compare
Before Implementing the Nav Bar Label
After Implementing the Nav Bar Label
Case of Text Overflow( Upto 2 Lines )
Thank you @chrisbobbe for your review. I feels like it better to concentrate on a single task right now (i.e the nav bar labelling). This solution also fixes the constant size of nav bar even when the system font size was increased which was a user dissatisfier, it would allow the uses to easily identify the corresponding page using the enlarged label fitted within nav bar. |
Screenshot Comparison
Video Recording of implementationvideo.mp4Possible enhancement: Adding a padding in the top which was not implemented as it was not described in Figma Design of the same. Thanks for the patience, the PR is ready for review! @chrisbobbe, the Ink splash effect on the button has been restored using material and inkwell combination which also includes the padding as per the Figma design. |
d85e622 to
ef68b0c
Compare
This allows the height of bottom nav bar to dyanmically change on the basis of system font size, maxHeight has been set after calibration.
Replaced Iconbutton with Material and InkWell widgets latter ensures InkSplash effect on icon as well as text label in the upcomming commit
Introduced Flexible instead of Expandible To make sure Text widget cover only required area not till maxheight of ConstrainedBox.
ef68b0c to
4499f3f
Compare
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.
Thanks!
For the changes proposed in these 7 commits, I think it's actually better to squash them into one single commit. The desired changes aren't very complicated, and it's helpful to see them all together in a coherent whole. 🙂 This approach would also clean up the "noise" of a commit like this one:
nits: Remove comma after color property of Icon in home bottom navbar button
That kind of commit never needs to exist. If there's a problem introduced in an earlier commit in the PR, the solution is to change the earlier commit to not introduce the problem, rather than adding a new commit, which just adds work in PR review and when reading Git history.
Please also add a test for this change, as Greg pointed out above.
| narrow: const CombinedFeedNarrow()))), | ||
| button(_HomePageTab.channels, ZulipIcons.hash_italic), | ||
| narrow: const CombinedFeedNarrow())), | ||
| label: zulipLocalizations.navBarFeedLabel), |
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.
Let's match the name of the page, so say "Combined feed" instead of "Feed" here, using zulipLocalizations.combinedFeedPageTitle. It looks like there's a plan to accommodate long labels: #mobile-design > design comparison for nav bar label @ 💬
(And remove the addition of navBarFeedLabel from your PR.)
| button(_HomePageTab.directMessages, ZulipIcons.two_person, | ||
| zulipLocalizations.navBarDmLabel), |
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.
Same as above—use zulipLocalizations.recentDmConversationsPageTitle here, to say "Direct messages" instead of "DMs".
(And remove the addition of navBarDmLabel from your PR.)
| // TODO(design): determine a suitable max width for bottom nav bar | ||
| constraints: const BoxConstraints(maxWidth: 600, minHeight: 48, maxHeight: 85), |
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.
With this explicit maxHeight, it looks broken when the text size is very large:
I think your goal was to make sure the nav bar doesn't consume valuable space when it doesn't need to, as the text-size setting increases. We should accomplish that in a different way:
I.e., don't use maxHeight. Instead, on the label text (which is what responds to the text-size setting), we should use TextScaler.clamp with maxScaleFactor as we do in several places already. (1.5 is probably a good value for maxScaleFactor.)
| "navBarMenuLabel": "Menu", | ||
| "@navBarMenuLabel": { | ||
| "description": "Label for the Menu button on the bottom navigation bar." | ||
| }, |
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.
When we add entries to this file, we do it in the same commit that uses them. That way it's easier to see them together, and make sure they're used as intended.
| child: Padding( | ||
| padding: const EdgeInsets.only(bottom: 3.0), | ||
| child: Column( | ||
| mainAxisSize: MainAxisSize.min, | ||
| children: [ | ||
| SizedBox(height: 34, | ||
| child: Center( | ||
| child: Icon(icon, size: 24, color: color))), |
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.
Proposed change (including the code comment, to explain to future readers):
| child: Padding( | |
| padding: const EdgeInsets.only(bottom: 3.0), | |
| child: Column( | |
| mainAxisSize: MainAxisSize.min, | |
| children: [ | |
| SizedBox(height: 34, | |
| child: Center( | |
| child: Icon(icon, size: 24, color: color))), | |
| // (Added 3px horizontal padding not present in Figma, to make the | |
| // text wrap before getting too close to the button's edge, which is | |
| // visible on tap-down.) | |
| padding: const EdgeInsets.fromLTRB(3, 6, 3, 3), | |
| child: Column( | |
| spacing: 3, | |
| mainAxisSize: MainAxisSize.min, | |
| children: [ | |
| Icon(icon, size: 24, color: color), |
For the issue the comment is about, see screenshots with and without the 3px horizontal padding:
| Without | With |
|---|---|
![]() |
![]() |
My proposal also fixes the vertical position of the icon to match the Figma.
| style: TextStyle( | ||
| fontSize: 12, | ||
| color: color, | ||
| height: 1.0,), |
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.
nit:
| style: TextStyle( | |
| fontSize: 12, | |
| color: color, | |
| height: 1.0,), | |
| style: TextStyle(fontSize: 12, color: color, height: 12 / 12), |
| maxLines: 2, | ||
| overflow: TextOverflow.ellipsis)), |
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.
Did we decide on max 2 lines and ellipsis overflow somewhere, or is it in the Figma? Greg pointed to an Android first-party app where the label wrapped onto three lines: #mobile-design > design comparison for nav bar label @ 💬
I think I prefer no max-lines limit at all. If a translated label is annoyingly long, I'd rather not add to the annoyance by cutting it short and adding "…". Instead I'd ask a volunteer translator if they can choose a shorter label.
| // TODO(#417): Disable splash effects for all buttons globally. | ||
| borderRadius: BorderRadius.all(Radius.circular(4)), | ||
| splashFactory: NoSplash.splashFactory, |
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.
nit: don't separate the TODO from the line of code it is about





















Key Changes: (Screenshots Outdated)
I have kept the height of the Navigation to be fixed because a fully dynamic navigation bar height that adjusts based on label content across languages is not feasibly after having done some feasibility study. The UI jitter when the bar changes its size suddenly when the user changes the app language is extremely unlikely to be solved and can negatively impact user experience hence even in day to day app these types of dynamic navigation bar are not used.
integration of the page bodies and semantics has been done
Link to Figma Design was not found rather, the screenshot that was shared by Vlad Korobov in the following discuss was used to implement the UI : #mobile > Flutter feedback - Icons in app @ 💬
Thank you
Figma Design Link
Fixes #1857