Skip to content

Conversation

@LFDanLu
Copy link
Member

@LFDanLu LFDanLu commented Feb 27, 2020

Closes https://jira.corp.adobe.com/browse/RSP-1526

✅ Pull Request Checklist:

  • Included link to corresponding Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

'type: popover, fullscreen',
() => render({type: 'popover', size: 'fullscreen'})
)
.add(
Copy link
Member

Choose a reason for hiding this comment

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

this one seems weird, same question

'with hero, isDimissable',
() => renderHero({isDismissable: true, onDismiss: action('dismissed')})
)
.add(
Copy link
Member

Choose a reason for hiding this comment

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

can we not specify these anymore? (S/M/L)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll readd

'form',
() => renderWithForm({})
)
.add(
Copy link
Member

Choose a reason for hiding this comment

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

this needs to be added somewhere, it's a good story to demonstrate tabbing order

.spectrum-Dialog--fullscreen {
width: calc(100vw - 32px);
height: calc(100vh - 32px);
width: calc(100vw - 64px);
Copy link
Member

Choose a reason for hiding this comment

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

where does 64 come from? should it change with scale?

Copy link
Member Author

Choose a reason for hiding this comment

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

32px is the padding that is supposed to be around the fullscreen dialog. Since that padding is 32px for both top/bottom and left/right, the above needed to get doubled so it actually fit the 32px padding container

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if it should change with scale, didn't see fullscreen in the XD designs, I'll ask around

Copy link
Member Author

Choose a reason for hiding this comment

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

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

.spectrum-Dialog--fullscreen {
width: calc(100vw - 32px);
height: calc(100vh - 32px);
width: calc(100vw - 80px);
Copy link
Member

Choose a reason for hiding this comment

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

calc 2* fullscreen margin?

@adobe-bot
Copy link

Build successful! 🎉

snowystinger
snowystinger previously approved these changes Feb 28, 2020
ktabors
ktabors previously approved these changes Mar 2, 2020

/* Distance between top and bottom of dialog and edge of window for fullscreen dialog */
--spectrum-dialog-fullscreen-margin: 32px;
--spectrum-dialog-fullscreen-margin: 40px;
Copy link
Member

Choose a reason for hiding this comment

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

Is there a common place for components/dialog/index.css and this file to share this variable?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ideally I would've included it into the css var but Larry said that file was autogenerated and to put new vars at the top of the index.css file.

@adobe-bot
Copy link

Build successful! 🎉

@codecov
Copy link

codecov bot commented Mar 2, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@7c16163). Click here to learn what that means.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #229   +/-   ##
=========================================
  Coverage          ?   70.58%           
=========================================
  Files             ?      206           
  Lines             ?     3977           
  Branches          ?      848           
=========================================
  Hits              ?     2807           
  Misses            ?      587           
  Partials          ?      583
Impacted Files Coverage Δ
...kages/@react-spectrum/dialog/src/DialogTrigger.tsx 85.18% <ø> (ø)
packages/@react-spectrum/overlays/src/Modal.tsx 100% <100%> (ø)
packages/@react-spectrum/dialog/src/Dialog.tsx 82.35% <66.66%> (ø)

@LFDanLu LFDanLu dismissed stale reviews from ktabors and snowystinger via de82990 March 2, 2020 23:22
@adobe-bot
Copy link

Build successful! 🎉

ktabors
ktabors previously approved these changes Mar 3, 2020
@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

mobileType = type === 'popover' ? 'modal' : type,
hideArrow,
targetRef,
size,
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding a size prop to this, can we take advantage of type? We could have types: modal, popover, tray, fullscreen, fullscreenTakeover.
Make sense?

Copy link
Member

Choose a reason for hiding this comment

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

Can you also add those 2 new types to mobileType. We want to allow people to override some default behaviors regarding mobile views.

Copy link
Member Author

@LFDanLu LFDanLu Mar 5, 2020

Choose a reason for hiding this comment

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

Ehh, I considered this before and it feels weird to me since it dilutes the intuitive meaning of the type prop. To me type indicates the kinda of shape/look of the Dialog where the size prop is its literal meaning. This would mean a user could provide a size to dialog (S/M/L) and specify type=fullscreen as well which doesn't really make sense as a pairing

Copy link
Member Author

Choose a reason for hiding this comment

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

If we are trying to distinguish that fullscreen/fullscreenTakeover is for modal only, we could go one step further and change size to be modalSize since it only really applies to the modal type as is.

Copy link
Member

Choose a reason for hiding this comment

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

yeah mostly the problem here is that DialogTrigger handles too much anyway. The situation you describe will exist anyway in other forms because we are mixing popover and modal behaviors. We will need in on mobileType so it seemed the best to just add it to type as well. Otherwise based on your suggestion we would need modalSize and mobileModalSize?

Copy link
Member Author

Choose a reason for hiding this comment

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

yup we would need to add mobileModalSize as well in case the user wants separate size behavior on mobile vs desktop.

I'll go with your suggestion for now and add the 2 fullscreen types

Copy link
Member

Choose a reason for hiding this comment

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

ok cool

@adobe-bot
Copy link

Build successful! 🎉

@adobe-bot
Copy link

Build successful! 🎉

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.

8 participants