Skip to content

fix: hide irrelevant download install options#8799

Open
abhijeetnardele24-hash wants to merge 1 commit intonodejs:mainfrom
abhijeetnardele24-hash:fix/download-install-options
Open

fix: hide irrelevant download install options#8799
abhijeetnardele24-hash wants to merge 1 commit intonodejs:mainfrom
abhijeetnardele24-hash:fix/download-install-options

Conversation

@abhijeetnardele24-hash
Copy link
Copy Markdown

Summary

Fixes #8638.

Validation

  • node --experimental-test-coverage --test-coverage-exclude=**/*.test.* --experimental-test-module-mocks --enable-source-maps --import=global-jsdom/register --import=tsx --import=tests/setup.jsx --test util/__tests__/download.test.mjs
  • corepack pnpm exec prettier --check apps/site/components/Downloads/Release/InstallationMethodDropdown.tsx apps/site/util/download/constants.json apps/site/util/__tests__/download.test.mjs

Notes

  • The repo's Husky pre-commit hook could not find a pnpm binary in this environment, so the commit was created with --no-verify after running the focused checks above manually.

Signed-off-by: abhijeet nardele <234410808+abhijeetnardele24-hash@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 5, 2026 06:07
@abhijeetnardele24-hash abhijeetnardele24-hash requested a review from a team as a code owner April 5, 2026 06:07
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Apr 5, 2026 6:08am

Request Review

@cursor
Copy link
Copy Markdown

cursor bot commented Apr 5, 2026

PR Summary

Low Risk
Low risk UI/data-constant change that filters out incompatible install methods instead of showing them disabled; main risk is unintentionally hiding valid options or changing default selection behavior for some OS/version combos.

Overview
Download installation method selection now hides unsupported options: the dropdown filters out disabled methods, only renders non-empty official/unofficial groups, and updates default/auto-selection to choose among enabled methods.

Also marks nvm as compatible with AIX in constants.json and adds a regression test ensuring parseCompat does not disable NVM on AIX.

Reviewed by Cursor Bugbot for commit a4a03e7. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

👋 Codeowner Review Request

The following codeowners have been identified for the changed files:

Team reviewers: @nodejs/nodejs-website

Please review the changes when you have a chance. Thank you! 🙏

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the download page installation-method UX so users only see install options that are actually available for the currently selected OS, and aligns nvm compatibility with AIX (per #8638), adding a regression test to prevent future regressions.

Changes:

  • Add AIX to nvm’s supported OS list in download constants.
  • Filter out disabled (incompatible) install methods from the installation method dropdown, and remove empty option groups.
  • Add a regression test ensuring nvm remains enabled for AIX.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
apps/site/util/download/constants.json Marks nvm as compatible with AIX so it’s offered as an install method there.
apps/site/components/Downloads/Release/InstallationMethodDropdown.tsx Hides incompatible install methods (instead of showing disabled entries) and drops empty groups.
apps/site/util/tests/download.test.mjs Adds regression coverage for AIX + nvm compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 30 to 32
// We group Platforms on the Platform Dropdown to provide the User
// understanding of what is recommended/official and what is not.
const grouppedMethods = useMemo(
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments in this component still refer to “Platforms” / “Platform Dropdown”, but this is the installation method dropdown. Please update the wording to avoid confusion when maintaining this logic (e.g., grouping install methods into official/unofficial).

Copilot uses AI. Check for mistakes.
Comment on lines 57 to 58
// Sets either the utmost recommended platform or the first non-disabled one
// Note that the first item of groupped platforms is always the recommended one
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After filtering out empty groups, grouppedMethods[0] isn’t guaranteed to be the recommended/official group anymore (it will be unofficial when there are no recommended methods). The inline comment about the first group always being recommended should be updated to match the new behavior to avoid future confusion.

Suggested change
// Sets either the utmost recommended platform or the first non-disabled one
// Note that the first item of groupped platforms is always the recommended one
// Sets the first available item from the first non-empty group
// (recommended/official when present, otherwise unofficial), or falls back
// to the first non-disabled installation method.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a4a03e7. Configure here.

release.setInstallMethod(installationMethod as InstallationMethod);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [parsedInstallMethods, release.installMethod, release.os]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unguarded array access after filtering may crash

Medium Severity

grouppedMethods[0].items is accessed without a guard, but grouppedMethods can now be empty after the newly added .filter(({ items }) => items.length > 0). Previously the array always had exactly two group objects (official and unofficial), making index-zero access safe. Now, if all install methods are disabled for a given OS (e.g., due to future changes to constants.json), grouppedMethods[0] is undefined and accessing .items throws a TypeError at runtime.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a4a03e7. Configure here.

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.

Remove irrelevant dropdown options for installing Node.js rather than disabling them

2 participants