Skip to content

Conversation

@tzi
Copy link
Contributor

@tzi tzi commented Oct 20, 2025

Description:

The old modal design had 2 big responsive design:

  • In tiny devices, the content overflows horizontally
  • When resizing our screen (or rotating our device) the design wasn’t updated: modal not centered and sometimes off-screen.
  • When the content was updated, the design wan’t updated either: modal not centered and sometimes content hidden behind a scroll

Plugin/Submodule update

1 PR is open in plugin/submodule to update UI screenshots:

Visits log | desktop

ℹ️ Better vertical centering, and more intuitive scroll

before after
Screenshot 2025-10-20 at 16 08 06 Screenshot 2025-10-20 at 16 06 03

Visits log | mobile

ℹ️ No content outside of the screen.

before after
Screenshot 2025-10-20 at 16 30 57 Screenshot 2025-10-20 at 16 25 43

Performance | desktop

ℹ️ Better vertical centering.

before after
Screenshot 2025-10-20 at 16 08 01 Screenshot 2025-10-20 at 16 05 55

Performance | mobile

ℹ️ Vertical centering always up to date

before after
Screenshot 2025-10-20 at 17 58 50 Screenshot 2025-10-20 at 17 56 04

Row evolution | desktop

ℹ️ No hidden content.

before after
Screenshot 2025-10-20 at 16 07 48 Screenshot 2025-10-20 at 16 06 09

Row evolution | mobile

ℹ️ Vertical centering always up to date

before after
Screenshot 2025-10-20 at 17 58 59 Screenshot 2025-10-20 at 17 56 26

Review

// doesn't center the modal.g
var self = this;

// doesn't center the modal.
Copy link
Contributor Author

@tzi tzi Oct 20, 2025

Choose a reason for hiding this comment

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

ℹ️ Typo.

// sometimes the modal can be displayed outside of the current viewport, in this case
// we scroll to it to make sure it's visible. this isn't a perfect workaround, since it
// doesn't center the modal.g
var self = this;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Variable not used. That was already he case before my development.

Comment on lines -111 to -121
var centerPopover = function () {
if (container !== false) {
$('.ui-dialog').css({margin: '0 0'});
container.dialog("option", "position", {my: 'center', at: 'center', of: '.ui-widget-overlay', collision: 'fit'});
// in some cases jQuery UI fails to place the dialog correctly and set the top values to something negative
if ($('.ui-dialog').position().top < 0) {
$('.ui-dialog').css('top', '0');
}
$('.ui-dialog').css({margin: '15px 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.

ℹ️ I was able to keep a perfect centering in pure CSS, so I removed this calculation. Since the width/height measurement is blocking the browser, it is a performance gain.


@media (max-width: 600px) {
padding: 15px;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Remove the left padding that was here to display the icon. Make it smaller in the same time

display: block;
margin-bottom: 0.5em;
text-align: center;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Make the icon on top instead on the left of the message on mobile. It will take less space.

@media (max-width: 600px) {
position: static;
display: block;
}
Copy link
Contributor Author

@tzi tzi Oct 20, 2025

Choose a reason for hiding this comment

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

ℹ️ Avoid stacking the link on top of the content.

before after
Image Image

@tzi tzi requested a review from sgiehl October 20, 2025 14:51
@tzi tzi added Needs Review PRs that need a code review c: Design / UI For issues that impact Matomo's user interface or the design overall. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. labels Oct 20, 2025
@tzi tzi requested a review from a team October 21, 2025 12:52
z-index: 1001;
inset: 15px !important;
margin: auto;
width: min-content;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Tag Manager modals do not have explicit width defined with style attribute.
So we are setting a default width here, to keep a small modal in these cases.

@tzi tzi force-pushed the ux-287 branch 2 times, most recently from cfeda93 to e463739 Compare October 27, 2025 09:38
@tzi tzi force-pushed the ux-287 branch 9 times, most recently from 937cb7b to 6f2ed13 Compare October 28, 2025 08:36
@tzi tzi added Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. and removed Needs Review PRs that need a code review labels Oct 28, 2025
@tzi tzi force-pushed the ux-287 branch 3 times, most recently from 6009781 to 467cc66 Compare October 29, 2025 08:05
Comment on lines -6 to -8
width: calc(80%);
left: calc(10%) !important;
height: auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Overriding this breaks the automatic centering.

width: calc(80%);
left: calc(10%) !important;
height: auto;
background: #fafafa;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Replace this with a color from the theme

if (!$('#Piwik_Popover_Wrapper').length) {
$(document.createElement('div')).attr('id', 'Piwik_Popover_Wrapper').appendTo('body');
}
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ To center the modals AND to be sure there is no content off-screen, we need a wrapper. This wrapper is added to the document root if it is not already here.

@tzi tzi force-pushed the ux-287 branch 2 times, most recently from 50aeafc to 94ee552 Compare October 29, 2025 20:39
@tzi tzi added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c: Design / UI For issues that impact Matomo's user interface or the design overall. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review

Development

Successfully merging this pull request may close these issues.

2 participants