Repository navigation
Closed
Labels
Description
The checker's box takes owner/repo or a GitHub URL. Two things people type instead both get the same flat answer and nowhere to go:
- A package name. Someone who arrives from a search for "numpy windows arm wheel" types
numpy. - A repository somewhere else:
https://gitlab.com/owner/projector a Codeberg URL.
That doesn't look like a GitHub repository. Try owner/name or a github.com URL.
The tracker has an answer for the first one, one click away: a page for each of the top 5,000 packages (../p/numpy/), and a search on the home page. For the second, the command line reads any checkout. The page mentions neither.
Where
site/check/check.mjs: the form'ssubmithandler callsparseRepo(text)and, when it returnsnull,status("That doesn't look like ...", true).site/check/check-logic.mjs:parseRepo(), andcanonicalName()for package names.status()sets text. A link needs elements (el("a", ...)), as the page builds its other links.
What to do
- Add
inputHint(text)tocheck-logic.mjs. It returns one of:{kind: "package", name}when the text is a single word that is a valid package name (letters, digits,.,_,-; no/), withnamefromcanonicalName();{kind: "other-host", host}when it's a URL on a host other than github.com;nullotherwise.
- In the handler, when
parseRepo()fails:- package: "numpy looks like a package, not a repository. See its wheel coverage" with a link to
../p/numpy/, "or search packages" with a link to../. The package page may not exist (outside the top 5,000); link it anyway, since the site's not-found page offers the search. - other host: "This page reads public GitHub repositories only. For a GitLab or other checkout, run
uvx wheelgapin it" with a link to the docs' getting-started page. - otherwise today's message.
- package: "numpy looks like a package, not a repository. See its wheel coverage" with a link to
- Build the message with elements and text nodes. The name comes from the box: never put it into HTML as a string.
?repo=in the URL goes through the same handler; make sure a bad value there gets the same hints.
Done when:
-
tests/site/check-logic.test.mjscoversinputHint():numpy,Pillow(canonicalpillow),ruamel.yaml, a GitLab URL, a Codeberg URL,owner/repo(null: it's a repo), an empty string, and text with spaces or<. -
tests/site/check-page.test.mjsshows the package message has a link to../p/numpy/and that a name is inserted as text. - The status region still announces the message to a screen reader (
role="status"is kept). - The PR has a screenshot of each message.
Activity
Keep the input hint on screen and recognise more host inputs
Repo checker: helpful hints for package names and non-GitHub URLs (wh…