@@ -28,6 +28,7 @@ import 'page.dart';
28
28
import 'store.dart' ;
29
29
import 'text.dart' ;
30
30
import 'theme.dart' ;
31
+ import 'topic_list.dart' ;
31
32
32
33
void _showActionSheet (
33
34
BuildContext context, {
@@ -175,23 +176,46 @@ void showChannelActionSheet(BuildContext context, {
175
176
final store = PerAccountStoreWidget .of (pageContext);
176
177
177
178
final optionButtons = < ActionSheetMenuItemButton > [];
179
+
180
+ optionButtons.add (
181
+ TopicListButton (pageContext: pageContext, channelId: channelId));
182
+
178
183
final unreadCount = store.unreads.countInChannelNarrow (channelId);
179
184
if (unreadCount > 0 ) {
180
185
optionButtons.add (
181
186
MarkChannelAsReadButton (pageContext: pageContext, channelId: channelId));
182
187
}
183
- if (optionButtons.isEmpty) {
184
- // TODO(a11y): This case makes a no-op gesture handler; as a consequence,
185
- // we're presenting some UI (to people who use screen-reader software) as
186
- // though it offers a gesture interaction that it doesn't meaningfully
187
- // offer, which is confusing. The solution here is probably to remove this
188
- // is-empty case by having at least one button that's always present,
189
- // such as "copy link to channel".
190
- return ;
191
- }
188
+
192
189
_showActionSheet (pageContext, optionButtons: optionButtons);
193
190
}
194
191
192
+ class TopicListButton extends ActionSheetMenuItemButton {
193
+ const TopicListButton ({
194
+ super .key,
195
+ required this .channelId,
196
+ required super .pageContext,
197
+ });
198
+
199
+ final int channelId;
200
+
201
+ @override
202
+ IconData get icon => ZulipIcons .list;
203
+
204
+ @override
205
+ String label (ZulipLocalizations zulipLocalizations) {
206
+ return zulipLocalizations.actionSheetOptionTopicList;
207
+ }
208
+
209
+ @override
210
+ void onPressed () {
211
+ Navigator .push (pageContext,
212
+ TopicListPage .buildRoute (
213
+ context: pageContext,
214
+ streamId: channelId,
215
+ ));
216
+ }
217
+ }
218
+
195
219
class MarkChannelAsReadButton extends ActionSheetMenuItemButton {
196
220
const MarkChannelAsReadButton ({
197
221
super .key,
0 commit comments