Skip to content

Insights: revamp dashboard design, add locale selector#4296

Open
functionzz wants to merge 7 commits into
mozilla:mainfrom
functionzz:insights_dashboard_design_edits
Open

Insights: revamp dashboard design, add locale selector#4296
functionzz wants to merge 7 commits into
mozilla:mainfrom
functionzz:insights_dashboard_design_edits

Conversation

@functionzz

@functionzz functionzz commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

This PR makes the following changes:

  • Add locale selector directly in /insights
  • Sharper design for dashboard

This PR adds the locale selector for the community health dashboard and chart directly into /insights and removes the /insights/config page in favor for a dynamic form solution. It also follows the updated dashboard design for community health score as follows:

image

It also changes the dashboard design to be more consistent with the implementations of the global graphs, by merging the dashboard with the community health graph and changing some button positioning:
image

Discussion is needed on whether we should switch to a live model for the current dashboard display, with CHS used for the month-over-month differential and the graph (it is expensive to calculate values for the tooltip, why not just extend it for the current month display?)

Fixes #4271.

@functionzz functionzz changed the title Insights: add locale selector to Insights page Insights: add locale selector to Insights dashboard Jul 8, 2026
@eemeli

eemeli commented Jul 14, 2026

Copy link
Copy Markdown
Member

Based on the name, this sounds related to #4265, but isn't, right?

@functionzz

functionzz commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Correct, it is not related to #4265. It is more generally related to design updates for the Insights Dashboard.

@functionzz functionzz changed the title Insights: add locale selector to Insights dashboard Insights: revamp dashboard design, add locale selector, contributor tooltip Jul 14, 2026
@mathjazz

Copy link
Copy Markdown
Collaborator

Add contributor tooltip upon metric hover

Since it requires further discussion, we should file a separate issue for this and remove the implementation from this PR.

@functionzz
functionzz force-pushed the insights_dashboard_design_edits branch from 16e8145 to a3cc686 Compare July 16, 2026 12:13
@functionzz functionzz changed the title Insights: revamp dashboard design, add locale selector, contributor tooltip Insights: revamp dashboard design, add locale selector Jul 16, 2026
@functionzz
functionzz requested a review from mathjazz July 16, 2026 15:03

@mathjazz mathjazz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work! Left some comments inline.

One more thing: it turns out the "Translators" table header is too long, because the sorting arrow overflows the cell when it appears. Can you shorten it to "Transl." and show a tooltip with the full name on hover?

Comment thread pontoon/insights/static/css/insights.css Outdated
Comment thread pontoon/insights/static/js/insights.js
Comment thread pontoon/insights/views.py Outdated
Comment thread pontoon/insights/static/js/insights.js Outdated
.toggleClass('fa-chevron-left', isHidden);

if (!isHidden && selectorChange) {
saveCommunityHealthLocales(true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If the locales are saved instantly on each change in the selector, why do you save them again here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Because saveCommunityHealthLocales also controls table regeneration if renderTable = true.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Right, and what I'm trying to say is that this feels odd. We should have two separate views to handle to separate actions.

@functionzz
functionzz requested a review from mathjazz July 17, 2026 15:28
@functionzz

Copy link
Copy Markdown
Collaborator Author

I removed $(function() {...}); not sure if you want to keep it defensively @mathjazz

@mathjazz mathjazz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry, looks like I forgot to include these two comments somehow.

Comment thread pontoon/insights/urls.py Outdated
Comment thread pontoon/insights/urls.py Outdated
Comment thread pontoon/insights/static/js/insights.js Outdated
.toggleClass('fa-chevron-left', isHidden);

if (!isHidden && selectorChange) {
saveCommunityHealthLocales(true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Right, and what I'm trying to say is that this feels odd. We should have two separate views to handle to separate actions.

@functionzz
functionzz requested a review from mathjazz July 17, 2026 18:18
@codecov-commenter

codecov-commenter commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.29268% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.43%. Comparing base (31f74c4) to head (575a880).
⚠️ Report is 13 commits behind head on main.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread pontoon/insights/urls.py Outdated
Comment thread pontoon/insights/static/js/insights.js Outdated
Comment thread pontoon/insights/static/js/insights.js Outdated
Comment thread pontoon/insights/static/js/insights.js Outdated
});
}

$(function () {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why did you add it back?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

So it seems $('body').on('click', '.multiple-item-selector .item.select li', function () { requires delegation.

I added it back to solve that. Now this time I brought all the other handlers to be direct binded, except the ones related to the multiple item selector.

Comment thread pontoon/insights/static/js/insights.js Outdated
@functionzz
functionzz requested a review from mathjazz July 17, 2026 21:01

@mathjazz mathjazz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Almost there!


function renderCommunityHealthPanel() {
$.ajax({
url: '/insights/ajax/render-table/',

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry, didn't notice this earlier. It's not just the table, it's also the chart:

Suggested change
url: '/insights/ajax/render-table/',
url: '/insights/ajax/render-panel/',

Please also update the URL pattern name and the view name.

Chart.getChart('community-health-chart')?.destroy();
$('.community-health-score-container').html(response.html);
Pontoon.insights.renderGlobalChart($('#community-health-chart'), 'chs');
Pontoon.endLoader('Locales updated.');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Actually, now we have to drop this line. If you switch between the panel and the locales config, you always get this message, even if you don't make any changes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I believe that was the original reason I had the selectorChange variable

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.

Insights dashboard: drop dashboard configuration page in favor for in page locale selection

4 participants