Skip to content

Add sort options to Contributing Open Issues page#1755

Merged
makermelissa merged 3 commits intoadafruit:mainfrom
makermelissa-piclaw:add-sort-options-contributing
Apr 15, 2026
Merged

Add sort options to Contributing Open Issues page#1755
makermelissa merged 3 commits intoadafruit:mainfrom
makermelissa-piclaw:add-sort-options-contributing

Conversation

@makermelissa-piclaw
Copy link
Copy Markdown
Contributor

@makermelissa-piclaw makermelissa-piclaw commented Apr 15, 2026

Summary

Adds a Sort by dropdown to the /contributing/open-issues page, allowing users to sort open issues by age.

Live page: https://circuitpython.org/contributing/open-issues

Sort options:

  • Default — server-rendered order (alphabetical by library name)
  • Newest first — issues with the fewest open days appear first
  • Oldest first — issues with the most open days appear first

Sorting is parsed from the (Open X days) text already present in each issue title from the libraries JSON feed. Both issues within each library and the library groups themselves are sorted.

Features:

  • Sort and label filter selections are preserved in URL query parameters (?sort=newest&label=bug)
  • State is restored on page load and browser back/forward navigation
  • Switching back to "Default" restores the original server-rendered order
  • Filter and sort work together — you can filter by label and sort by age

Changes:

File What changed
contributing/open_issues.html Added sort dropdown, gave label filter an id for cleaner JS targeting
assets/javascript/contributing.js Rewrote to support both label filtering and age-based sorting with original order restore
assets/sass/pages/_contributing.scss Added flexbox layout for filter/sort controls row

Screenshots

The sort dropdown appears inline next to the existing label filter:

Filter by issue labels [All ▾]    Sort by [Default ▾]

Fixes #645

Add a 'Sort by' dropdown to the Open Issues tab on the /contributing
page, allowing users to sort issues by:
- Default (server-rendered order)
- Newest first (fewest open days)
- Oldest first (most open days)

Sorting works by parsing the '(Open X days)' text already present in
each issue title. Both issues within each library and the libraries
themselves are sorted. Sort and filter selections are preserved in
URL parameters and restored on page load / back button.

Changes:
- contributing/open_issues.html: Add sort dropdown, add id to label
  filter select for cleaner JS targeting
- assets/javascript/contributing.js: Rewrite to support both label
  filtering and age-based sorting with original order restore
- assets/sass/pages/_contributing.scss: Add flexbox layout for the
  filter/sort controls

Fixes adafruit#645
@makermelissa-piclaw
Copy link
Copy Markdown
Contributor Author

Closing — changes will be submitted from the maintainer's fork instead.

Simplify sorting by reading days_open from the issue data via a
data attribute on each li element, replacing the regex title parser.
Sort library groups alongside issues when using Newest/Oldest sort.
Libraries are ordered by their best matching issue (min days for
newest, max days for oldest). Default restores alphabetical order.

- Add id='libraries-list' to top ul for reliable targeting
- Add getBestDays() helper to find representative issue age per library
- Restore both library and issue order when switching back to Default
@makermelissa makermelissa reopened this Apr 15, 2026
Copy link
Copy Markdown
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

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

Tested and it's working well.

@makermelissa makermelissa merged commit 8493f17 into adafruit:main Apr 15, 2026
4 checks passed
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.

Add other sorting options to the /contributing page

2 participants