Dev#3
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| @@ -712,7 +799,10 @@ function updatePrimaryDownloadCtas(primaryOption: DownloadOption, platformLabel: | |||
| }); | |||
There was a problem hiding this comment.
🔴 CTA footnote is never updated with real release data due to stale DOM text detection
After the refactor, the footnote text is now dynamically generated from release data. However, the first call applyDownloadUi(buildDownloadOptions([]), ...) at apps/web/src/routes/index.tsx:1173 renders with empty releases, producing a footnote like "macOS Beta soon - Windows Beta soon - Linux Beta soon - MIT License". When the real release data arrives and applyDownloadUi(buildDownloadOptions(releases), ...) is called at line 1232, the footnote detection at line 796-798 searches for text.includes("MIT License") && text.includes("Requires macOS"). Since the first call already replaced the original HTML text (which contained "Requires macOS") with the dynamic string (which does not contain "Requires macOS"), the second call can never find the footnote element.
Root Cause and Impact
The detection predicate text.includes("Requires macOS") matches only the original static HTML content. After updatePrimaryDownloadCtas runs once, the text is overwritten to a format like "macOS Beta soon - ... - MIT License" which no longer contains "Requires macOS". This was harmless in the old code because the replacement was a hardcoded string ("macOS - Windows Beta - Linux Beta soon - MIT License") that was always the same regardless of actual release data. But this PR changed the footnote to be dynamically generated from getPlatformTrackSummary(), so the first call (with empty options showing everything as "Beta soon") permanently sets incorrect availability information that the second call (with real data) can never correct.
Actual: Footnote permanently shows "macOS Beta soon - Windows Beta soon - Linux Beta soon - MIT License" even after real release data loads.
Expected: Footnote updates to reflect actual availability, e.g. "macOS Stable - Windows Beta - Linux Beta soon - MIT License".
(Refers to lines 796-799)
Was this helpful? React with 👍 or 👎 to provide feedback.
bettter