Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android: When opening a notification, "back" should not leave the account's context #1210

Open
chrisbobbe opened this issue Dec 26, 2024 · 0 comments
Labels
a-Android Issues specific to Android, or requiring Android-specific work a-notifications beta feedback Things beta users have specifically asked for
Milestone

Comments

@chrisbobbe
Copy link
Collaborator

chrisbobbe commented Dec 26, 2024

From beta feedback.

If the app is showing UI for Account A and you open a notification for Account B, we push a message-list route for Account B onto the nav stack that's supposed to belong to Account A. This means the "back" button will take you out of Account B's context, which can be confusing.

When we navigate on opening a notification, we should switch to a new nav stack for the notification's account (if different) before pushing the message-list route.

(The iOS counterpart is covered by #1147, for navigating at all when a notification is tapped.)

Implementation

Probably we want to call HomePage.navigate

  /// Navigate to [HomePage], ensuring that its route is at the root level.
  static void navigate(BuildContext context, {required int accountId}) {
    final navigator = Navigator.of(context);
    navigator.popUntil((route) => route.isFirst);
    unawaited(navigator.pushReplacement(
      HomePage.buildRoute(accountId: accountId)));
  }

—and then push the result of MessageListPage.buildRoute after that.

@chrisbobbe chrisbobbe added a-Android Issues specific to Android, or requiring Android-specific work a-notifications beta feedback Things beta users have specifically asked for labels Dec 26, 2024
@chrisbobbe chrisbobbe added this to the M5: Launch milestone Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-Android Issues specific to Android, or requiring Android-specific work a-notifications beta feedback Things beta users have specifically asked for
Projects
Status: No status
Development

No branches or pull requests

1 participant