diff mbox series

[1/1] support/scripts/pkg-stats: fix bug when sorting by hashfile

Message ID 20240225220544.754965-1-sen@hastings.org
State Accepted
Headers show
Series [1/1] support/scripts/pkg-stats: fix bug when sorting by hashfile | expand

Commit Message

Sen Hastings Feb. 25, 2024, 10:05 p.m. UTC
Because the div_class variable was not reassigned a value,
cells in the latest_version column were still being assigned
hash_file classes and so were being picked up as elements in
the hash_file sort. This lead to execessive grid gap elements
stacking up and creating huge blank spaces at the top of the page.
This is very noticable on pages with a large number of packages,
like the ones the autobuilder creates.

original behaviour(click the "Hash file" column label twice):
http://autobuild.buildroot.org/stats/master.html

demo of fixed behaviour:
https://sen-h.codeberg.page/pkg-stats-demos/@pages/fix-bug-when-sorting-by-hash-file.html

Signed-off-by: Sen Hastings <sen@hastings.org>
---
 support/scripts/pkg-stats | 1 +
 1 file changed, 1 insertion(+)

Comments

Arnout Vandecappelle April 7, 2024, 4 p.m. UTC | #1
On 25/02/2024 23:05, Sen Hastings wrote:
> Because the div_class variable was not reassigned a value,
> cells in the latest_version column were still being assigned
> hash_file classes and so were being picked up as elements in
> the hash_file sort. This lead to execessive grid gap elements
> stacking up and creating huge blank spaces at the top of the page.
> This is very noticable on pages with a large number of packages,
> like the ones the autobuilder creates.
> 
> original behaviour(click the "Hash file" column label twice):
> http://autobuild.buildroot.org/stats/master.html
> 
> demo of fixed behaviour:
> https://sen-h.codeberg.page/pkg-stats-demos/@pages/fix-bug-when-sorting-by-hash-file.html
> 
> Signed-off-by: Sen Hastings <sen@hastings.org>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   support/scripts/pkg-stats | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats
> index 9307992d29..9ba356cb7c 100755
> --- a/support/scripts/pkg-stats
> +++ b/support/scripts/pkg-stats
> @@ -977,6 +977,7 @@ def dump_html_pkg(f, pkg):
>   
>       # Latest version
>       data_field_id = f'latest_version__{pkg_css_class}'
> +    div_class = ["centered"]
>       div_class.append(f'_{pkg_css_class}')
>       div_class.append("latest_version data")
>       if pkg.latest_version['status'] == RM_API_STATUS_ERROR:
diff mbox series

Patch

diff --git a/support/scripts/pkg-stats b/support/scripts/pkg-stats
index 9307992d29..9ba356cb7c 100755
--- a/support/scripts/pkg-stats
+++ b/support/scripts/pkg-stats
@@ -977,6 +977,7 @@  def dump_html_pkg(f, pkg):
 
     # Latest version
     data_field_id = f'latest_version__{pkg_css_class}'
+    div_class = ["centered"]
     div_class.append(f'_{pkg_css_class}')
     div_class.append("latest_version data")
     if pkg.latest_version['status'] == RM_API_STATUS_ERROR: