Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: live preview UX where clicking on lp will open html when editing unrelated ts/json/js file #1800

Merged
merged 1 commit into from
Aug 10, 2024

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.

Copy link

sonarcloud bot commented Aug 10, 2024

@abose abose merged commit 330640e into main Aug 10, 2024
17 checks passed
@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.

2 participants