Public: anyone can read this; the crew can change it.

/explore sorts by freshness as well as use, chosen by a plain link and kept in the URL #13474

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

This adds only tests. /explore already did everything the issue asks, so the pull has test/explore-sort.test.ts and no code change. Already in place (from #13178 and #12343): ?sort= takes fresh and use along with the other sorts.

Notes

shipped production is serving it deploy 751373a

opened this

This adds only tests. /explore already did everything the issue asks, so the pull has test/explore-sort.test.ts and no code change.

Already in place (from #13178 and #12343): ?sort= takes fresh and use along with the other sorts. An unknown value gives the default order, a 200, and a plain "is not a sort" note. The Fresh and Use controls are plain server-rendered links in the "Sort and time" panel, and the active one is marked aria-current. The kind and filter links keep the sort, and the page needs no script.

New tests (4, all passing):

  • sort=fresh puts the newest ship first, with three apps seeded at known ship dates.
  • sort=use puts the most hours awake first, using the same three apps.
  • The active sort is marked, and the Use link from the fresh view keeps kind=app. The People link keeps sort=use.
  • sort=newest returns a 200, the default order, the note, and no sort marked as active.

The existing explore URL tests and tsc also pass. scripts/gate.ts --fix rewrapped comments in one file that I didn't touch, and I left that out of the commit.

I left the layout alone. The sort links stay inside the closed-by-default "Sort and time" panel, which opens when a sort is active. Moving them out would be a design change that wasn't asked for.

Try it: open /explore?kind=app&sort=fresh, or click Fresh or Use in "Sort and time". Run bun test test/explore-sort.test.ts for the tests.

🤖 Generated with Claude Code

Closes #13398

commented

This adds only tests. /explore already did everything the issue asks, so the pull has test/explore-sort.test.ts and no code change.

Already in place (from #13178 and #12343): ?sort= takes fresh and use along with the other sorts. An unknown value gives the default order, a 200, and a plain "is not a sort" note. The Fresh and Use controls are plain server-rendered links in the "Sort and time" panel, and the active one is marked aria-current. The kind and filter links keep the sort, and the page needs no script.

New tests (4, all passing):

  • sort=fresh puts the newest ship first, with three apps seeded at known ship dates.
  • sort=use puts the most hours awake first, using the same three apps.
  • The active sort is marked, and the Use link from the fresh view keeps kind=app. The People link keeps sort=use.
  • sort=newest returns a 200, the default order, the note, and no sort marked as active.

The existing explore URL tests and tsc also pass. scripts/gate.ts --fix rewrapped comments in one file that I didn't touch, and I left that out of the commit.

I left the layout alone. The sort links stay inside the closed-by-default "Sort and time" panel, which opens when a sort is active. Moving them out would be a design change that wasn't asked for.

Try it: open /explore?kind=app&sort=fresh, or click Fresh or Use in "Sort and time". Run bun test test/explore-sort.test.ts for the tests.

🤖 Generated with Claude Code

Approved

Test-only pull, and it is honest about that: /explore already does all of this. The preview confirms it. ?sort=fresh and ?sort=use are plain links, the kind links keep the sort, an unknown value gives 200 with "is not a sort — use score, forks, ships, likes, use, fresh, name", and no sort is marked. The four tests fail if the sort, the aria-current mark, or the link-keeping is removed. No new feature, so no TUI screen or docs page is owed. Two things I would do next: (1) the Fresh/Use links sit in the closed-by-default "Sort and time" panel, so on a 360px phone a person must open a panel to find them. Check the 44px tap target and consider showing the active sort outside the panel. (2) The test regexes match markup (<ul class="list">, <a> attribute order), so a harmless class rename breaks them. Anchor on a data attribute or role if the markup gets one.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs