@@ -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, {
@@ -174,24 +175,43 @@ void showChannelActionSheet(BuildContext context, {
174
175
final pageContext = PageRoot .contextOf (context);
175
176
final store = PerAccountStoreWidget .of (pageContext);
176
177
177
- final optionButtons = < ActionSheetMenuItemButton > [];
178
+ final optionButtons = < ActionSheetMenuItemButton > [
179
+ TopicListButton (pageContext: pageContext, channelId: channelId),
180
+ ];
181
+
178
182
final unreadCount = store.unreads.countInChannelNarrow (channelId);
179
183
if (unreadCount > 0 ) {
180
184
optionButtons.add (
181
185
MarkChannelAsReadButton (pageContext: pageContext, channelId: channelId));
182
186
}
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
- }
187
+
192
188
_showActionSheet (pageContext, optionButtons: optionButtons);
193
189
}
194
190
191
+ class TopicListButton extends ActionSheetMenuItemButton {
192
+ const TopicListButton ({
193
+ super .key,
194
+ required this .channelId,
195
+ required super .pageContext,
196
+ });
197
+
198
+ final int channelId;
199
+
200
+ @override
201
+ IconData get icon => ZulipIcons .topics;
202
+
203
+ @override
204
+ String label (ZulipLocalizations zulipLocalizations) {
205
+ return zulipLocalizations.actionSheetOptionTopicList;
206
+ }
207
+
208
+ @override
209
+ void onPressed () {
210
+ Navigator .push (pageContext,
211
+ TopicListPage .buildRoute (context: pageContext, streamId: channelId));
212
+ }
213
+ }
214
+
195
215
class MarkChannelAsReadButton extends ActionSheetMenuItemButton {
196
216
const MarkChannelAsReadButton ({
197
217
super .key,
0 commit comments