Skip to content

Commit 8cb2c7b

Browse files
committed
internal_link: Open /near/ links at the given anchor in msglist
Fixes #82. One TODO comment for this issue referred to an aspect I'm leaving out of scope for now, namely when opening a notification rather than an internal Zulip link. So I've filed a separate issue #1565 for that, and this updates that comment to point there.
1 parent aab5089 commit 8cb2c7b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

lib/notifications/display.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ class NotificationDisplayManager {
513513

514514
return MessageListPage.buildRoute(
515515
accountId: account.id,
516-
// TODO(#82): Open at specific message, not just conversation
516+
// TODO(#1565): Open at specific message, not just conversation
517517
narrow: payload.narrow);
518518
}
519519

lib/widgets/content.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,8 @@ void _launchUrl(BuildContext context, String urlString) async {
15421542
case NarrowLink():
15431543
unawaited(Navigator.push(context,
15441544
MessageListPage.buildRoute(context: context,
1545-
narrow: internalLink.narrow)));
1545+
narrow: internalLink.narrow,
1546+
initAnchorMessageId: internalLink.nearMessageId)));
15461547

15471548
case null:
15481549
await PlatformActions.launchUrl(context, url);

test/widgets/content_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,8 @@ void main() {
10321032
.page.isA<MessageListPage>().initNarrow.equals(const ChannelNarrow(1));
10331033
});
10341034

1035+
// TODO(#1570): test links with /near/ go to the specific message
1036+
10351037
testWidgets('invalid internal links are opened in browser', (tester) async {
10361038
// Link is invalid due to `topic` operator missing an operand.
10371039
final pushedRoutes = await prepare(tester,

0 commit comments

Comments
 (0)