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
Background
In #28244, we introduced platform detection helpers (
isMac(),isWindows(),supportsCoderDesktop()) insite/src/utils/platform.tsto gate the visibility of the new Install Coder Desktop item inUserDropdownbased 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.
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:
curl | sh/ Homebrew / WinGet / PowerShell command based onisMac()/isWindows()/ Linux.Scope / Open questions
supportsCoderDesktop()?References
site/src/utils/platform.tsCreated on behalf of @jakehwll