We use modal dialogs in our web application for actions such as deleting or creating an entity. These modals could be rendered as "on page actions", which are stateful and relative to the current page, or, these modals could be rendered under a separate route, e.g. mycoolapp.com/projects/create
(without changing the design of the page).
Using modern web technologies such as React, there need not even be a page refresh for the route (while still altering the browser's history stack).
Personally, I believe there are plenty of benefits in using separate routes for modals:
- Altering the browser's history stack enables entering or exiting the modal using backwards and forwards navigation
- Since these actions / pages have a specific link, they can be referenced and shared either by people (sending the link to create a new project to a coworker), by support staff, or in the documentation
Researching this topic, I wasn't able to find any good resources that investigate this topic. What is your opinion on this topic? Are there any established standards and best practices on whether modals should have separate routes?