Skip to content
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

Icon for "switch account" in main menu #1338

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rishichirchi
Copy link

@rishichirchi rishichirchi commented Feb 7, 2025

@chrisbobbe
Copy link
Collaborator

This has many changes unrelated to #1178; those need to be removed before we can review.

@rishichirchi
Copy link
Author

The changes should only be to the following files right?:

  • home.dart
  • icon.dart

@gnprice
Copy link
Member

gnprice commented Feb 8, 2025

Determining exactly which files should be changing is part of the work of resolving this issue (or any issue) 🙂. If you need help or have questions, the place to ask is in #mobile-dev-help on chat.zulip.org.

In any event, the essential part is that you should reread your changes and understand why each change you're making needs to be there:
https://zulip.readthedocs.io/en/latest/contributing/reviewable-prs.html#write-clear-code
If it doesn't need to be there, then cut it out.

@rishichirchi
Copy link
Author

Hey @gnprice can you check the pull request once? I hope I have made the necessary changes! if not ill work on it again.

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. The commit message needs a "Fixes" line (see the project's commit history for examples), and please answer my question about the icon, below. When that's settled, please update the screenshots in your PR description, so we can see what the change will look like if merged.

@chrisbobbe chrisbobbe added the maintainer review PR ready for review by Zulip maintainers label Feb 10, 2025
@chrisbobbe chrisbobbe self-assigned this Feb 10, 2025
@rishichirchi
Copy link
Author

@chrisbobbe done with the changes, could you review it please?

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 revision! Let's actually split this into two commits:

  • One that adds the icon (for examples, see git log assets/icons/ using Greg's "secret" for reading Git history)
  • One that uses the icon where it's needed; this one should have the line Fixes #1178. (note how that line is formed; we sometimes use Fixes: #1178 interchangeably).

@rishichirchi
Copy link
Author

@chrisbobbe I have made the necessary modifications, please check!

@chrisbobbe
Copy link
Collaborator

The commit message has extra words in the "Fixes" line. See my two previous messages for how to form that line.

@rishichirchi
Copy link
Author

@chrisbobbe

@chrisbobbe
Copy link
Collaborator

Thanks for the revision! Marking for Greg's review.

@chrisbobbe chrisbobbe assigned gnprice and unassigned chrisbobbe Feb 21, 2025
@chrisbobbe chrisbobbe added integration review Added by maintainers when PR may be ready for integration and removed maintainer review PR ready for review by Zulip maintainers labels Feb 21, 2025
@chrisbobbe chrisbobbe requested a review from gnprice February 21, 2025 00:32
Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

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

Thanks both! Several small comments.

@@ -27,116 +27,119 @@ abstract final class ZulipIcons {
/// The Zulip custom icon "arrow_down".
static const IconData arrow_down = IconData(0xf101, fontFamily: "Zulip Icons");

/// The Zulip custom icon "arrow_left_right".
static const IconData arrow_left_right = IconData(0xf102, fontFamily: "Zulip Icons");
Copy link
Member

Choose a reason for hiding this comment

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

The first commit doesn't pass tools/check:

$ git checkout main~
$ tools/check
[…]
Running icons...

Error: there were icon updates:
 M lib/widgets/icons.dart
Running android...

FAILED: icons

To rerun the suites that failed, run:
  $ tools/check icons

It's important that each commit make sense on its own, including passing all tests. See our guide on coherent commits:
https://zulip.readthedocs.io/en/latest/contributing/commit-discipline.html

Copy link
Author

Choose a reason for hiding this comment

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

This is the result that i get when I run tools/check on my branch:

All tests passed!                                                                                                                                             
Running flutter_version...
Running build_runner...
Running l10n...
Running drift...
Running pigeon...
Running icons...

Running android...
Passed!

Though running this command makes changes to my pubspec.lock file. Should I commit that file as well?

Copy link
Member

Choose a reason for hiding this comment

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

This is the result that i get when I run tools/check on my branch:

Right, it passes at the tip of the branch. In order to make each commit coherent, all tests need to pass at each individual commit along the way as well.

See the steps I wrote above, and the linked doc. If you have further questions, #git help or #mobile-dev-help would be good places to ask (you'll get faster responses than on GitHub).

Copy link
Member

Choose a reason for hiding this comment

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

Though running this command makes changes to my pubspec.lock file. Should I commit that file as well?

Typically that happens when you're using a new version of Flutter than the one that pubspec.lock was last updated for. You'll see the same changes happen when you run the app, too 🙂.

And you'll see the same changes when running the app, or tools/check, on main without your PR. So they're independent of your other changes, and shouldn't be committed together.

If you'd like to upgrade the Flutter version in the repo, a PR for that would be welcome. See the instructions in our README.


@override
Widget buildLeading(BuildContext context) => const SizedBox.shrink();

Copy link
Member

Choose a reason for hiding this comment

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

nit: don't separate @override from its target with a blank line — match the style of the existing code you see

Copy link
Author

Choose a reason for hiding this comment

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

Fixed by removing the blank line!

@override
Widget buildLeading(BuildContext context) => const SizedBox.shrink();

IconData? get icon => ZulipIcons.arrow_left_right;
Copy link
Member

Choose a reason for hiding this comment

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

nit:

icons: Add switch account icon in main menu

The "icons" prefix isn't right for describing this commit — that's used for introducing icons to the tree, like your first commit. (For examples, see git log --oneline --stat --full-diff assets/icons/. Or from the other direction: git log --oneline --stat --grep 'icons:'.)

Instead, match the prefix used for other changes aimed at this file.

Copy link
Author

Choose a reason for hiding this comment

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

Seeing changes in home.dart file using git log --oneline --stat --full-diff lib/widgets/home.dart, I think commit summary home: Add switch account icon in main menu would be appropriate!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration review Added by maintainers when PR may be ready for integration
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icon for "switch account" in main menu
3 participants