Skip to content

msglist: Colorize channel icon in the app bar, following Figma #1524

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

Merged

Conversation

chrisbobbe
Copy link
Collaborator

Following the Figma:
https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=6089-28394&m=dev

And while we're adding a test for it, also check that the chosen channel icon is the intended one.

@chrisbobbe chrisbobbe requested a review from PIG208 May 21, 2025 22:23
@chrisbobbe chrisbobbe added the maintainer review PR ready for review by Zulip maintainers label May 21, 2025
@chrisbobbe
Copy link
Collaborator Author

This will avoid an inconsistency with the topic-list page (PR #1500), which colorizes the icon.

@chrisbobbe chrisbobbe mentioned this pull request May 21, 2025
@chrisbobbe
Copy link
Collaborator Author

Before After
image image

Copy link
Member

@PIG208 PIG208 left a comment

Choose a reason for hiding this comment

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

Thanks! Overall looks good to me. Left some comments. Looks like the CI is failing, but it should be an easy fix.

Comment on lines +308 to +341
iconColor = colorSwatchFor(context, store.subscriptions[stream.streamId])
.iconOnBarBackground;
Copy link
Member

Choose a reason for hiding this comment

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

Should we fall back to the default base color kDefaultChannelColorSwatchBaseColor (by passing a possibly null subscription) until we get to fully implementing #188?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think that's what this code already does; am I reading too quickly? store.subscriptions[stream.streamId] might be null, and if it is, colorSwatchFor uses a swatch based on kDefaultChannelColorSwatchBaseColor.

Copy link
Member

Choose a reason for hiding this comment

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

Oh right. I think I meant the case when stream is null, i.e. we got a "(unknown channel)".

}
testChannelIconInChannelRow(ZulipIcons.globe, isWebPublic: true, inviteOnly: false);
testChannelIconInChannelRow(ZulipIcons.lock, isWebPublic: false, inviteOnly: true);
testChannelIconInChannelRow(ZulipIcons.hash_sign, isWebPublic: false, inviteOnly: false);
Copy link
Member

Choose a reason for hiding this comment

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

Thanks! It's nice to have this tested.

@chrisbobbe chrisbobbe force-pushed the pr-colorize-msglist-app-bar-channel-icon branch from e745ebf to d94b011 Compare May 22, 2025 00:41
@chrisbobbe
Copy link
Collaborator Author

chrisbobbe commented May 22, 2025

Updated to fix the analyzer warning; PTAL at my reply above: #1524 (comment)

@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 May 23, 2025
@chrisbobbe chrisbobbe assigned gnprice and unassigned PIG208 May 23, 2025
@chrisbobbe chrisbobbe requested a review from gnprice May 23, 2025 00:57
The Figma:
  https://www.figma.com/design/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=6089-28394&m=dev

And while we're adding a test for it, also check that the chosen
channel icon is the intended one.
@gnprice gnprice force-pushed the pr-colorize-msglist-app-bar-channel-icon branch from d94b011 to 245d9d9 Compare May 29, 2025 22:11
@gnprice
Copy link
Member

gnprice commented May 29, 2025

Thanks — looks good, merging.

@gnprice gnprice merged commit 245d9d9 into zulip:main May 29, 2025
1 check passed
@chrisbobbe chrisbobbe deleted the pr-colorize-msglist-app-bar-channel-icon branch May 29, 2025 22:12
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.

3 participants