Redesign Message Dialog
Removes unwanted space and aligns message content & buttons to center
Before
After
Fixes : https://github.com/eclipse-platform/eclipse.platform.ui/issues/2929
Test Results
1 824 files ±0 1 824 suites ±0 1h 30m 39s ⏱️ - 7m 15s 7 918 tests ±0 7 690 ✅ +1 228 💤 ±0 0 ❌ - 1 23 841 runs ±0 23 093 ✅ +1 748 💤 ±0 0 ❌ - 1
Results for commit cd6224c7. ± Comparison against base commit e6eb975e.
As the discussion on the bug reveals, there is no obvious consensus to find between aligned left vs centered; however, all OSs recommend to get the width fit the content (ie no extra space), so I think for a first iteration, we should focus on just saving the extra space (changing the min width to 0 or DEFAULT), and consider whether to center or not later; maybe if all OSs align on the same recommendation some day.
Updated one
I'm seeing an issue with the given patch: the MessageDialog now tends to become too large:
Before
After
I'm seeing an issue with the given patch: the MessageDialog now tends to become too large:
Made minor adjustment for these cases
I asked our inhouse UX-Experts. This is what they say:
We would not recommend the centered alignment of dialog content in Eclipse – even for short texts like "Save ‘NAME.filetype‘?" – for several reasons:
- This dialog is displayed for only a few seconds and does not obscure any relevant content. Removing the empty line between the text and the buttons, as well as centering the text, worsens readability – we do not see any advantages in this approach.
- Left-aligned dialogs with right-aligned buttons are common desktop practices (e.g., Windows, macOS). Centered dialogs are more typical in mobile UIs where space is limited. On the desktop, space shouldn't be an issue.
- Prompts would wrap to two lines in the centered dialog quite easily. The current "airy issue" with short names could potentially turn into a "squeezed issue" with long names.
I asked our inhouse UX-Experts. This is what they say:
Thanks for checking ✨
@SougandhS So are you going to continue with some other ideas here or are you giving up on the idea (and the PR should be closed)?
@SougandhS So are you going to continue with some other ideas here or are you giving up on the idea (and the PR should be closed)?
I have a small idea.. [ Not sure everyone agrees :) ]
For small texts can we reduce the width a bit atleast ?
I have a small idea.. [ Not sure everyone agrees :) ] For small texts can we reduce the width a bit atleast ?
I have a small idea.. [ Not sure everyone agrees :) ] For small texts can we reduce the width a bit atleast ?
![]()
Where's the difference?
Where's the difference?
Before
after
and how does this change look for other dialogs?
and how does this change look for other dialogs?
Yes did checked one
Before
After
I don't see a clear benefit with this change. IMO, the desired format is https://github.com/eclipse-platform/eclipse.platform.ui/pull/2934#issuecomment-2826495220 and anything else is not worth being pursued. I don't know the details about why https://github.com/eclipse-platform/eclipse.platform.ui/pull/2934#issuecomment-2826495220 cannot be implemented reliably. Is it because changing the horizontal span is required? Aren't there alternative that can be found? eg is the 2 columns layout used because of image? If so, then couldn't we dynamically decide of the span or layout according to whether image is null or not?
eg is the 2 columns layout used because of image? If so, then couldn't we dynamically decide of the span or layout according to whether image is null or not?
I tried modifying IconAndMessageDialog.getColumnCount() to return 1, but the extra space remained regardless of Image. It only disappeared after I also updated data.horizontalSpan = 1 in MessageDialog.createDialogArea(Composite).
