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

Category dashboard with collapsible filters #934

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

sarahfossheim
Copy link
Collaborator

@sarahfossheim sarahfossheim commented Sep 24, 2024

New features

  • New compact header only used on the tech report pages
  • Sidebar with filters, instead of big card on top of the page
  • Prototype of the categories page:
    • Category level summary: number of origins and number of technologies within a category
    • Table with summarising info on all techs within that category
    • Possibility to click through to a specific tech, or compare multiple (or all) technologies within the tech
    • Prototype sortable table functionality (not in the UI yet)
    • /reports/techreport/category
  • Only one view for both drilldown and comparison view
    • Add more technologies to compare in the sidebar
    • New template loads depending on the amount of techs selected
    • See /reports/techreport/tech

(Visual) Improvements

Bugfixes

  • Updates to the responsiveness/zoom (more improvements to come in future PR)
  • The placeholder bright yellow color used for debugging WordPress line changed to color with enough contrast
  • Updated copywriting for some section (more improvements to come in future PR)
  • Fixed keyboard order for the points on comparison graphs (it was reversed)
  • Geo & Rank are remembered between categories and technology dashboard
  • Sort table alternatives from recent to old (Tech Report: The table data is not sorted #996)

Screenshots

Technologies

One technology

Technology drill down view with 'All technologies' selected from the filter sidebar. The page shows 4 summary cards (latest CWVs, LH performance, LH accessibility, and page weight)

Multiple technologies

Desktop

Desktop version of the comparison view: filter sidebar on the left showing all techs, wordpress, wix, eleventy, and a comparison table on the right. The nav in the header has items: HttpArchive logo, all reports, tech report, technologies, categories

Mobile

Mobile version of the comparison view: the site navigation is hidden behind a hamburger icon, the filters are collapsed into a top navigation bar as well

Categories

Cateogries page with CMS selected from the filters. There's a card showing # of origins and # of technologies within the category, and underneath there's a summary table

src/js/components/filters.js Fixed Show fixed Hide fixed
src/js/techreport/index.js Fixed Show fixed Hide fixed
@rviscomi rviscomi marked this pull request as draft October 9, 2024 13:47
@sarahfossheim sarahfossheim marked this pull request as ready for review November 4, 2024 23:04
@sarahfossheim sarahfossheim changed the title [WIP] Category dashboard with collapsible filters Category dashboard with collapsible filters Dec 4, 2024
@rviscomi rviscomi requested a review from tunetheweb December 4, 2024 15:14
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.

Staged here and left a bunch of feedback: https://technology-report-dot-httparchive.uk.r.appspot.com/reports/techreport/category?geo=ALL&rank=ALL&category=CMS

I had to patch one bug to get it to work (the fix is in one of the comment suggestions) but otherwise these are all just feature requests. Great work!

src/js/techreport/tableLinked.js Outdated Show resolved Hide resolved

console.log(sortMetric);
if(sortMetric) {
this.dataArray = this.dataArray.sort((techA, techB) => {
Copy link
Member

Choose a reason for hiding this comment

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

I was able to work around the error below by filtering out empty arrays before sorting. Not sure if it's the best fix though.

Suggested change
this.dataArray = this.dataArray.sort((techA, techB) => {
this.dataArray = this.dataArray.filter(tech => tech.length).sort((techA, techB) => {

"type": "heading"
},
{
"key": "origins",
Copy link
Member

Choose a reason for hiding this comment

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

Values appear as 3222201 which can be harder to read. Could we format with commas, ie 3,222,201? It'd also be helpful for comparing values if the text in this column is right-aligned, like a spreadsheet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Formatted them with commas everywhere now

src/js/techreport/tableLinked.js Outdated Show resolved Hide resolved
});
}

this.dataArray.forEach(technology => {
Copy link
Member

Choose a reason for hiding this comment

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

I know we talked about pagination before, but I don't remember if we talked about performance improvements to the initial API requests.

So for example if we only want to show the top 10 technologies by default and we can assume that the categories API endpoint lists the technologies in descending popularity order, we could make requests to the other API endpoints with only those first 10 technologies as request params to improve performance a bit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created a follow-up issue for the pagination: #997

"type": "heading"
},
{
"key": "origins",
Copy link
Member

Choose a reason for hiding this comment

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

When filtering to the top 1k rank, I'm seeing technologies with "null" origin counts

https://technology-report-dot-httparchive.uk.r.appspot.com/reports/techreport/category?tech=&geo=ALL&rank=Top+1k&category=CMS

image

Comment on lines +50 to +54
// Sort techs by date to get the latest
const aSortedDate = techA.sort((a, b) => new Date(b.date) - new Date(a.date));
const bSortedDate = techB.sort((a, b) => new Date(b.date) - new Date(a.date));
const aLatest = aSortedDate[0];
const bLatest = bSortedDate[0];
Copy link
Member

Choose a reason for hiding this comment

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

"Latest" should be the same for all technologies. It's possible for a technology to exist at one point in the dataset and then disappear forever, but this would always compare that ancient technology against the latest versions of all other modern technologies.

For example, October CMS shows up at the top of the top 1k CMS list with 361 origins:

https://technology-report-dot-httparchive.uk.r.appspot.com/reports/techreport/category?tech=&geo=ALL&rank=Top+1k&category=CMS

image

But in the technology drilldown it's clearer that the most recent (and only) data point is from April 2022:

https://technology-report-dot-httparchive.uk.r.appspot.com/reports/techreport/tech?tech=October%20CMS&geo=ALL&rank=Top%201k

image

The expected behavior is for it to not appear on the Category page at all since it's not part of the latest dataset. That might also be a good reason to explicitly have a label like Latest data: 2024-11-01 at the top of this report, similar to the others.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using &start=latest in the requests on the categories dashboard now, which should result in only receiving techs with data for the latest month.

When testing the page from the example above (/reports/techreport/category?tech=&geo=ALL&rank=Top+1k&category=CMS), OctoberCMS no longer gets returned.

templates/techreport/templates/selector_tech.html Outdated Show resolved Hide resolved
<label for="categories_selector" class="tech">Category</label>
<div class="tech-input-wrapper">
{% set category_selected = tech_report_page.filters.category or tech_report_config.default_category %}
<select name="categories" class="tech" data-selected="{{ category_selected }}" id="categories_selector">
Copy link
Member

Choose a reason for hiding this comment

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

I'm finding the native<select>hard to use for such long lists of options. Do you have any thoughts on using a datalist instead? I like having the ability to start typing what I'm looking for and it can match any position in the value, whereas typing in a <select> only works if it's a prefix match, and the datalist also filters down the results to make it easier to find what you're looking for.

Here's a production example: https://chromestatus.com/metrics/feature/popularity

image

Maybe something to consider for the technologies inputs too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, agree some sort of text input is needed for those long dropdowns. I suggest doing it in a follow-up PR, so this one doesn't become even bigger to review? Should I create an issue for it?

Copy link
Member

Choose a reason for hiding this comment

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

Sure, thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

templates/techreport/category.html Show resolved Hide resolved
@sarahfossheim
Copy link
Collaborator Author

@rviscomi - I made a lot of updates based on the feedback you left, and created follow-up action items for the larger todos (sorting of the table f.ex) so those can go in a follow-up PR. Also fixed a few other things at the same time, like removing/replacing the placeholder texts and making the navigation responsive (hamburger menu).

So it's ready for re-review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants