Skip to content

Conversation

@MritunjayTiwari14
Copy link

@MritunjayTiwari14 MritunjayTiwari14 commented Sep 28, 2025

Key Changes: (Screenshots Outdated)

Dark Theme Light Theme
1000051916 1000051917

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 @ 💬

  • Language Consistency for all language for the added labels will be fixed after receiving feedback from the Moderators about the Implementation of the solution.

Thank you

Figma Design Link

Fixes #1857

@MritunjayTiwari14
Copy link
Author

MritunjayTiwari14 commented Sep 28, 2025

@gnprice I would be extremely grateful if you could give a review to this PR for the Issue that you stated.

@gnprice
Copy link
Member

gnprice commented Sep 28, 2025

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.

@gnprice
Copy link
Member

gnprice commented Sep 28, 2025

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.

@MritunjayTiwari14
Copy link
Author

MritunjayTiwari14 commented Sep 29, 2025

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.

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.

@MritunjayTiwari14
Copy link
Author

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.

Alright Greg

MritunjayTiwari14 pushed a commit to MritunjayTiwari14/zulip-flutter that referenced this pull request Oct 1, 2025
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
@MritunjayTiwari14 MritunjayTiwari14 force-pushed the issue_1857 branch 4 times, most recently from 55f7e12 to 1f1a1ee Compare October 5, 2025 10:31
@MritunjayTiwari14
Copy link
Author

@chrisbobbe This is the PR for which we discussed in the chats

For Design reference i have attached the difference.

Design Provided by Vlad

I have made the commits coherent as well as minimal as request by Greg.

@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Oct 8, 2025
@MritunjayTiwari14 MritunjayTiwari14 force-pushed the issue_1857 branch 3 times, most recently from e8fc538 to 406a86f Compare October 9, 2025 09:26
@MritunjayTiwari14
Copy link
Author

MritunjayTiwari14 commented Oct 9, 2025

Before After(Font Size-12) After(Font Size-14)
1000052074 1000052067 1000052071
1000052075 1000052068 1000052072


Thank you @gnprice for the advice in the mobile-design chats, i found the figma design for the labeled bottom navigation bar here, i have given the difference of implemented UI and design in the table above.

Comment on lines 135 to 139
// 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))
Copy link
Collaborator

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?

@MritunjayTiwari14
Copy link
Author

MritunjayTiwari14 commented Oct 10, 2025

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.

@MritunjayTiwari14 MritunjayTiwari14 force-pushed the issue_1857 branch 2 times, most recently from 2d51fd6 to adc6013 Compare October 10, 2025 10:29
@chrisbobbe
Copy link
Collaborator

Thank you @chrisbobbe for pointing out the issue in sematics!

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 SemanticsProperties.namesRoute that made you decide to fix the TODO with that "send announcement" method instead? I don't think we've used that before.

@MritunjayTiwari14
Copy link
Author

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 SemanticsProperties.namesRoute that made you decide to fix the TODO with that "send announcement" method instead? I don't think we've used that before.

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.

@chrisbobbe
Copy link
Collaborator

chrisbobbe commented Oct 17, 2025

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:

  • We use the Semantics APIs as documented. Some questions for investigation:
  • If we make a change, then it shouldn't make the experience obviously worse, in manual testing with TalkBack or VoiceOver.

It's entirely possible that a namesRoute approach is helpful to users in some less obvious way than causing TalkBack to announce the name of a tab when you tap on it. For example maybe VoiceOver does that, or maybe it enables screen-reader software to answer the question "What route am I on?", and we would learn that if we used the software long enough. 🙂 It's our job to give screen-reader software the information it expects, but it's that software's job to decide what to do with it.

If it gets at all complicated, let's not try to resolve the TODO in this PR, to keep it focused on #1857.

@MritunjayTiwari14
Copy link
Author

Before Implementing the Nav Bar Label

Normal Oversized System Font
before_l 1000052413
before_b 1000052412


After Implementing the Nav Bar Label

Before After After with Oversized System Font
before_l norm_l extra_l
before_b norm_b extra_b

Case of Text Overflow( Upto 2 Lines )

Text Overflow Light Text Overflow Dark
over_l over_b


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).
I have made the commit history clear and coherent as well as uploaded the detailed updated screenshot comparison of the design.

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.

@MritunjayTiwari14
Copy link
Author

MritunjayTiwari14 commented Oct 21, 2025

Screenshots

Screenshot Comparison

Light Theme Dark Theme
Screenshot_1761040184 Screenshot_1761040123

Video Recording of implementation

video.mp4

Possible 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.

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.
Copy link
Collaborator

@chrisbobbe chrisbobbe left a 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),
Copy link
Collaborator

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.)

Comment on lines +120 to +121
button(_HomePageTab.directMessages, ZulipIcons.two_person,
zulipLocalizations.navBarDmLabel),
Copy link
Collaborator

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.)

Comment on lines +146 to +147
// TODO(design): determine a suitable max width for bottom nav bar
constraints: const BoxConstraints(maxWidth: 600, minHeight: 48, maxHeight: 85),
Copy link
Collaborator

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:

image

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.)

Comment on lines +1258 to +1261
"navBarMenuLabel": "Menu",
"@navBarMenuLabel": {
"description": "Label for the Menu button on the bottom navigation bar."
},
Copy link
Collaborator

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.

Comment on lines +265 to +272
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))),
Copy link
Collaborator

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):

Suggested change
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
image image

My proposal also fixes the vertical position of the icon to match the Figma.

Comment on lines +276 to +279
style: TextStyle(
fontSize: 12,
color: color,
height: 1.0,),
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit:

Suggested change
style: TextStyle(
fontSize: 12,
color: color,
height: 1.0,),
style: TextStyle(fontSize: 12, color: color, height: 12 / 12),

Comment on lines +281 to +282
maxLines: 2,
overflow: TextOverflow.ellipsis)),
Copy link
Collaborator

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.

Comment on lines 260 to 262
// TODO(#417): Disable splash effects for all buttons globally.
borderRadius: BorderRadius.all(Radius.circular(4)),
splashFactory: NoSplash.splashFactory,
Copy link
Collaborator

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

@chrisbobbe chrisbobbe self-assigned this Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer review PR ready for review by Zulip maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Label icons on main nav bar

3 participants