Skip to content

Use platform detection to render OS-specific install instructions in UserDropdown #28252

Description

@blinkagent

Background

In #28244, we introduced platform detection helpers (isMac(), isWindows(), supportsCoderDesktop()) in site/src/utils/platform.ts to gate the visibility of the new Install Coder Desktop item in UserDropdown based on the user's OS.

During review, @matifali pointed out that this same platform detection could be leveraged to render an OS-specific install script/command elsewhere in the UI, rather than always showing generic instructions.

Note for later: Wow, this can also be used to render the OS Specfic install script.

Proposal

Investigate where in the product we currently show install commands/scripts (for the Coder CLI, and potentially Coder Desktop) and where we could tailor them based on the detected platform. For example:

  • Show the appropriate curl | sh / Homebrew / WinGet / PowerShell command based on isMac() / isWindows() / Linux.
  • Fallback to a platform picker (or all options) when detection is ambiguous.

Scope / Open questions

  • Which surfaces should get OS-aware install instructions? (Install CLI modal, Coder Desktop docs link, onboarding, etc.)
  • Do we want a shared component for rendering platform-aware install snippets?
  • How do we handle iPadOS (which reports as macOS) and other edge cases already handled in supportsCoderDesktop()?

References

Created on behalf of @jakehwll

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions