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

Floating toolbar #1956

Conversation

sorina-ocheana
Copy link
Contributor

@sorina-ocheana sorina-ocheana commented Dec 14, 2023

Description

Added the floating toolbar component

References #1420

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

I've added the component to the index.html using its HTML tag.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@sorina-ocheana sorina-ocheana requested review from coliff and a team as code owners December 14, 2023 09:09
Copy link

netlify bot commented Dec 14, 2023

Deploy Preview for modus-webcomponents ready!

Name Link
🔨 Latest commit b4780d5
🔍 Latest deploy log https://app.netlify.com/sites/modus-webcomponents/deploys/659cf4c1deae4f0008a16c94
😎 Deploy Preview https://deploy-preview-1956--modus-webcomponents.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 25 (🔴 down 2 from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@coliff coliff changed the title Issue 1420/floating toolbar Floating toolbar Dec 14, 2023
@coliff

This comment was marked as outdated.

@sorina-ocheana

This comment was marked as outdated.

@coliff coliff requested a review from a team January 9, 2024 08:01
Copy link
Contributor

@cjwinsor cjwinsor left a comment

Choose a reason for hiding this comment

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

I wasn't able to review in storybook from the site in the PR, as it wasn't showing the menu. That will need to be looked into. I pulled down locally for review.

For the split and horizontal scenario, the toolbar is offset to the right a bit relative to the other examples
image

Also I noticed the rounded left border was missing when combined, both horizontal and vertical (image shows top as current state, bottom is with a corrected border)
image

Both the modus styleguide and figma have the divider color as --modus-gray-0 (#e0e1e9)

The background in the modus styleguide and figma are both white. Might be good to audit all the color choices.

There are other small details in the modus styleguide, such as the rounder borders on the button separate from the rounded borders of the toolbar.
image
image

Other than that, would be great if you could handle dark mode as well.

disabled={this.disabled}
onClick={() => (!this.disabled ? this.buttonClick.emit() : null)}>
{this.iconSrc && <img src={this.iconSrc} />}
{this.textButton}
Copy link
Contributor

@cjwinsor cjwinsor Jan 10, 2024

Choose a reason for hiding this comment

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

I'm not sure text as context is approved at the moment. Is this a required use case for your scenario? Both the modus styleguide and the figma don't include text examples.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The text buttons were discussed on the issue created for this component (#1420) multiple use cases were provided and it was approved.

Copy link
Contributor

Choose a reason for hiding this comment

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

@sorina-ocheana I apologize, I did not update myself with the submitted issue. The decisions made in the ticket were not reflected in the areas I was told were the sources of truth. I will review the issue and adjust any comments accordingly as well as work internally to ensure we have a pathway to updating our sources of truth after decisions are made.

})
export class ModusToolbar {
/** The buttons to render. */
@Prop() buttons: ModusToolbarButton[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

If this was an array of an array of buttons, then could we manage the divider in a more natural way? No property for divider anymore. If combined, then there will be a divider between groups. Perhaps a ModusToolbarButtonGroup array as the outer type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discussed on chat.

stencil-workspace/src/index.html Outdated Show resolved Hide resolved
Copy link

netlify bot commented Jan 17, 2024

Deploy Preview for moduswebcomponents ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a600757
🔍 Latest deploy log https://app.netlify.com/sites/moduswebcomponents/deploys/65a8f29ffa225c0008732bbe
😎 Deploy Preview https://deploy-preview-1956--moduswebcomponents.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 27 (🔴 down 3 from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

};

export const VerticalSplitToolbar = Template.bind({});
Default.args = {
Copy link
Contributor

@cjwinsor cjwinsor Jan 17, 2024

Choose a reason for hiding this comment

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

This should set the args for VerticalSplitToolbar

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

},
};

const Template = ({buttons, layout, toolbarStyle}) => html`<modus-toolbar buttons=${buttons} layout=${layout} toolbarStyle=${toolbarStyle}></modus-toolbar>`;
Copy link
Contributor

@cjwinsor cjwinsor Jan 17, 2024

Choose a reason for hiding this comment

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

To use property binding you'll need to put a . in front of your attribute.

const Template = ({buttons, layout, toolbarStyle}) => html`
  <modus-toolbar .buttons=${buttons} .layout=${layout} .toolbarStyle=${toolbarStyle}></modus-toolbar>
`;

This should fix it not showing in the docs and canvas.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@cjwinsor
Copy link
Contributor

Make sure you run npm run lint. I see that it'll apply fixes on 2 of the toolbar files. You may ignore the other lint issues, those need addressed outside this PR.

@coliff
Copy link
Member

coliff commented Jun 19, 2024

thanks for your work on this @sorina-ocheana - we have a (floating) Toolbar component added now!
https://modus-web-components.trimble.com/?path=/story/components-toolbar--default

@coliff coliff closed this Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants