Skip to content

Conversation

@szaimen
Copy link
Contributor

@szaimen szaimen commented Jul 20, 2021

Currently, there are many open points regarding modal sizes that each developer needs to decide and implement. This leads to unecessary code duplication, maintenance effort and inconsistent UI because each developer implements the sizing differently. Hence here is my proposal to standardize the modal sizes completely.

It also includes always using full screen modal on mobile which is the superior experience on mobile, imho.

Signed-off-by: szaimen [email protected]

@szaimen szaimen added enhancement New feature or request 3. to review Waiting for reviews design Design, UX, interface and interaction design feature: modal Related to the modal component 💥 breaking PR that requires a new major version labels Jul 20, 2021
@szaimen szaimen added this to the 4.0.4 milestone Jul 20, 2021
@szaimen szaimen force-pushed the enh/noid/standardize-modal-sizes branch from fd8d14b to 633c98b Compare July 20, 2021 14:01
@szaimen szaimen requested review from Pytal, artonge and juliusknorr July 20, 2021 14:34
@szaimen szaimen force-pushed the enh/noid/standardize-modal-sizes branch from 633c98b to f279135 Compare July 20, 2021 16:06
.modal-container {
display: block;
overflow: hidden;
overflow: auto; // avoids unecessary hacks if the content should be bigger than the modal
Copy link
Contributor

Choose a reason for hiding this comment

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

Breaking change

Copy link
Contributor Author

@szaimen szaimen Jul 20, 2021

Choose a reason for hiding this comment

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

yes, I know, hence I've added the breaking label to the PR. But it is necessary to make this work reliably.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're following SemVer then this would consitute a new major :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Jep. Would it be 4.1.0 or 5.0.0 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

5.0.0 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added milestone 5.0.0 :)

@szaimen szaimen force-pushed the enh/noid/standardize-modal-sizes branch from f279135 to 23a045e Compare July 20, 2021 16:40
@szaimen
Copy link
Contributor Author

szaimen commented Jul 20, 2021

Thanks for the review @skjnldsv!
I've just reworked some small things and added two more sizes which could potentially be useful.

@szaimen szaimen force-pushed the enh/noid/standardize-modal-sizes branch 3 times, most recently from c984924 to 08da173 Compare July 20, 2021 19:36
@szaimen szaimen requested a review from skjnldsv July 20, 2021 20:07
@szaimen szaimen modified the milestones: 4.0.4, 5.0.0 Jul 20, 2021
@szaimen szaimen force-pushed the enh/noid/standardize-modal-sizes branch from 08da173 to 2fbfd3d Compare July 24, 2021 14:38
@szaimen
Copy link
Contributor Author

szaimen commented Jul 27, 2021

I would like to get some more feedback on this from developers that already use modals in their apps.
Is this something we can do or it is just too much effort to remove all hacks that have been necesarry until this PR which will break implementation of Modal sizes?

@szaimen szaimen requested a review from st3iny July 28, 2021 13:22
@jancborchardt
Copy link
Contributor

Less decision sounds good. :) Can you add some screenshots of different examples of modals for reference?

@szaimen
Copy link
Contributor Author

szaimen commented Aug 16, 2021

Jep, Here are some examples of the different sizes :)

Size Desktop
Small image
Medium image
Normal image
Large image
Full image

@szaimen szaimen force-pushed the enh/noid/standardize-modal-sizes branch from 2fbfd3d to b8a64f9 Compare August 16, 2021 18:39
@skjnldsv skjnldsv merged commit 1494de2 into master Aug 17, 2021
@skjnldsv skjnldsv deleted the enh/noid/standardize-modal-sizes branch August 17, 2021 08:22
@skjnldsv skjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Aug 17, 2021
@skjnldsv
Copy link
Contributor

stable4 branch created https://github.com/nextcloud/nextcloud-vue/tree/stable4

@szaimen szaimen restored the enh/noid/standardize-modal-sizes branch August 17, 2021 15:10
@szaimen szaimen deleted the enh/noid/standardize-modal-sizes branch August 17, 2021 17:51
@jancborchardt
Copy link
Contributor

@szaimen @skjnldsv @marcoambrosini what do you think about folding the "Medium" and "Normal" into one size? I mean, the name is basically the same, so quite confusing. And then we only have small, medium, large and full – more obvious. :) The size could be something inbetween Medium and Normal.

@szaimen
Copy link
Contributor Author

szaimen commented Sep 20, 2021

@jancborchardt there was already a change in the modal sizes here: #2170 (comment)
So there you can see the current catalog of sizes.

I think having both sizes could be useful in some situations. But apart from that, merging medium and normal into one size in between is fine by me.

@jancborchardt
Copy link
Contributor

@szaimen there also doesn’t really seem to be a difference between "prompt" and "small" except the height (which could simply adjust based on content, with a max-height)?

Comment on lines +753 to +755
height: calc(100% - $header-size);
position: absolute;
top: $header-size;
Copy link
Contributor

Choose a reason for hiding this comment

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

We could have gone for

Suggested change
height: calc(100% - $header-size);
position: absolute;
top: $header-size;
height: auto;
position: absolute;
top: $header-size;
bottom: 0;

Copy link
Contributor

Choose a reason for hiding this comment

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

Which imho is better than calc with $header-size :)
@szaimen

Copy link
Contributor Author

@szaimen szaimen Apr 29, 2022

Choose a reason for hiding this comment

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

Would the result have been the same?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, will have an automated height and span from top to bottom since this is absolute

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fine by me then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish 💥 breaking PR that requires a new major version design Design, UX, interface and interaction design enhancement New feature or request feature: modal Related to the modal component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants