AOSSIE-Org / AOSSIE-Org/PictoPy-Website
[FEATURE]: Intelligent OS-Aware Dynamic Download Component Integrations (GitHub Releases API)
- 主要语言
- TypeScript
- 星标
- 12
- 派生
- 16
- PR 合并指标
- 30 天内没有已合并 PR
描述
### Feature and its Use Cases
### 🚀 Feature Request: Intelligent OS-Aware Dynamic Download Component
**Is your feature request related to a problem? Please describe.**
Currently, as the landing page for a desktop application (PictoPy), directing users to the main repository's "Releases" page introduces significant friction. Users have to manually navigate the GitHub UI, understand their OS architecture, and find the correct `.exe`, `.dmg`, or `.AppImage` file. This drops conversion rates and creates a poor UX for non-technical users looking for a simple, one-click "Download" button.
**Describe the solution you'd like**
I propose building a smart `` component that dynamically detects the visitor's Operating System and fetches the latest corresponding installer directly from the main `AOSSIE-Org/PictoPy` repository using the GitHub REST API.
**Technical Execution Plan:**
1. **OS Detection Hook (`useOS`):** Create a robust React hook using `navigator.userAgentData` (with a fallback to `navigator.userAgent`) to seamlessly determine if the user is on Windows, macOS, or Linux.
2. **GitHub API Integration:** Fetch the latest release payload asynchronously from `https://api.github.com/repos/AOSSIE-Org/PictoPy/releases/latest`.
3. **Asset Matching Logic:**
- If **Windows**: Map `href` to `.exe` or `.msi` assets.
- If **macOS**: Map `href` to `.dmg` or `.app.tar.gz` assets.
- If **Linux**: Map `href` to `.AppImage` or `.deb` assets.
4. **Dynamic UI Rendering:** The button should read "Download for Windows" (with a Windows logo icon), "Download for macOS", etc., injecting the direct download URL.
5. **Fallback Dropdown:** Include a smaller "Download for other platforms" dropdown for edge cases or users downloading on behalf of another machine.
**Describe alternatives you've considered**
Hardcoding the download links directly into the codebase. However, this is unscalable as maintainers would have to manually submit a PR to update the website code every single time a new version of the PictoPy desktop app is released.
**🎯 Impact / Why this matters**
- **Zero-Maintenance:** The landing page will always serve the absolute latest version of PictoPy automatically.
- **Conversion Rate:** One-click downloads directly on the landing page are the gold standard for modern desktop apps.
- **Modern UX:** Demonstrates a high level of frontend polish for end-users.
**Code of Conduct**
- [x] I have joined the Discord server and will post updates there.
- [x] I have searched existing issues to avoid duplicates.
*If the maintainers agree with this architectural improvement, I would love to be assigned to this issue and start working on the PR immediately!*
### Additional Context
_No response_
贡献指南
评估
这个 Issue 还没有评估数据。