Skip to content

feat(check): offer README badge in clean verdict and add plain-text share button - #225

Merged
patrickballard merged 5 commits into
wheelgap:mainfrom
dev-burnern:feat/clean-verdict-badge-and-share-text
Nov 22, 2026
Merged

patrickballard merged 5 commits into
wheelgap:mainfrom
dev-burnern:feat/clean-verdict-badge-and-share-text

Conversation

@dev-burnern

Copy link
Copy Markdown
Contributor

Closes #207

What this changes

  • site/check/index.html & site/check/check.css:
    • Adds a #verdict-badge block inside <section class="verdict-card"> (hidden by default) with the line "Keep it that way: add the check to your README", the static badge.svg image, and a "Copy badge Markdown" button (#copy-verdict-badge).
    • Adds a "Copy result as text" button (#copy-share) next to "Copy link to this result", and keeps the existing #badge section in <section class="cta"> intact.
  • site/check/check-logic.mjs:
    • Adds shareText(repoName, headline, pythons, platforms, url) to build a single-line plain-text summary (never HTML) ending with the share link, handling clean results (with ✓), gaps, unknowns (no ✓), single targets, empty checks, and verbatim special characters in repo names.
  • site/check/check.mjs:
    • Shows #verdict-badge in renderVerdict() only when the result is clean (gaps === 0, unknown === 0, targets > 0, packages > 0), and hides it in hideResultSections(true).
    • For clean results, renames the bottom section heading (#next-title) from "Fix it" to "Keep it green" and hides the fix-prompt button (#copy-prompt) and its note (#prompt-note).
    • Wires both #copy-verdict-badge and #copy-share through copy() like the existing buttons (both are native <button type="button" class="action"> elements, so keyboard activation and focus styles work out of the box).
  • tests/site/check-logic.test.mjs & tests/site/check-page.test.mjs:
    • Tests shareText() across clean, gaps, unknowns (verifying no ✓), single target/platform, empty check, and HTML special characters in repo names.
    • Tests that #verdict-badge is shown in the verdict card for clean results and hidden for gaps, unknowns, or 0 packages, that #next-title switches to "Keep it green" and hides the fix prompt on clean results, and that both new copy buttons use copy().

Screenshots

(Attach the 4 captured screenshots from local scratch when submitting or via GitHub drag-and-drop: tracker-207-clean-light.png, tracker-207-clean-dark.png, tracker-207-gaps-light.png, tracker-207-gaps-dark.png.)

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

Checklist

  • node --check passes on all site scripts
  • node --test tests/site/*.test.* passes (149/149)
  • Tested clean and gaps views in light and dark mode

dev-burnern and others added 2 commits November 22, 2026 16:25
Pythons the lockfile leaves out aren't counted, so the clean line must not
claim a wheel for them. Building the lists from the result's own targets also
keeps a pending check's new selection out of the old result's line.

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

Copy link
Copy Markdown
Contributor

Thanks, @dev-burnern! This is a nice, careful piece of work: the badge block is reset on every path that hides the result, and the shareText() tests cover the unknowns case so it can never carry a ✓.

We've made this change so it can go in:

  • The share line now names only what the shown result actually counted. It used to list state.pythons and state.platforms. That gave two wrong ✓ claims. If the lockfile's requires-python leaves out a Python you picked (outside_lock), the line still claimed wheels on it. And if you clicked a new platform or Python chip, the old result's line named the new selection while that check was still running. The line is now built from the result's own targets minus outside_lock, with a test in check-page.test.mjs.

There's one open question, so Patrick will take a final look before merging. When some packages weren't checked (a private index, or skipped names), the clean verdict, the new badge offer and the "✓ all N dependencies" line still read as fully clean. Patrick will decide whether those cases should drop the ✓ or say how many weren't checked.

(Review assisted by Claude.)

patrickballard and others added 3 commits November 22, 2026 11:07
The copied line travels without the page's alerts. With packages left off pypi.org as a private index's, it read "✓ all N dependencies have a wheel" although those weren't checked. It now says how many weren't checked and drops the ✓; a result with none reads as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… went unchecked

With packages left off pypi.org as a private index's, a result with no gaps and nothing unknown still offered "Keep it that way: add the check to your README" and the "Keep it green" heading, as if those packages had passed. Both now need r.private to be empty too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolved as the second review set out. renderVerdict() sets isClean, toggles the card, hides the README badge offer unless the result is clean with no private-index packages, then uses wheelgap#223's verdict ternary (private pyproject, every Python left out, verdictText). renderNext() keeps wheelgap#225's Keep it green condition (r.private empty) with main's badge default from wheelgap#226/wheelgap#229 untouched. The copy-share handler, with the private count that drops the ✓, sits beside main's copy-prompt handler, which passes state.lab (wheelgap#231). Imports are the union, with shareText. Tests: both sides kept; wheelgap#225's renderVerdict/renderNext harness given autoPick and privatePyprojectReason.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@patrickballard
patrickballard merged commit b45adad into wheelgap:main Nov 22, 2026
1 check passed
@patrickballard

Copy link
Copy Markdown
Contributor

Merged, thanks @dev-burnern! That is everything of yours on the tracker except #233, which goes in next, on top of a privacy fix to the same code (#235). We pushed a few fixes to the branches before merging; the commits say what and why.

If you would like another: wheelgap/wheels#47 is a small one (tests for the check that a recipe linked its library statically), and nobody has it yet.

(Posted with help from Claude.)

patrickballard added a commit that referenced this pull request Nov 22, 2026
Brings in #231 and #225. The import lists conflicted; #225's badge test now passes privateText to renderVerdict, which calls it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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: on a clean result, offer the README badge and a share line right under the green verdict

2 participants