Skip to content

Commit 267f8e1

Browse files
msglist: Add topic list button to app bar
Add topic list button to app bar actions in message list view. The button appears in channel narrows and navigates to the topic list page when pressed. Uses the topic icon and localized tooltip. Fixes zulip#1158.
1 parent 40ed9b2 commit 267f8e1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/widgets/message_list.dart

+8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import 'sticky_header.dart';
2424
import 'store.dart';
2525
import 'text.dart';
2626
import 'theme.dart';
27+
import 'topic_list.dart';
2728

2829
/// Message-list styles that differ between light and dark themes.
2930
class MessageListTheme extends ThemeExtension<MessageListTheme> {
@@ -275,6 +276,13 @@ class _MessageListPageState extends State<MessageListPage> implements MessageLis
275276
onPressed: () => Navigator.push(context,
276277
MessageListPage.buildRoute(context: context,
277278
narrow: ChannelNarrow(streamId)))));
279+
} else if (narrow case ChannelNarrow(:final streamId)) {
280+
(actions ??= []).add(IconButton(
281+
icon: const Icon(ZulipIcons.topic),
282+
tooltip: zulipLocalizations.topicListButtonTooltip,
283+
onPressed: () => Navigator.push(context,
284+
TopicListPage.buildRoute(context: context, streamId: streamId, messageListView: model!)),
285+
));
278286
}
279287

280288
// Insert a PageRoot here, to provide a context that can be used for

0 commit comments

Comments
 (0)