httparchive.org icon indicating copy to clipboard operation
httparchive.org copied to clipboard

Tech Report: Replicate sort functionality from IsMyHostFastYet.com

Open westonruter opened this issue 5 months ago • 5 comments

I'm looking to replicate IsMyHostFastYet.com (IMHFY) using Tech Report. A key feature of IMHFY is the ability to sort the results in different ways:

Image

Such sorting controls are absent from a similar view on the Tech Report:

Image

It would be able to sort by any of the columns, including origins, Good CWV, A11Y, and SEO. (It would also be useful to have Lighthouse score and Page weight here.)

Being able to sort by "Good CWVs" would be very helpful to "rank" hosts in terms of their performance. Additionally, IMHFY is presenting the hosts in terms of their TTFB whereas the Tech Report is showing CWV in the summary table. It would be useful to be able to change the "Good CWVs" column to present "Good TTFB" instead, in addition to perhaps being able to sort by "Average TTFB" and "Poor TTFB".

Such metric selection is available in the Core Web Vitals section below:

Image

But it isn't available in the Summary.

westonruter avatar Jun 27 '25 06:06 westonruter

I'm also noticing that the order of the technologies in the Summary table corresponds to the original order that they were selected. Being able to sort these alphabetically would be useful so that if they are to be presented alphabetically that the technologies don't have to be selected in alphabetic order initially.

westonruter avatar Jun 27 '25 06:06 westonruter

I did make a bookmarklet that applies the desired sort:

javascript:Array.from(document.querySelector('.table-ui-wrapper tbody').children).sort( ( a, b ) => parseInt(a.querySelector('td.cwv-cell').getAttribute('data-value')) - parseInt(b.querySelector('td.cwv-cell').getAttribute('data-value')) ).map((row) => document.querySelector('.table-ui-wrapper tbody').prepend(row))
Before After
Image Image

Although that's just one small piece here.

westonruter avatar Jun 27 '25 20:06 westonruter

Ignore this, was looking at the wrong screen. Raised that as a separate issue: https://github.com/HTTPArchive/httparchive.org/issues/1081

~@max-ostapenko can you look into how this could be done in the backend for the Categories screen since the pagination was done for performance reasons as we have a lot more technologies than IsMyHostFastYet.com had.

I guess we need extra URL params to define sort order (i.e. which column to sort by), and also client. Which might also find that bug you noted about the fact sort order is currently based on mobile origins now, even when on desktop.~

tunetheweb avatar Jun 30 '25 14:06 tunetheweb

@sarahfossheim can you look at how this could be done in the Comparison screen since that shouldn't require any API changes.

tunetheweb avatar Jun 30 '25 14:06 tunetheweb

See example where the technologies have been re-ordered so that the table is sorted by having good CWV.

westonruter avatar Oct 17 '25 21:10 westonruter