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

Epic: New Customizable Toolbar for Editors #2085

Closed
petetronic opened this issue Jan 18, 2024 · 6 comments
Closed

Epic: New Customizable Toolbar for Editors #2085

petetronic opened this issue Jan 18, 2024 · 6 comments
Assignees
Labels
area: top bar Issues related to Top Bar category. epic Epic

Comments

@petetronic
Copy link
Collaborator

petetronic commented Jan 18, 2024

We want to add a new customizable toolbar or "action bar" to an Editor, likely best positioned to the right on the same line as the breadcrumb below the tabs.

Given extensions will have requirements to add interactive controls, modify visual state and register event handlers, we expect this will require a new programmatic API (beyond simple contributions that you may see in package.json).

An early use of this capability will be to improve the user experience in Quarto to expose common preview and rendering commands to the end user, similar to the easy access provided for these functions in RStudio today.

The initial set of controls will need to include:

  • A button, with optional icon and label text.
  • A button that reveals a dropdown menu.
  • A split button that toggles labels to match two possible modes.
  • A checkbox with label text.

Extensions may also need to customize the state of these controls based on information in the file being edited.

Test Coverage

The following automated e2e tests have been created:

These tests cover editor action bar functionality across different file types:

  • Preview (HTML)
  • Split Editor
  • Open in New Window
  • Open (Git) Changes
  • Open Viewer
  • Toggling Line Numbers
  • Toggling Bread Crumbs
  • Summary Position (Left vs Right)
  • Open as Plain Text File
@petetronic petetronic added the epic Epic label Jan 18, 2024
@petetronic
Copy link
Collaborator Author

petetronic commented Jan 18, 2024

Draft UI treatments that demonstrate new controls, each control should be broken down into individual issues and their behavior and look and feel needs to be finalized.

image (23)

Draft UI treatment of a Quarto extension example:
image (22)

@petetronic
Copy link
Collaborator Author

For now we'll leave the existing VSCode menu editor/title/run contribution as is, and focus on the new capabilities we require first.

@jgutman
Copy link
Contributor

jgutman commented Feb 26, 2024

This can be broken down into a few different areas, which I can create issues for

New editor menu action item types (UI components):

  • Button with Icon and label (currently only have icon without label)
    • This may also be the main menu item of a drop-down menu
  • Checkbox (toggle item) with label
  • Split button (toggle item) with built-in label

New extension API for adding the above action item types from an extension

Creating a new location for these editor action items, within the editor breadcrumbs bar

@wesm wesm added area: top bar Issues related to Top Bar category. and removed epic Epic labels Feb 29, 2024
@petetronic petetronic added the epic Epic label Feb 29, 2024
@jgutman jgutman removed their assignment Mar 15, 2024
@ntluong95
Copy link

That's look amazing. I hope the feature will be soon considered to add for Positron

@petetronic
Copy link
Collaborator Author

We'll tackle Quarto's use of this new capability outside of this Epic, e.g. #3923

@midleman
Copy link
Contributor

Verified Fixed

Positron Version(s) : 2025.03.0 (Universal) build 4
OS Version(s) : MacOS

Test scenario(s)

Tested the following editor action bar behaviors across multiple file types:

  • Preview (HTML)
  • Split Editor
  • Open in New Window
  • Open (Git) Changes
  • Open Viewer
  • Toggling Line Numbers
  • Toggling Bread Crumbs
  • Summary Position (Left vs Right)
  • Open as Plain Text File

Link(s) to test cases run or created:

Added: https://github.com/posit-dev/positron/blob/main/test/e2e/tests/editor-action-bar/data-files.test.ts
Added: https://github.com/posit-dev/positron/blob/main/test/e2e/tests/editor-action-bar/document-files.test.ts
Updated: https://github.com/posit-dev/positron/blob/main/test/e2e/tests/data-explorer/data-explorer-headless.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: top bar Issues related to Top Bar category. epic Epic
Projects
None yet
Development

No branches or pull requests

7 participants