fix(web): show homebrew section only on desktop macOS #2138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The homebrew section on the download page was incorrectly showing on iOS devices because the previous implementation used
navigator.userAgent.toLowerCase().includes("mac"), which matches iOS Safari's user agent string (which contains "Mac" on newer iOS versions).This PR switches to using the existing
usePlatformhook, which properly distinguishes desktop macOS from mobile devices by checking for mobile UA patterns first.Review & Testing Checklist for Human
usePlatformhook logic: The hook atsrc/hooks/use-platform.tschecks for mobile patterns before checking for "mac" - verify this logic is correct for all iOS UA stringsTest Plan
Notes
The user also reported a scroll snap issue on the download page's mobile view, but I couldn't find any
scroll-snapCSS on the/downloadroute (only on the home page carousels). I'll follow up to clarify whether this is referring to a different page or a browser-specific behavior.Requested by: [email protected] (@ComputelessComputer)
Link to Devin run: https://app.devin.ai/sessions/3dd9e7eb56b64c6eb674942b2e9fe6c4