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

UX-3157 Suggest reasonable dialog/popup sizes for popular cases #1407

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

eldar-jetbrains
Copy link
Collaborator

New guideline for dialog and popup sizes


For example, the height of the <control>Git Brunches</control> popup adapts to the amount of the content inside:

![Two Git Branches popups adapting to the height of their content. The popup on the left is shorter because it has fewer branches, while the popup on the right is longer because it has more branches](dialog_popup_sizes_adaptive.png){width="706"}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

adapting → adapted

<tr>
<td width="50%">
Vertical <control>Project</control> tool window:
<img src="dialog_popup_sizes_tool_window_vertical.png" alt=""/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alt text is needed

</td>
<td width="50%">
Horizontal <control>Build</control> tool window:
<img src="dialog_popup_sizes_tool_window_horizontal.png" alt=""/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alt text is needed

<tr>
<td width="706">
<format color="369650" style="bold">Correct</format>
<img src="dialog_popup_sizes_example_2_correct.png" alt=""/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alt text is needed

<tr>
<td width="706">
<format color="DarkOrange" style="bold">Acceptable</format>
<img src="dialog_popup_sizes_example_2_acceptable.png" alt=""/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alt text is needed

<tr>
<td width="706">
<format color="369650" style="bold">Correct</format>
<img src="dialog_popup_sizes_example_3_correct.png" alt=""/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alt text is needed

<tr>
<td width="706">
<format color="DarkOrange" style="bold">Acceptable</format>
<img src="dialog_popup_sizes_example_3_acceptable.png" alt=""/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alt text is needed

<tr>
<td width="706">
<format color="369650" style="bold">Correct</format>
<img src="dialog_popup_sizes_empty_state_correct.png" alt=""/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alt text is needed

<tr>
<td width="706">
<format color="E55765" style="bold">Incorrect</format>
<img src="dialog_popup_sizes_empty_state_incorrect.png" alt=""/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Alt text is needed

@@ -0,0 +1,278 @@
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->

# Dialog and Popup Sizes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here it's dialog and popup but in the article it's also tool windows and editor tabs. Not sure how to solve this though

Copy link
Collaborator

Choose a reason for hiding this comment

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

Possibly separate this article into several under the common group header? Like this:

  • Default and minimum sizes
    • Components
    • Dialogs
    • Popups
    • Tool windows

Copy link
Collaborator Author

@eldar-jetbrains eldar-jetbrains Dec 18, 2024

Choose a reason for hiding this comment

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

Maybe we could just name the article 'Window sizes'? Editor tabs can be considered as a special case


### Dialog

There are four recommended window sizes for dialogs: **extra small**, **small**, **medium**, and **large**. Select the size depending on the amount of content to keep the important information visible.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Possibly could make an illustration comparing this sizes where one overlays another, and show sizes on them — can serve as an "at a glance" reference

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was actually thinking about making a preview where we could show a possible layout for each size

topics/Dialog-and-popup-sizes.md Outdated Show resolved Hide resolved
Size: 500×350 px

Best for:
* Two-column layout with a tree on one column and several components that are stacked vertically in the second column.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems 500 px width is too small for this? Is there an example?

Copy link
Collaborator Author

@eldar-jetbrains eldar-jetbrains Dec 18, 2024

Choose a reason for hiding this comment

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

You're right, it's quite small. Plus, I couldn't find an example for this case, seems redundant here. I removed it

* A full-width table with two or three columns.
* A full-width code editor or snippet.

For example, the <control>Evaluate Expressions</control> dialog has two code snippets that are stacked vertically:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think these are an input field with the editor font and a tree with long lines, not code snippets

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agreed. Could we come up with a collective term for these kinds of inputs? Both code snippets and input fields with code require large width. Or we could just write something like 'A full-width code snippet or input field with long text' in the last


## Minimum sizes for components

When the default sizes are either too big or too small for a window, or the window has a complex layout, add minimum sizes to important content inside the window. This will make the content displayed correctly and reduce any potential issues caused by resizing the window.
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. I think, these min sizes should always be set
  2. Possibly tell we have 2 sets of rules in the beginning of the article? That is, for simple cases use xs, s, m, l sizes. When it doesn't fit well, think about min sizes of controls

When the default sizes are either too big or too small for a window, or the window has a complex layout, add minimum sizes to important content inside the window. This will make the content displayed correctly and reduce any potential issues caused by resizing the window.

### How to set the size correctly

Copy link
Collaborator

Choose a reason for hiding this comment

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

Possibly add illustrations for types of content here? Not always clear what it is, and when it's clear, an illustration can help visualize the sizes

#### Example 1

The <control>Rename Inheritors</control> dialog has a table with FQNs. Add 350&nbsp;px as the minimum width for a table column. This will make the dialog wider than the recommended 500&nbsp;px but will show more of FQNs.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Possibly show sizes on the image here? Will also help understanding how the correct example differs from the acceptable

<tr>
<td width="706">
<format color="DarkOrange" style="bold">Acceptable</format>
<img src="dialog_popup_sizes_example_3_acceptable.png" alt=""/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the "Acceptable" example based on some sizing rules? Unclear how these paddings were chosen

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You're right. I should've written here that it's the default XS size


Some components, for example, <control>tables</control>, can have an [empty state](empty_state.md) when there is no content. In this case, the minimum size depends on which state takes more space: the component with content or with an empty state.

In most cases, an empty state takes less space than the minimum size of a component. In other cases, the minimum size of the component should be determined by the size of the empty state to reduce unexpected resizing.
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. I'd suggest adding an example where the component size is defined by its empty state
  2. Possibly write explicitly the sizes of the table again here for this particular example — we take min width and height and get this empty state size

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.

2 participants