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

Replace/override Simple Browser with Positron's Viewer #3714

Closed
Tracked by #4858
jmcphers opened this issue Jun 28, 2024 · 2 comments
Closed
Tracked by #4858

Replace/override Simple Browser with Positron's Viewer #3714

jmcphers opened this issue Jun 28, 2024 · 2 comments
Assignees
Labels
area: quarto Issues related to Quarto category. area: viewer Issues related to Viewer category. theme: app builder

Comments

@jmcphers
Copy link
Collaborator

In Positron, the Simple Browser (inherited from Code OSS) and the Positron Viewer Pane have a lot of overlap. Both of them show URLs and provide a toolbar for navigating URLs, etc. However, they also have some differences, for example:

  • The Simple Browser opens up as an editor tab, but the Viewer Pane opens up in a side panel (by default in the right auxiliary bar)
  • You can have multiple Simple Browsers open, but only one Viewer Pane.
  • The Viewer Pane supports copy/paste and context menus (see Fix copy/paste and context menus for Shiny and other content in Viewer pane #3430), but the Simple Browser does not.
  • The Viewer Pane uses Positron-styled controls; the Simple Browser bundles its own controls that are VS Code-like.
  • The Viewer Pane updates its URL as you navigate; the Simple Browser does not.

Having two competing ways of viewing URLs with their own set of tradeoffs is confusing. For example, you have to choose between the Simple Browser and Viewer Pane when clicking on a URL:

image

Proposal:

  • Provide a way to open the Viewer Pane's contents in an editor tab, so that users/workflows that prefer this behavior can still use it.
  • To reduce confusion, do not register the Simple Browser as a URL opener, so it doesn't show in the list of handlers when users click links/navigate to URLs on the workbench surface.
  • Do not remove the Simple Browser's commands; instead, override them so that the URLs are handled by the Viewer Pane instead. (There's a pretty good chance existing code/extensions are invoking the Simple Browser's commands to open URLs, and we want those to continue to work)
@juliasilge juliasilge added the area: viewer Issues related to Viewer category. label Jun 30, 2024
@juliasilge juliasilge added this to the 2024.09.0 Pre-Release milestone Jul 5, 2024
@juliasilge
Copy link
Contributor

Provide a way to open the Viewer Pane's contents in an editor tab, so that users/workflows that prefer this behavior can still use it.

If we added this, then a user such as the one in #4402 could open the Viewer Pane in an editor tab and then pull it out into a separate window.

@isabelizimm isabelizimm self-assigned this Sep 23, 2024
@juliasilge juliasilge added the area: quarto Issues related to Quarto category. label Oct 10, 2024
isabelizimm added a commit that referenced this issue Nov 21, 2024
addresses #3714 

Example video (bonus content: if you turn volume up you can hear puppy
snoring 💤 )
 

https://github.com/user-attachments/assets/9811ba80-9fd3-4bab-b12e-6d6376ebfe3c

Can pop out HTML or url from viewer pane to editor tab. Should work for
multiple editors, independently of the Viewer pane content.

Known problems/what is not included:

- cannot go directly from `Preview` button in Quarto file to editor. It
seems like Quarto has a different toolbar than urls/html (same with html
sent to output, eg, #4601)
- no ability to go from HTML file directly to editor
- no toggle as an experimental feature, but happy to add that in if we
think its the right choice!

very inspired by #4364 🫶 

# QA notes

These are all gestures I've gone through and confirmed working! It looks
like a lot of steps but includes a lot of opening up files 😄

- Have 2 distinct`.qmd` files
- `quarto render filename_1.qmd` in Terminal so you have HTML output
- Open HTML in Viewer
- Click editor button (icon shown in video) to open in editor
- Resize newly opened editor, should not overlap
- With `filename_1.qmd` still in editor,`quarto preview filename_2.qmd`
to get a `localhost` url
- Click on url and open in Viewer
- Click editor button so you have both `.qmd` files in editors
- Switch between editors, should reopen prior content
- Clear Viewer pane, should affect editors
- Close editors

---------

Signed-off-by: Isabel Zimmerman <[email protected]>
@midleman
Copy link
Contributor

Verified Fixed

Positron Version(s) : 2024.12.0-80
OS Version(s) : MacOS

Test scenario(s)

Confirmed I was able to open files in Viewer and pop into editor as expected.

Ran into one issue (opens multiple editors on consecutive clicks) and it will be handled separately: #5527

Link(s) to TestRail test cases run or created:

n/a

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: quarto Issues related to Quarto category. area: viewer Issues related to Viewer category. theme: app builder
Projects
None yet
Development

No branches or pull requests

4 participants