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

Notebook main toolbar additions #10271

Merged
merged 25 commits into from
May 16, 2020
Merged

Conversation

halerankin
Copy link
Contributor

@halerankin halerankin commented May 5, 2020

This PR fixes # (no task assigned)

This PR adds new functionality:
Notebook main toolbar - Created new custom control named: buttonMenu, which includes DropdownMenuActionViewItem-- which is implemented in the dropdown action at the notebook component level. This displays a dropdown at the first item "+ Cell" when user clicks on it. This allows one to add a new cell as code or as markdown.

Lastly, the three actions -- expand/collapse cells, clear contents, and trusted/not-trusted were modified to allow one of two presentations: show label beside icon (current behavior in prod code), or suppress label and add label text to icon tooltip for accessibility (new behavior).

Note: Package Manager icon and label were NOT modified because they exist in an entirely different context than the existing actions. I will need help from someone who knows more about this. The goal would be to align it with the others I have modified.

Markdown editor toolbar - Added Underline.

More details:

First item used to add cell as code or markdown:
image

Add cell menu open:
image

The end goal here will be use styled elements to replace the OS rendered open menu for this item and all other Notebook UI that opens a menu.

As for functionality:

  • Label text with (optionally) an icon preceding the text and a dropdown arrow following the text. No select box border.
  • Dropdown items consisting of actions preceded (optionally) by an icon each (see comp below)
  • Reusability across Notebook UI including upcoming cell toolbar.

Here's a snap fo the comp:
image

…y can be implemented with a boolean set to T of F and show labels or shift them into tooltip for accessibility. Updated styles for select boxes. Added toolbar icons to common icon location. Split icon definition for use as masked or background-image.
… theme colors. Simplified icon behavior styles.
…select box border and dropdown arrow. Experimenting with adding masked icon to pseudo element so I can pull out label text from icons.
…side button text. Added icons using this method to respect the color theming system.
…Implemented Underline action. Added custom --wip-- ButtonMenu control, a modified copy of DropDown.
…ed code from new custom control: buttonMneu. Revised icon styles to create a dropdown arrow for buttonMenu.
@coveralls
Copy link

coveralls commented May 5, 2020

Coverage Status

Coverage increased (+0.2%) to 33.949% when pulling f7e9990 on harankin-notebook-ui-toolbar into 0ad2a35 on master.

Copy link
Contributor

@Charles-Gagnon Charles-Gagnon left a comment

Choose a reason for hiding this comment

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

Could you please include some screenshots showing this new behavior as well? We already have a number of dropdown implementations so I'm not sure we need another new one vs just extending an existing one to support the new functionality you need.

(and if you could outline what functionality you needed that wasn't supported that'd be helpful too)

halerankin added 3 commits May 6, 2020 12:06
…he class needs. Corrected style declaration for overriding input box padding. Removed unused notebook color styles. Scoped element styles to the toolbar so others outside the toolbar are not affected.
Copy link
Contributor

@Charles-Gagnon Charles-Gagnon left a comment

Choose a reason for hiding this comment

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

Let's chat about the icon stuff when you get a chance

src/sql/base/browser/ui/buttonMenu/buttonMenu.ts Outdated Show resolved Hide resolved
src/sql/media/icons/common-icons.css Outdated Show resolved Hide resolved
… notebook toolbar icon spacing. Modified notebook.component contributed actions so that the label text is shifted into the title attribute. Added new icon for Not Trusted toggle.
src/sql/media/icons/common-icons.css Outdated Show resolved Hide resolved
return new LabeledMenuItemActionItem(action, this.keybindingService, this.contextMenuService, this.notificationService, 'notebook-button');

if (action.item.id.includes('jupyter.cmd') && this.previewFeaturesEnabled) {
incomingLabel = action.label;
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove the incomingLabel and just flip the two below statements

action.tooltip = action.label;
action.label = '';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Flipped (╯°□°)╯︵ ┻━┻

…d CSS accordingly. Removed unnecessary instance of in-preview class. Fixed code logic that assigns label text to tooltip on incoming contributed action
@halerankin halerankin merged commit 47687ff into master May 16, 2020
@Charles-Gagnon Charles-Gagnon deleted the harankin-notebook-ui-toolbar branch July 23, 2020 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants