Skip to content

Commit 1b918d9

Browse files
committed
nav: Add button for test-here narrow
Up to now we've provided navigation only to the all-messages narrow, and we've given that screen a compose box with a hack that has it send only to `#test here`. We're going to remove that hack and put no compose box on that screen. To prepare for that, we'll want some other way to quickly get to a screen with a compose box, for testing. Do that with the actual stream narrow for `#test here`.
1 parent 541ecd8 commit 1b918d9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/widgets/app.dart

+13
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ class HomePage extends StatelessWidget {
119119
InlineSpan bold(String text) => TextSpan(
120120
text: text, style: const TextStyle(fontWeight: FontWeight.bold));
121121

122+
int? testStreamId;
123+
if (store.connection.realmUrl.origin == 'https://chat.zulip.org') {
124+
testStreamId = 7; // i.e. `#test here`; TODO cut this scaffolding hack
125+
}
126+
122127
return Scaffold(
123128
appBar: AppBar(title: const Text("Home")),
124129
body: Center(
@@ -145,6 +150,14 @@ class HomePage extends StatelessWidget {
145150
MessageListPage.buildRoute(context: context,
146151
narrow: const AllMessagesNarrow())),
147152
child: const Text("All messages")),
153+
if (testStreamId != null) ...[
154+
const SizedBox(height: 16),
155+
ElevatedButton(
156+
onPressed: () => Navigator.push(context,
157+
MessageListPage.buildRoute(context: context,
158+
narrow: StreamNarrow(testStreamId!))),
159+
child: const Text("#test here")), // scaffolding hack, see above
160+
],
148161
])));
149162
}
150163
}

0 commit comments

Comments
 (0)