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

Bugfixes and minor improvements #858

Merged
merged 19 commits into from
May 31, 2024
Merged

Bugfixes and minor improvements #858

merged 19 commits into from
May 31, 2024

Conversation

sarahfossheim
Copy link
Contributor

@sarahfossheim sarahfossheim commented May 16, 2024

Summary of the changes

Changed from reported bugfixes:

Additional changes:

  • Removing image placeholders
  • Hovers on the chart now also show corresponding symbol, and combine all data for the same date (eg both desktop and mobile)
  • Two different types of values in the pageweight summary within the timeseries: in bytes (as displayed on the line chart) + formatted (as used elsewhere)

Screenshots

Timezone San Francisco - main branch
Hover on a chart showing data for Jan 31st

Timezone San Francisco - changes
Hover on a chart showing data for Feb 1

Copy link
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

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

LGTM with one nit

Comment on lines 211 to 221
label.innerHTML = latest.technology;
if(latestValue) {
value.innerHTML = `${latestValue}${config.series.suffix || ''}`;
if(summary) {
value.innerHTML = `${summaryValue}`;
secondaryValue.innerHTML = `${latestValue}${config.series.suffix || ''}`;
} else {
value.innerHTML = `${latestValue}${config.series.suffix || ''}`;
}
} else {
value.classList.add('undefined');
value.innerHTML = 'No data';
Copy link
Member

Choose a reason for hiding this comment

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

Nit but we've recently discovered innerHTML (and innerText) is actually a bit slower than textContent.

It if really is just text (and I'm not sure if it always is), could we use textContent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So far it's only text, can update to textContent

src/js/techreport/utils/data.js Outdated Show resolved Hide resolved
client: 'desktop',
date: date,
},
mobile: {
...submetric.mobile,
median_bytes_formatted: submetric.mobile.median_bytes > 1024 ? `${Math.round(submetric.mobile.median_bytes / 1024)} KB` : submetric.mobile.median_bytes > 1048576 ? `${Math.round(submetric.mobile.median_bytes / 1048576)} MB` : `${submetric.mobile.median_bytes} bytes`,
Copy link
Member

Choose a reason for hiding this comment

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

Same comment. (should this conversion be moved to a reusable function?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, will move to a function in the utils 👍🏻

@@ -39,13 +39,15 @@ <h4>
<div class="breakdown-item">
<p class="breakdown-label">{{ breakdown.name }}</p>
<p class="breakdown-value">00{% if breakdown.suffix == "%" %}.00{% endif %}{{ breakdown.suffix }}</p>
<p class="breakdown-value-secondary"></p>
Copy link
Member

Choose a reason for hiding this comment

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

Is this only needed because the chart is always in bytes? TBH I don't love the redundancy and I think we can get away with only showing the formatted value. Alternatively, WDYT about stuffing the # of bytes into the title attribute of the formatted value?

image

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 removed it for now since the title comes with accessibility challenges and is easily overlooked anyway. If people need to hover to see the value they can just as well hover over the graph (which works with keyboard etc) 😄

If we get feedback that it's confusing that one is in MB/KB and the other one in bytes, then maybe we can add a custom (accessible) tooltip on the formatted values.

@sarahfossheim
Copy link
Contributor Author

@rviscomi updated :)

Copy link
Member

@rviscomi rviscomi left a comment

Choose a reason for hiding this comment

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

LGTM thanks!

@rviscomi rviscomi merged commit d337ba9 into main May 31, 2024
13 checks passed
@rviscomi rviscomi deleted the cwvtech-bugfixes branch May 31, 2024 23:38
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.

None yet

3 participants