Add seamless SPA navigation between editing different pages/content
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3538104. -->
Reported by: [hooroomoo](https://www.drupal.org/user/3688872)
Related to !560 !419
>>>
<h3 id="overview">Overview</h3>
<p><del>Postponed on <span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/canvas/-/work_items/3502887" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/canvas/-/work_items/3502887</a></span>.</del></p>
<p>Currently navigating from e.g. /editor/canvas_page/1 to /editor/canvas_page/2 triggers a full page reload. This is necessary because some data is currently only fetched on page load and not dynamically requested when performing SPA navigation between routes that show different entities.</p>
<p>A significant issue this causes is when viewing errors after attempting to publish/review changes. If one of the errors is for a component on a different <code>canvas_page</code>, then clicking the error to go to that page will trigger a full page reload, which then loses the list of publish errors. After we are able to navigate between pages with react routing, then the list of publish errors can persist.</p>
<p>Another issue is that upcoming designs have the user being able to seamlessly navigate into/out of "full page" interfaces with the expectation that they can click "close" and return to the route they came from. If that close triggers a full page load it will not be a smooth UX.</p>
<p>Think it will be good to still have the option of opening the component instance in a new tab but also have the ability to navigate within the current tab you are in.</p>
<h3 id="proposed-resolution">Proposed resolution</h3>
<p><strong>Important:</strong> Undo/redo needs to work correctly. When navigating between editing two different pages it's important that we don't add an extra history state representing the new layout/model being swapped in.</p>
<p><del>It's also important that undoing correctly navigates back to the correct URL so the user can see the change they made (well un-made!).</del></p>
<p>^ moved to follow up <span class="drupalorg-gitlab-issue-link project-issue-status-info project-issue-status-1"><a href="https://www.drupal.org/project/canvas/issues/3566074" title="Status: Active">#3566074: Re-implement Undo/Redo as "action/inverse action"</a></span> - for now the behaviour we currently have where undo/redo is lost when navigating between pages will continue.</p>
<h3 id="ui-changes">User interface changes</h3>
> Related issue: [Issue #3502887](https://www.drupal.org/node/3502887)
> Related issue: [Issue #3566074](https://www.drupal.org/node/3566074)
> Related issue: [Issue #3572292](https://www.drupal.org/node/3572292)
> Related issue: [Issue #3571599](https://www.drupal.org/node/3571599)
> Related issue: [Issue #3537146](https://www.drupal.org/node/3537146)
issue