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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ijs.tree
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,8 @@
<toc-element toc-title="Accessibility"/> <!--TODO-->
<toc-element toc-title="Dangerous Actions"/> <!--TODO-->
<toc-element topic="data_formats.md"/>
<toc-element toc-title="Default Values"/> <!--TODO-->
<toc-element toc-title="Default Values"/>
<toc-element topic="Dialog-and-popup-sizes.md"/> <!--TODO-->
<toc-element toc-title="Discoverability"/> <!--TODO-->
<toc-element topic="icons_style.md"/>
<!-- <toc-element topic="icons.md"/>-->
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
276 changes: 276 additions & 0 deletions topics/Dialog-and-popup-sizes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
<!-- 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


<link-summary>Guidelines on choosing the correct size when creating a dialog or a popup</link-summary>

Follow these guidelines to select the correct size when creating a dialog or a popup for IntelliJ-based products.

## Default sizes

### 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


![A preview of recommended window sizes for dialogs](dialog_popup_sizes.png){width="706"}

<note>When setting the default size for your dialog, it should be impossible to make it smaller.</note>

#### Extra small

Size: 350×250 px.

Best for: several components that are stacked vertically.

![The Rename dialog with two input fields, two checkboxes, and actions in the dialog footer. The components are stacked vertically in one column](dialog_popup_sizes_extra_small.png){width="706"}

#### Small

Size: 500×350 px

Best for:
* Multiple components with short labels that are divided into two columns.
* 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


![The Evaluate Expressions dialog that has two code snippets stacked vertically](dialog_popup_sizes_small.png){width="706"}

#### Medium

Size: 750×525 px

Best for:
* A full-width table with four or more columns.
* Two-column layout with an image or a video in any of the columns. In this case, the image or the video takes the most space.
eldar-jetbrains marked this conversation as resolved.
Show resolved Hide resolved
* Two-column layout with a code snippet or an input field with long text in any of the columns.
* Two code editors or snippets in a row.

For example, the <control>Run/Debug Configuration</control> dialog has a two-column layout with a tree in the first column and the list of controls with long texts in the second column:

![The Run/Debug Configuration dialog that has a two-column layout. There is a nvigation in the first column and the list of settings in the second column](dialog_popup_sizes_medium.png){width="706"}

#### Large

Size: 1000×700 px

Best for:
* Two-column layout with long names, code editor, code snippet.
* Three-or-more-column layout regardless of the content.

For example, <control>Code Style</control> settings for Java in the <control>Settings</control> dialog. The dialog has three columns with a table and a code snippet in different columns:

![The Code Style settings in the Settings dialog. The dialog has three columns with a table and a code snippet in different columns](dialog_popup_sizes_large.png){width="706"}

### Popup
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 examples of xs, s, m, l sizes of popups? To show how they use the same approach as dialogs?


Popups should have the same default sizes as dialogs, but unlike dialogs, they can have adaptive height. If the popup displays different amounts of content depending on the situation, adapt the popup size to the content on opening.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Possibly write there about width only? That is, width rules are the same as for dialogs but the height depends on the content

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hm, the width should also be adaptable for popups that are very small like a completion popup with name suggestions when you rename some symbol — it doesn't make sense to make it xs wide, it might be smaller.

So, the default width rules should be applied to popups that might have different width of content, like the regular completion popup when you write code, or the Show usages popup?

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.

