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

feat(PPDSE-2360): feat-2360-vertical-volume-control-gap #371

Merged
merged 19 commits into from
Sep 23, 2022

Conversation

baburay23
Copy link
Contributor

@baburay23 baburay23 commented Sep 12, 2022

PPDSC-2360

What

Please note that this was originally a spike but no investigation was needed in the end, design were happy with the change so i implemented everything here in the ticket

  1. Background - There is no space between vertical volume control popover and the mute button
  2. What did you do-
    After some attempts we decided to extend the props of the Popover and allow the user to set hidePointer=false on the AudioPlayerVolumeControl.
    By bringing in the Popover Props and Overrides into the AudioPlayerVolumeControl in audioPlayerVolumeControl the user can override the Pointer size and stylepreset, when the pointer is shown the user can hover between the mute button and popover, this is the only way to have the desired behaviour. We decided to give the option to the user to make the pointer transparent that way they can hover inbetween the gap.
    If they create a style preset
const volumeTheme = createTheme({
  name: 'my-custom-volume-theme',
  overrides: {
    stylePresets: {
      customPointerStylePreset: {
        base: {
          backgroundColor: 'transparent',
        },
      },
    },
  },
});

and then add it to the pointer stylePreset override

        <AudioPlayerVolumeControl
          layout="vertical"
          overrides={{
            popover: {
              distance: 'space050',
              pointer: {
                size: 'sizing080',
                stylePreset: 'customPointerStylePreset',
              },
            },
          }}
        />

the pointer will now be transparent and the user can hoover
If they only passed layout=vertical it would look like this
Screenshot 2022-09-16 at 12 52 32

Originally i thought it was a good idea to add the stylePreset for the pointer on our volumeControl defaults but after speaking to other engineers it seems quite hacky and this situation is an edge case. So we thought it might be better to add a storybook scenario instead and the user can set the transparency on the stylePreset themselves

I hope this is ok..if anyone has any opinions otherwise please do let me know.

  1. What does the reviewers should expect- overridable space between mute button and popover on volume control vertical

I have done:

  • Written unit tests against changes
  • Written functional tests against the component and/or NewsKit site
  • Updated relevant documentation

I have tested manually:

  • The feature's functionality is working as expected on Chrome, Firefox, Safari and Edge
  • The screen reader reads and flows through the elements as expected.
  • There are no new errors in the browser console coming from this PR.
  • When visual test is not added, it renders correctly on different browsers and mobile viewports (Safari, Firefox, small mobile viewport, tablet)
  • The Playground feature is working as expected

Before:

After:

Who should review this PR:

How to test:

@github-actions github-actions bot added the feature This change contains a new feature label Sep 12, 2022
@baburay23 baburay23 changed the title feat(PPDSE-2360): feat-2360-added-space feat(PPDSE-2360): feat-2360-vertical-volume-control-gap Sep 12, 2022
@baburay23 baburay23 added the ready for review Please assist in getting this reviewed label Sep 12, 2022
Copy link
Contributor

@mutebg mutebg left a comment

Choose a reason for hiding this comment

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

I think you are on the right path,
However, there is 1 issue. adding this styled block with extra padding makes the whole Block bigger and takes much more space than just a button.
IMO that should not happen.
Screenshot 2022-09-13 at 9 12 33

@baburay23 baburay23 added WIP Work in progress and removed ready for review Please assist in getting this reviewed labels Sep 13, 2022
@baburay23 baburay23 added ready for review Please assist in getting this reviewed and removed WIP Work in progress labels Sep 15, 2022
@baburay23 baburay23 force-pushed the feat/PPDSE-2360-vertical-volumecontrol-gap branch from 2678401 to bb93c16 Compare September 16, 2022 11:37
Xin00163
Xin00163 previously approved these changes Sep 16, 2022
const popoverOverrides = getPopoverOverrides(theme, overrides);

const TheContent = (
Copy link
Contributor

@Vanals Vanals Sep 16, 2022

Choose a reason for hiding this comment

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

Might this be renamed to popoverContent or verticalVolumeSlider? to be more descriptive

Copy link
Contributor

Choose a reason for hiding this comment

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

only react component should start with the upper latter

@@ -23,6 +23,7 @@ export default {
stylePreset: 'iconButtonMinimalPrimary',
},
popover: {
distance: 'space030',
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, should not be using padding or margin key words here? distance I think we have never used it? is that ok 🤔 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I remember speaking with Mike F about that, its not margin or padding. that's distance between the popover and the button, you still can add padding and margin to the popover/tooltip.

Now I am seeing that probably the right name was "offset" ( that's the name in floating-ui library ) but it's too late since is gonna be a breaking change.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see! something maybe to consider for a major? for keeping our props consistent 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Vanals will create a ticket for this so that next time we work on major tickets we can fix this!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

</StyledVolumeSliderPopupContainer>
);
const DefaultPopover = Popover;
const [PopoverComponent, popoverProps] = getComponentOverrides(
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the difference between this and just having the Popover component in the return statement as before?

Copy link
Contributor

Choose a reason for hiding this comment

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

the idea is to be able to override Popover props ( not only styling ) for example to set hidePointer=false

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, thanks

@baburay23 baburay23 merged commit b28bb5c into main Sep 23, 2022
@baburay23 baburay23 deleted the feat/PPDSE-2360-vertical-volumecontrol-gap branch September 23, 2022 10:50
Xin00163 pushed a commit that referenced this pull request Oct 17, 2022
* feat(PPDSE-2360): feat-2360-added-space

* feat(PPDSE-2360): feat-2360-added-open prop

* feat(PPDSE-2360): feat-2360-removed open prop

* feat(PPDSE-2360): feat-2360-tidied up

* feat(PPDSE-2360): feat-2360-spaceBetween prop bacl

* feat(PPDSE-2360): feat-2360-removed padding from button

* feat(PPDSE-2360): feat-2360-added mouseleave on slider

* feat(PPDSE-2360): feat-2360-added mouseonleave bk

* feat(PPDSE-2360): feat-2360-getcomponentoverrides added

* feat(PPDSE-2360): feat-2360-updated other story

* feat(PPDSE-2360): feat-2360-updated vertical stories

* feat(PPDSE-2360): feat-2360-added extra story

* feat(PPDSE-2360): feat-2360-changed types

* feat(PPDSE-2360): feat-2360-updated stories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This change contains a new feature ready for review Please assist in getting this reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants