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

homescreen_icon: Change 'globe' to 'list' #5532

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

Conversation

dootMaster
Copy link

@dootMaster dootMaster commented Nov 3, 2022

The current all-messages icon on mobile is a globe:
image

which doesn't match web Zulip's icon:
image

We're swapping it to the list icon for parity between mobile and web:
image

Fixes: #5303

@dootMaster dootMaster force-pushed the pr-homescreen-icon-change-5303 branch from edc9835 to 0049773 Compare November 3, 2022 00:27
@dootMaster dootMaster changed the title Pr homescreen icon change 5303 homescree_icon: change 'globe' to 'list' Nov 3, 2022
@dootMaster dootMaster changed the title homescree_icon: change 'globe' to 'list' homescreen_icon: Change 'globe' to 'list' Nov 3, 2022
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 @dootMaster!

This doesn't actually work for me in my testing -- the icon is blank, or missing:

image

See comments below, including one that I think diagnoses why that's not working.

Comment on lines 46 to 53
<TopTabButton
<TopTabButtonGeneral
name="globe"
onPress={() => {
dispatch(doNarrow(HOME_NARROW));
}}
/>
>
<Icon size={24} style={{ textAlign: 'center ' }} color={BRAND_COLOR} name="globe" />
Copy link
Member

Choose a reason for hiding this comment

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

Good to split this NFC change out as its own commit -- that's a helpful simplification for the main commit.

For that to do its job of making the changes easier to read and understand, though, it's important that each individual commit is correct and coherent:
https://zulip.readthedocs.io/en/latest/contributing/version-control.html

As it stands, the app actually crashes at this commit. If you run Flow while at this commit, it'll point out the cause of that crash, and also another type error.

@@ -108,3 +108,4 @@ export const IconGroup: SpecificIconType = makeIcon(FontAwesome, 'group');
export const IconPlus: SpecificIconType = makeIcon(Feather, 'plus');
// eslint-disable-next-line react/function-component-definition
export const IconWebPublic: SpecificIconType = props => <ZulipIcon name="globe" {...props} />;
export const IconAllMessages: SpecificIconType = props => makeIcon(FontAwesome, 'align-left');
Copy link
Member

Choose a reason for hiding this comment

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

Take a look again at how this line compares to the existing examples in the file. I think this is the reason why this version doesn't work, showing a blank icon.

<Icon size={24} style={{ textAlign: 'center ' }} color={BRAND_COLOR} name="globe" />
<IconAllMessages
size={24}
style={{ textAlign: 'center', transform: [{ scale: -1 }] }}
Copy link
Member

Choose a reason for hiding this comment

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

The transform/scale here is a neat trick.

It should be encapsulated inside IconAllMessages. That also makes a good place for a code comment with the information from this commit message:

Web Zulip's all-messages icon is an inverted list icon, so we're
swapping mobile's all-messages icon to match.

It's fine if that means IconAllMessages has a slightly longer function definition than the others in Icons.js.

@dootMaster dootMaster force-pushed the pr-homescreen-icon-change-5303 branch from 0049773 to 441b6d9 Compare November 8, 2022 05:35
@dootMaster
Copy link
Author

@gnprice Sorry about that, I've pushed a new commit that should work now, although I don't know how to encapsulate the transform/scale prop into the function definition in Icons.js. I can make a wrapper component for the icon, but I'm not sure if that's what you were hinting at.

@gnprice
Copy link
Member

gnprice commented Nov 8, 2022

Thanks for the revision. This pair of issues is still present:
#5532 (comment)

The quickest way to see them is to use git checkout main~ (if main is your branch where you're developing the changes). Then

  • the app will crash when you run it, and print an error message to the terminal where you're running react-native start.
  • tools/test flow will show two type errors. One is the cause of that crash, and both should be fixed.

although I don't know how to encapsulate the transform/scale prop into the function definition in Icons.js. I can make a wrapper component for the icon, but I'm not sure if that's what you were hinting at.

OK. Maybe the best approach there, then, is that when the PR is otherwise ready to merge, I'll add a commit on top that demonstrates the structure I have in mind, and merge with that.

@dootMaster dootMaster force-pushed the pr-homescreen-icon-change-5303 branch 2 times, most recently from 4561d06 to f33b6b3 Compare November 8, 2022 23:02
Leslie Ngo added 2 commits November 8, 2022 15:38
to prepare the component for icon swapping.
Web Zulip's all-messages icon is an inverted list icon, so we're
swapping mobile's all-messages icon to match.

Fixes: zulip#5303
@dootMaster dootMaster force-pushed the pr-homescreen-icon-change-5303 branch from f33b6b3 to eaf8e09 Compare November 8, 2022 23:43
@dootMaster
Copy link
Author

@gnprice

The previous commit should be fixed now. 🤦‍♂️

@dootMaster
Copy link
Author

@alya @gnprice is there anything else keeping this from being merged?

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.

Use "list" icon for all-messages, matching web's new icon there
2 participants