Skip to content

Enable links to in-app routes from chat messages #5157

@mountiny

Description

@mountiny

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!

cc @marcaaron


Problem

While working on https://github.com/Expensify/Expensify/issues/176355, we have found out there is currently no way how to add a link to chat message, which would navigate to some other view of the App (without reloading or opening new window).

We want to add a link to Concierge message, which would open the RHN with Guide calls for easier setup.

Potentially in future, there could be more usecases, where we will need this option (ie someone sharing a link like new.expensify.com/workspace/foo with someone else).

Solution

As per this Slack thread, we have decided to create a new component for AnchorForCommentsOnly which would be something along the lines of InternalAnchorForCommentsOnly.

Here, we will treat any anchor, whose href attribute starts with / as internal link and prevent default usage of <a> tag (which forces the page to reload) and use in-app system of navigation: Navigation.navigate().

  1. Check if the href starts with /.
    • If no, process the link as we do now.
  2. If yes, check if the route matches any in app ROUTES
  3. If yes again, make sure to create Pressable Text with same styling as a link which will use Navigation.navigate() on press.

Metadata

Metadata

Assignees

Labels

DailyKSv2InternalRequires API changes or must be handled by Expensify staff

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions