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

topicList: Add topic list page for each channel #1449

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lakshya1goel
Copy link
Contributor

@lakshya1goel lakshya1goel commented Mar 29, 2025

fixes: #1158

Related CZO Discussion: #mobile-design > Topic list in channel
Figma link: Link

Light Theme:

Image 1 Image 2
WhatsApp Image 2025-04-02 at 9 59 45 PM WhatsApp Image 2025-03-30 at 9 20 37 PM

Dark Theme:

Image 1 Image 2
WhatsApp Image 2025-04-02 at 9 59 46 PM WhatsApp Image 2025-03-30 at 9 20 38 PM(1)

Video Demonstration:

WhatsApp.Video.2025-04-02.at.9.59.45.PM.mp4

@lakshya1goel lakshya1goel marked this pull request as draft March 29, 2025 05:54
@lakshya1goel lakshya1goel force-pushed the issue1158 branch 3 times, most recently from dfc6f79 to 6f6e5b6 Compare March 30, 2025 15:51
@lakshya1goel lakshya1goel marked this pull request as ready for review March 30, 2025 15:51
@lakshya1goel lakshya1goel force-pushed the issue1158 branch 2 times, most recently from 5dea5f1 to 5a7871f Compare March 30, 2025 18:13
@alya
Copy link
Collaborator

alya commented Apr 1, 2025

Why are the topics italicized? We generally use italics only for the "general chat" topic.

@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Apr 1, 2025
@PIG208 PIG208 self-requested a review April 1, 2025 22:17
@lakshya1goel
Copy link
Contributor Author

Hi @PIG208 I have pushed the revision and also updated the PR description. Please have a look. Thanks!

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! I did a partial review (didn't go through the design/implementation thoroughly), and left out the tests for this round. There are multiple changes needed for this to match the design.

When working on the next revision, please make sure that you self-review your PR carefully, since a lot of these issues can be caught with this process.

final hasUnreads = unreads > 0;

return Material(
type: MaterialType.transparency,
Copy link
Member

Choose a reason for hiding this comment

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

Why type: MaterialType.transparency? Looks like the design uses bg-message-regular for background color.

Comment on lines 286 to 292
if (hasUnreads) ...[
UnreadCountBadge(
count: unreads,
backgroundColor: designVariables.bgCounterUnread,
bold: true,
),
],
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this only handle the marker for unreads. Like _TopicItem for inbox, we should handle all the different markers that might appear here.

Comment on lines 293 to 324
],
),
),
),
]),
),
);
Copy link
Member

Choose a reason for hiding this comment

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

Wrap closing )'s, when possible, like we do in other places.

Comment on lines 271 to 273
topic.name.displayName.startsWith('✔')
? topic.name.displayName.substring(2).trim()
: topic.name.displayName,
Copy link
Member

Choose a reason for hiding this comment

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

We can just use topic.name.unresolve() instead.

child: SizedBox(
height: 16,
width: 16,
child: topic.name.displayName.startsWith('✔')
Copy link
Member

Choose a reason for hiding this comment

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

We can use topic.name.isResolved

Comment on lines 142 to 170
Future<void> _fetchTopics() async {
try {
await _model!.fetchTopics();
if (_model!.hasError && mounted) {
final zulipLocalizations = ZulipLocalizations.of(context);
showErrorDialog(
context: context,
title: zulipLocalizations.errorFetchingTopics,
message: _model!.errorMessage);
}
} catch (e) {
if (!mounted) return;
final zulipLocalizations = ZulipLocalizations.of(context);
showErrorDialog(
context: context,
title: zulipLocalizations.errorFetchingTopics,
message: e.toString());
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I think with the way how fetchTopics is used right now, having a separate class for the data does not feel like a helpful abstraction, since it adds a layer of indirection as a trade-off.

Right now, we only fetch topics onNewStore, and there is no retry logic yet. For error handling, The _fetchTopics helper does not really care if errorMessage lives on as a part of the model. This also requires as to manage an additional listener of a ChangeNotifier.

It would probably be cleaner to inline the getStreamTopics here, and only consider extracting a model when there is more complexity that warrants a thicker data model. The only mutable states needed are isLoading and topics.

Comment on lines 255 to 259
? Icon(
ZulipIcons.check,
size: 12,
color: designVariables.textMessage,
)
Copy link
Member

Choose a reason for hiding this comment

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

The opacity of the icon does not match the design:

image

Copy link
Member

Choose a reason for hiding this comment

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

The size of the icon should be 16px.

child: Row(crossAxisAlignment: CrossAxisAlignment.start, children: [
const SizedBox(width: 28),
Padding(
padding: const EdgeInsets.only(top: 10.0),
Copy link
Member

Choose a reason for hiding this comment

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

The bottom padding of the icon is missing.

bold: true,
),
],
],
Copy link
Member

Choose a reason for hiding this comment

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

There is 12px padding before the end:

image

context,
channelId: streamId,
topic: topic.name,
someMessageIdInTopic: null,
Copy link
Member

Choose a reason for hiding this comment

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

Looks like we can conveniently use topic.maxId for this.

@lakshya1goel
Copy link
Contributor Author

Hi @PIG208, thanks for the review. I have pushed the update. PTAL. Thanks!

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.

List of topics in channel
4 participants