I suggest the structure:

  • Popup
    • Min width
      • Popups should have the same default width as dialogs (also different examples here)
      • If the popup is smaller than XS, adapt the width based on the content inside (example: completion popup)
    • Min height
      • If the popup has different amount of content, adapt the height (example here but not Git brunches)
    • Max height
      • Default max limits (I'm going to figure this one out and add it later)


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, default max height for popups should be described here — some popups like SE have endless content but it doesn't make sense to take the whole height of the screen for this content, so there's a default max limit

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

Choose a reason for hiding this comment

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

It does not at the moment :( I'd suggest choosing another popup for an example here because readers might go and check how the VCS Widget popup is implemented, and they will see that its height doesn't adapt to the content


![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


When a user changes an adaptive popup’s size, the size is saved and the adaptivity becomes inapplicable.

### Tool windows

* Vertical tool windows should have the min size set to 250×500&nbsp;px.
* Horizontal tool windows should have the min size set to 500×250&nbsp;px.

The default sizes should be set for all the states of the <control>View Mode</control>.

<table style="none" border="false">
<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

</td>
</tr>
</table>

### Editor tabs

Place your content into a <control>tab</control> in the editor when there are three or more columns in a row with important information that needs to be shown.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure we could treat a tool window with side-by-side editor view as 3 columns. If you open the right tool window it becomes 4 columns?

Also, the 3-way merge is still in the dialog as it's too wide for the editor tab.


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 this part should be about editors only for now, not just any content, because cases when we place regular UI controls like the Settings dialog into the editor area are singular now, too early for a guideline

For example, the <control>Merge</control> functionality features a list of changes with actions in a tool window and two code editors with line numbers:

![The Merge functionality with a list of changes with actions in a tool window on the left and two code editors with line numbers in the editor tab on the right](dialog_popup_sizes_editor.png){width="706"}

## 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


### 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

1. Select how the content is displayed:

<table style="header-column">
<tr>
<td width="40%">
Table cell
</td>
<td>
<p>Width: min&nbsp;65&nbsp;px</p>
<p>Height for the whole table: min&nbsp;120&nbsp;px</p>
<p>Follow guidelines for table width</p>
</td>
</tr>
<tr>
<td width="40%">
Tree
</td>
<td>
Width: min 250&nbsp;px
</td>
</tr>
<tr>
<td width="40%">
Text area
</td>
<td>
<p>Width: min&nbsp;270&nbsp;px, max&nbsp;600&nbsp;px</p>
<p>Height: min&nbsp;55&nbsp;px</p>
<p>For size and placement follow the <a href="text_area.md" anchor="size-and-placement">text area</a> guidelines</p>
</td>
</tr>
<tr>
<td width="40%">
Diagram
</td>
<td>
A container with horizontal and vertical insets with 100&nbsp;px
</td>
</tr>
</table>

2. What type of content is used:

<table style="header-column">
<tr>
<td width="40%">
Class/test/file name
</td>
<td>
<p>Width: min&nbsp;250&nbsp;px</p>
</td>
</tr>
<tr>
<td width="40%">
URL/Path/FQN for class
</td>
<td>
<p>Width: min&nbsp;350&nbsp;px</p>
</td>
</tr>
<tr>
<td width="40%">
Class/test/file name + URL/Path/FQN for class
</td>
<td>
<p>Width: min&nbsp;400&nbsp;px</p>
</td>
</tr>
<tr>
<td width="40%">
Code snippet or editor
</td>
<td>
<p>Width: min&nbsp;400&nbsp;px</p>
<p>Height (when multiple lines): min&nbsp;120&nbsp;px</p>
</td>
</tr>
<tr>
<td width="40%">
Standalone text
</td>
<td>
<p>Width: min&nbsp;300&nbsp;px</p>
<p>Height (when multiple lines): min&nbsp;120&nbsp;px</p>
</td>
</tr>
</table>

3. Select the biggest size out of the two to add the minimal size to a component

#### 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

<table style="none" border="false">
<tr>
<td width="706">
<format color="369650" style="bold">Correct</format>
<img src="dialog_popup_sizes_example_1_correct.png" alt="The Rename Inheritors dialog has a minimum width set for each table column"/>
</td>
</tr>
<tr>
<td width="706">
<format color="DarkOrange" style="bold">Acceptable</format>
<img src="dialog_popup_sizes_example_1_acceptable.png" alt="The Rename Inheritors dialog has the Medium size as default"/>
</td>
</tr>
</table>

#### Example 2

<control>Settings</control> dialog has the default size 1000&nbsp;px. In the <control>Code Style settings for Java</control> set 400&nbsp;px as the minimal width of the code editor. This will make the dialog wider but will show more code

<table style="none" border="false">
<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

</td>
</tr>
<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

</td>
</tr>
</table>

#### Example 3

Add horizontal and vertical 100&nbsp;px insets inside the <control>Diagram</control> popup to make it adaptable to the different amounts of content inside

<table style="none" border="false">
<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

</td>
</tr>
<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

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

</td>
</tr>
</table>

## Empty state

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


<table style="none" border="false">
<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

</td>
</tr>
<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

</td>
</tr>
</table>