Skip to content

fix(prereq): accept zero-padded CalVer + align Setup card icons#90

Merged
graydawnc merged 1 commit intomainfrom
fix/prereq-calver-and-icon-alignment
Apr 15, 2026
Merged

fix(prereq): accept zero-padded CalVer + align Setup card icons#90
graydawnc merged 1 commit intomainfrom
fix/prereq-calver-and-icon-alignment

Conversation

@graydawnc
Copy link
Copy Markdown
Collaborator

Summary

Two fixes surfaced while onboarding a YouTube connector (yt-dlp).

1. Zero-padded CalVer broke prereq detection

prerequisites.ts handed the detected version string straight to semver.valid(). yt-dlp uses CalVer like 2026.03.17 — semver disallows leading zeros in numeric segments, so even though the regex matched, the checker returned "Could not parse detected version" and the prereq sat in an error state forever. Same trap would bite any CalVer-padded dep (Ubuntu, Postgres, many Python packages).

Fix: strip leading zeros from numeric segments before valid() / gte(). Ordering is preserved, existing semver-shaped inputs unchanged.

2. Setup card status icon drifted below the label row

The prereq row used items-center. When a prereq had a hint below the label (error/outdated cases), the status icon centered against the full two-line height and visually floated down between the label and the hint. Same for the right-side action button.

Fix: items-start on the row + fixed-height wrappers around the icon / action so they sit at the first-line center.

Test plan

  • Added two unit tests for zero-padded CalVer (accept 2026.03.17, still mark 2024.02.05 as outdated vs 2024.03.01)
  • Full prereq test suite passes (13 tests)
  • Manual end-to-end: fresh install of @graydawnc/connector-youtube on dev box → yt-dlp detection now resolves to ok with 2026.03.17 displayed
  • Status icon + action button visually aligned to label-line center in the rebuilt app

🤖 Generated with Claude Code

…rst line

Prereq checker used semver.valid() directly, which rejects zero-padded
CalVer like yt-dlp's 2026.03.17 (semver disallows leading zeros in any
numeric segment). Detection landed on "Could not parse detected version"
even when the regex matched the output. Normalize by stripping leading
zeros from numeric segments before handing to semver — ordering is
preserved and existing semver-shaped versions are unaffected.

Also in the Setup card, switch the row from items-center to items-start
and wrap status + action icons in fixed-height spans so they sit at the
first-line center instead of being centered against (label + hint),
which visually drifted downward whenever a prereq had a hint below the
label (e.g. error cases).

Discovered while onboarding @graydawnc/connector-youtube — yt-dlp hit
both issues at once.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@graydawnc graydawnc merged commit ce79018 into main Apr 15, 2026
3 checks passed
@graydawnc graydawnc deleted the fix/prereq-calver-and-icon-alignment branch April 15, 2026 08:47
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.

1 participant