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

Change open in editor tab to menu button #5733

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

timtmok
Copy link
Contributor

@timtmok timtmok commented Dec 13, 2024

Address #5446

Adds changing the default action on the ActionBarMenuButton to the checked action. Refactors plots service to use a new editor's group target and store the last used option.

There are now three options when opening a plot in an editor tab:

  1. New window (default)
  2. New editor in active editor group
  3. In the editor group to the right of the active group (creates a new one if necessary)
Screen.Recording.2024-12-12.at.4.31.37.PM.mov

@:plots

QA Notes

Displays alternate editor targets
Sets target selection as default action
Copy link

github-actions bot commented Dec 13, 2024

E2E Tests 🚀  ?
This PR will run tests tagged with: @critical @plots

@timtmok
Copy link
Contributor Author

timtmok commented Dec 13, 2024

Running the e2e tests before exiting draft. I ran them locally but wanted to see if it worked in PR as well.

@timtmok
Copy link
Contributor Author

timtmok commented Dec 16, 2024

The failing test is for Data Explorer and appears unrelated.

@timtmok timtmok marked this pull request as ready for review December 16, 2024 14:58
@timtmok timtmok requested a review from sharon-wang December 16, 2024 14:58
iconId='go-to-file'
align='right'
tooltip={localize('positron-open-plot-editor', "Open plot in editor")}
ariaLabel={localize('positron-open-plot-editor', "Open plot in editor")}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may have lost the ariaLabels on the Open plot in [location] elements

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it is missing the aria on the menu button. I think the menu items are okay but it doesn't hurt to double check. It's actually the context menu service that takes IAction and it doesn't have aria labels. The Menu object does support an aria label but it looks like it's for the entire menu. I suspect that we don't need an aria label for each action since the label is already describing what it should do and a screen reader will use that.

},
{
'editorTarget': SIDE_GROUP,
'label': localize('positron-editor-new-tab-right', 'Open in editor tab to the right')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we could use similar verbiage to the File Explorer and hook into this preference: workbench.editor.openSideBySideDirection? Then the user can define whether the plot will open to the right or down based on the same preference as the File Explorer. Maybe something like "Open in editor tab to the side"?

Or maybe the user will want "to the Side" for plots to be different than the File Explorer?

Here's the context menu when right-clicking on a file in the File Explorer:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you're right about the verbiage. I think it probably uses the same setting since I'm calling the editor service. I didn't realize there was a setting for this.

@timtmok timtmok merged commit 2bc1b74 into main Jan 6, 2025
6 checks passed
@timtmok timtmok deleted the feature/plot-editor-menu-button branch January 6, 2025 21:00
@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2025
@timtmok
Copy link
Contributor Author

timtmok commented Jan 7, 2025

I tested the dropdown menu and it does read the actions correctly with a screen reader. I will open an issue about the drop down though since I see now that it's missing the aria label.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants