Skip to content

Conversation

@abose
Copy link
Member

@abose abose commented Aug 10, 2024

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:

  1. 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.
  2. 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. image

@phoenixide
Copy link
Member

Thank You for making this pull request.

@sonarqubecloud
Copy link

@abose abose merged commit 330640e into main Aug 10, 2024
@abose abose deleted the p branch August 10, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants