positron icon indicating copy to clipboard operation
positron copied to clipboard

Replace/override Simple Browser with Positron's Viewer

Open jmcphers opened this issue 1 year ago • 1 comments

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 #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)

jmcphers avatar Jun 28 '24 18:06 jmcphers

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 https://github.com/posit-dev/positron/discussions/4402 could open the Viewer Pane in an editor tab and then pull it out into a separate window.

juliasilge avatar Aug 21 '24 17:08 juliasilge

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: https://github.com/posit-dev/positron/issues/5527

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

n/a

midleman avatar Nov 27 '24 12:11 midleman