Currently, when live previewing an HTML file (e.g., a.html) and switching to an unrelated file (e.g., a.json or a TypeScript file generated by a build step), clicking on the live preview unexpectedly switches the editor back to the main HTML file. This behavior disrupts the user’s workflow, especially when working on files indirectly related to the HTML being previewed. Users might find themselves forcibly navigated away from the task at hand, leading to potential confusion and inefficiency.
The behavior was initially added to phoenix to help new users navigate better, but is not hindering more advanced workflows that needs more user context. So we are reverting this change.
This change
This pull request introduces a change to maintain workflow continuity:
Preserve Current Editor State: If a user is working on an unrelated file and clicks on the live preview, the editor will no longer switch back to the main HTML file automatically.
Explicit Navigation Option: To view or edit the main HTML file in the context of live preview, users can now explicitly click on the title bar of the live preview pane. This action will open the associated HTML file, providing a deliberate choice to switch contexts without disrupting the current workflow.
Context and Problem
Currently, when live previewing an HTML file (e.g., a.html) and switching to an unrelated file (e.g., a.json or a TypeScript file generated by a build step), clicking on the live preview unexpectedly switches the editor back to the main HTML file. This behavior disrupts the user’s workflow, especially when working on files indirectly related to the HTML being previewed. Users might find themselves forcibly navigated away from the task at hand, leading to potential confusion and inefficiency.
The behavior was initially added to phoenix to help new users navigate better, but is not hindering more advanced workflows that needs more user context. So we are reverting this change.
This change
This pull request introduces a change to maintain workflow continuity: