Skip to content

Commit 01c8924

Browse files
Khader-1gnprice
authored andcommitted
narrow [nfc]: Rename references of ChannelNarrow to match new name
1 parent 8cf3b6a commit 01c8924

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

lib/model/unreads.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ class Unreads extends ChangeNotifier {
151151
/// actively unmuted.
152152
///
153153
/// For a count that's appropriate in UI contexts that are focused
154-
/// specifically on this stream, see [countInStreamNarrow].
154+
/// specifically on this stream, see [countInChannelNarrow].
155155
// TODO(#370): maintain this count incrementally, rather than recomputing from scratch
156156
int countInStream(int streamId) {
157157
final topics = streams[streamId];
@@ -174,7 +174,7 @@ class Unreads extends ChangeNotifier {
174174
/// For a count that's appropriate in UI contexts that are not already
175175
/// focused on this stream, see [countInStream].
176176
// TODO(#370): maintain this count incrementally, rather than recomputing from scratch
177-
int countInStreamNarrow(int streamId) {
177+
int countInChannelNarrow(int streamId) {
178178
final topics = streams[streamId];
179179
if (topics == null) return 0;
180180
int c = 0;
@@ -198,7 +198,7 @@ class Unreads extends ChangeNotifier {
198198
case CombinedFeedNarrow():
199199
return countInCombinedFeedNarrow();
200200
case ChannelNarrow():
201-
return countInStreamNarrow(narrow.streamId);
201+
return countInChannelNarrow(narrow.streamId);
202202
case TopicNarrow():
203203
return countInTopicNarrow(narrow.streamId, narrow.topic);
204204
case DmNarrow():

lib/widgets/compose_box.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ abstract class ComposeBoxController<T extends StatefulWidget> extends State<T> {
913913
FocusNode get contentFocusNode;
914914
}
915915

916-
/// A compose box for use in a stream narrow.
916+
/// A compose box for use in a channel narrow.
917917
///
918918
/// This offers a text input for the topic to send to,
919919
/// in addition to a text input for the message content.

lib/widgets/inbox.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ class _StreamHeaderItem extends _HeaderItem {
441441
pageState.collapseStream(subscription.streamId);
442442
}
443443
}
444-
@override Future<void> onRowTap() => onCollapseButtonTap(); // TODO open stream narrow
444+
@override Future<void> onRowTap() => onCollapseButtonTap(); // TODO open channel narrow
445445
}
446446

447447
class _StreamSection extends StatelessWidget {

test/model/internal_link_test.dart

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,30 +279,30 @@ void main() {
279279
});
280280

281281
group('parseInternalLink edge cases', () {
282-
void testExpectedStreamNarrow(String testCase, int? streamId) {
283-
final streamNarrow = (streamId != null) ? ChannelNarrow(streamId) : null;
284-
testExpectedNarrows([(testCase, streamNarrow)], streams: [
282+
void testExpectedChannelNarrow(String testCase, int? streamId) {
283+
final channelNarrow = (streamId != null) ? ChannelNarrow(streamId) : null;
284+
testExpectedNarrows([(testCase, channelNarrow)], streams: [
285285
eg.stream(streamId: 1, name: "general"),
286286
]);
287287
}
288288

289289
group('basic', () {
290-
testExpectedStreamNarrow('#narrow/stream/1-general', 1);
290+
testExpectedChannelNarrow('#narrow/stream/1-general', 1);
291291
});
292292

293293
group('if stream not found, use stream ID anyway', () {
294-
testExpectedStreamNarrow('#narrow/stream/123-topic', 123);
294+
testExpectedChannelNarrow('#narrow/stream/123-topic', 123);
295295
});
296296

297297
group('on stream link with wrong name, ID wins', () {
298-
testExpectedStreamNarrow('#narrow/stream/1-nonsense', 1);
299-
testExpectedStreamNarrow('#narrow/stream/1-', 1);
298+
testExpectedChannelNarrow('#narrow/stream/1-nonsense', 1);
299+
testExpectedChannelNarrow('#narrow/stream/1-', 1);
300300
});
301301

302302
group('on malformed stream link: reject', () {
303-
testExpectedStreamNarrow('#narrow/stream/-1', null);
304-
testExpectedStreamNarrow('#narrow/stream/1nonsense-general', null);
305-
testExpectedStreamNarrow('#narrow/stream/-general', null);
303+
testExpectedChannelNarrow('#narrow/stream/-1', null);
304+
testExpectedChannelNarrow('#narrow/stream/1nonsense-general', null);
305+
testExpectedChannelNarrow('#narrow/stream/-general', null);
306306
});
307307
});
308308

test/model/unreads_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void main() {
174174
check(model.countInCombinedFeedNarrow()).equals(5);
175175
});
176176

177-
test('countInStream/Narrow', () async {
177+
test('countInChannel/Narrow', () async {
178178
final stream = eg.stream();
179179
prepare();
180180
await channelStore.addStream(stream);
@@ -189,14 +189,14 @@ void main() {
189189
eg.streamMessage(stream: stream, topic: 'b', flags: []),
190190
eg.streamMessage(stream: stream, topic: 'c', flags: []),
191191
]);
192-
check(model.countInStream (stream.streamId)).equals(5);
193-
check(model.countInStreamNarrow(stream.streamId)).equals(5);
192+
check(model.countInStream (stream.streamId)).equals(5);
193+
check(model.countInChannelNarrow(stream.streamId)).equals(5);
194194

195195
await channelStore.handleEvent(SubscriptionUpdateEvent(id: 1,
196196
streamId: stream.streamId,
197197
property: SubscriptionProperty.isMuted, value: true));
198-
check(model.countInStream (stream.streamId)).equals(2);
199-
check(model.countInStreamNarrow(stream.streamId)).equals(5);
198+
check(model.countInStream (stream.streamId)).equals(2);
199+
check(model.countInChannelNarrow(stream.streamId)).equals(5);
200200
});
201201

202202
test('countInTopicNarrow', () {

test/widgets/action_sheet_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ void main() {
288288
check(contentController).not((it) => it.validationErrors.contains(ContentValidationError.quoteAndReplyInProgress));
289289
}
290290

291-
testWidgets('in stream narrow', (WidgetTester tester) async {
291+
testWidgets('in channel narrow', (WidgetTester tester) async {
292292
final message = eg.streamMessage();
293293
await setupToMessageActionSheet(tester, message: message, narrow: ChannelNarrow(message.streamId));
294294
final store = await testBinding.globalStore.perAccount(eg.selfAccount.id);

0 commit comments

Comments
 (0)