Skip to content

feat(check): show helpful hints for package names and non-GitHub URLs - #227

Merged
patrickballard merged 4 commits into
wheelgap:mainfrom
dev-burnern:feat/repo-checker-input-hints
Nov 22, 2026
Merged

patrickballard merged 4 commits into
wheelgap:mainfrom
dev-burnern:feat/repo-checker-input-hints

Conversation

@dev-burnern

Copy link
Copy Markdown
Contributor

Closes #213

What this changes

  • site/check/check-logic.mjs:
    • Adds inputHint(text) to classify rejected repo-checker inputs:
      • { kind: "package", name } (canonicalized via canonicalName()) for a single valid PyPI package name;
      • { kind: "other-host", host } for HTTP(S) or SSH URLs on a host other than github.com;
      • null for everything else (GitHub repos, empty strings, spaces, HTML characters).
  • site/check/check.mjs:
    • Updates status() to accept either a plain string or an array of DOM nodes/strings via replaceChildren(), keeping role="status" and aria-live="polite" intact and never using innerHTML.
    • Adds showInputError(raw) used by both the form submit handler and invalid ?repo= query values:
      • Package name: links to ../p/<canonical>/ ("See its wheel coverage") and ../ ("search packages"), inserting the typed name as a text node.
      • Non-GitHub host: explains that the page reads public GitHub repositories only and suggests uvx wheelgap with a link to getting started.
      • Otherwise keeps the existing error message.
  • tests/site/check-logic.test.mjs & tests/site/check-page.test.mjs:
    • Covers inputHint() (numpy, Pillow, ruamel.yaml, GitLab/Codeberg URLs, owner/repo, empty, spaces, <) and showInputError() DOM node construction and role="status" preservation.

AI tools used (if any): Antigravity (Gemini)

Checklist

  • node --check site/check/*.mjs passes
  • node --test tests/site/check-logic.test.mjs tests/site/check-page.test.mjs passes (38/38)

dev-burnern and others added 2 commits November 22, 2026 16:40
- A hint from ?repo= (or one typed while Python loads) was replaced by the
  worker's start-up progress and Ready lines; it now stays until a check starts.
- Bare domains (gitlab.com), scheme-less host URLs, ssh:// and git+https://
  remotes get the other-host hint; GitHub's own hosts (raw, api, gist) keep the
  default message.
- The getting-started link goes to docs/getting-started.md, as wheelgap#213 asks.
- Long echoed names wrap in the status line on a phone.
- Tests pin the wiring to the form, ?repo= and the worker messages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@patrickballard

Copy link
Copy Markdown
Contributor

Thanks, @dev-burnern! Building the hints from text nodes and el() links, with the name canonicalised and encoded before it goes into the ../p/ link, is exactly right, and role="status" stays intact.

We've made these changes so it can go in:

  • The ?repo= hint now stays on screen. It was shown before Python had loaded, and the worker's start-up progress lines and "Ready." then replaced it (the same happened to a hint typed while Python was loading). It now stays until a check starts, and the test checks that wiring.
  • More inputs get the right hint. A bare gitlab.com or codeberg.org used to read as a package called gitlab-com. gitlab.com/owner/project with no scheme, ssh:// and git+https:// remotes got the flat message. And GitHub's own hosts (raw.githubusercontent.com, api.github.com, gists) were told "GitHub repositories only". All of these are now covered in inputHint() tests.
  • The getting-started link goes to docs/getting-started.md, as Repo checker: a package name or a GitLab URL in the box gets "That doesn't look like a GitHub repository" #213 asks.
  • A long typed name wraps in the status line instead of widening the page on a phone.

It'll merge once a final review passes.

(Review assisted by Claude.)

- parseRepo() rejects an owner with a dot (GitHub names have none), so
  "gitlab.com/owner/project" gets the other-host hint instead of a check
  of github.com/gitlab.com/owner.
- pypi.org/project/NAME gets the package hint.
- Only known forges' bare domains count as hosts, so dotted package
  names like jaraco.net get the package hint.
- An unreadable @ref error also survives start-up progress lines.
- Tests: every hinted input is one parseRepo() rejects.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@patrickballard

Copy link
Copy Markdown
Contributor

Thanks again, @dev-burnern! The final review turned up one more case, so we've made these changes so it can go in:

  • gitlab.com/owner/project (no https://) now gets the host hint. parseRepo() accepted it as a GitHub repo owned by gitlab.com, so the page checked github.com/gitlab.com/owner instead of showing the hint. GitHub user and org names can't contain dots, so parseRepo() now rejects a dotted owner.
  • pypi.org/project/numpy links to numpy's coverage page, instead of the "run uvx wheelgap" hint.
  • Only known forges' bare domains count as hosts, so dotted package names such as jaraco.net get the package hint.
  • The "branch or tag name" error stays on screen while Python loads, like the hints.
  • A test now checks that every input with a hint is one parseRepo() rejects.

It'll merge once a final review passes.

(Review assisted by Claude.)

@patrickballard

Copy link
Copy Markdown
Contributor

Thanks, @dev-burnern! The final review of our last changes found nothing that needs fixing: the hints are still built from text nodes, the role="status" region still announces, and a dotted owner is now refused. This looks ready. Its CI run is waiting for approval, so Patrick will approve that and merge it.

(Review assisted by Claude.)

@patrickballard
patrickballard merged commit 5f72598 into wheelgap:main Nov 22, 2026
1 check passed
patrickballard added a commit to dev-burnern/tracker that referenced this pull request Nov 22, 2026
Conflicts with wheelgap#227 resolved by keeping both: the imports are the union (inputHint and pickRequestedFile in check.mjs; inputHint, pickRequestedFile, isReadableFile and fileKind in the logic tests), and both PRs' appended tests are kept. start() keeps wheelgap#227's inputError reset first and wheelgap#226's fileNotice reset and named file; parseRepo() keeps wheelgap#227's dotted-owner refusal with wheelgap#226's file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
patrickballard added a commit to benjibunbun/tracker that referenced this pull request Nov 22, 2026
One conflict, in tests/site/check-page.test.mjs, where both sides appended tests: both kept (wheelgap#223's resultPage tests, then wheelgap#226's blob-link and wheelgap#227's hint tests). check.mjs, check-logic.mjs and driver.py merged without conflict: onResult() keeps the all-private fallback with its folder filter before wheelgap#226's fallback notice, renderVerdict() has both the private-pyproject verdict and the named-file notice, and driver.py has private_count with the reader-based offline check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@patrickballard

Copy link
Copy Markdown
Contributor

Merged, thanks @dev-burnern! We pushed a few fixes to your branch before merging; the commits say what and why.

(Posted with help from Claude.)

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.

Repo checker: a package name or a GitLab URL in the box gets "That doesn't look like a GitHub repository"

2 participants