Add direct APK download link to Android section#259
Conversation
Added a direct download link for the Android APK alongside the existing Google Play Beta link, giving users an alternative installation method. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Deploying maple with
|
| Latest commit: |
7a4ab05
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1293733f.maple-ca8.pages.dev |
| Branch Preview URL: | https://add-android-apk-download.maple-ca8.pages.dev |
WalkthroughAdds UI blocks to expose a direct beta APK download link in two locations on the downloads page: under the Android card and within the Mobile Apps section. No changes to logic, data flow, or exports. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR adds a direct APK download option for Android users to the downloads page. The change introduces a new section within the existing Android card that provides an alternative installation method alongside the Google Play Beta link. The implementation adds proper styling and accessibility attributes consistent with the rest of the download page, using the same Tailwind CSS classes and hover effects found throughout the component.
The new APK download section is positioned below the Google Play Beta link with a visual separator and includes appropriate security attributes (target="_blank" and rel="noopener noreferrer"). The styling follows the established patterns used for other download buttons on the page, maintaining visual consistency with the existing design system.
However, the implementation uses a hardcoded GitHub release URL (https://github.com/OpenSecretCloud/Maple/releases/download/v1.99.0-android-beta1/app-universal-release.apk) rather than integrating with the existing dynamic URL loading system that the downloads page already uses for desktop platforms through the getLatestDownloadInfo utility function.
Changed Files
| Filename | Score | Overview |
|---|---|---|
| frontend/src/routes/downloads.tsx | 2/5 | Added direct APK download section with hardcoded GitHub release URL instead of integrating with existing dynamic URL system |
Confidence score: 2/5
- This PR introduces a maintenance burden with hardcoded URLs that will become stale over time
- Score lowered due to inconsistent implementation that bypasses the existing dynamic release loading system and will lead to users downloading outdated APKs when new versions are released
- Pay close attention to the hardcoded GitHub release URL that needs to be replaced with dynamic URL loading integration
Sequence Diagram
sequenceDiagram
participant User
participant Browser
participant DownloadsPage
participant GitHub
User->>Browser: "Navigate to /downloads"
Browser->>DownloadsPage: "Request downloads page"
DownloadsPage->>Browser: "Render page with mobile apps section"
Browser->>User: "Display Android download options"
Note over User,Browser: User sees Google Play Beta and APK options
User->>Browser: "Click 'Download APK (Beta)' link"
Browser->>GitHub: "Navigate to APK download URL"
GitHub->>Browser: "Serve APK file download"
Browser->>User: "Download app-universal-release.apk"
Additional Comments (1)
-
frontend/src/routes/downloads.tsx, line 12-17 (link)style: Consider adding
androidApk: string;to support dynamic APK URL loading like other platforms.
1 file reviewed, 1 comment
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
frontend/src/routes/downloads.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx,js,jsx}: Use 2-space indentation, double quotes, and a 100-character line limit for formatting
Use camelCase for variable and function names
Use try/catch with specific error types for error handling
Files:
frontend/src/routes/downloads.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use strict TypeScript typing and avoid
anywhen possible
Files:
frontend/src/routes/downloads.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-linux
- GitHub Check: build-ios
- GitHub Check: build-android
- GitHub Check: build-macos (universal-apple-darwin)
- GitHub Check: Cloudflare Pages
🔇 Additional comments (2)
frontend/src/routes/downloads.tsx (2)
254-269: Inconsistency with AI summary: Only one APK download section added, not two.The AI summary states that the APK download option was added "in two places," but the code changes only show one addition within the Android card in the Mobile Apps section.
259-259: APK download URL verified — following redirects returns HTTP 200 OK; no changes needed.
| Or download the APK directly: | ||
| </p> | ||
| <a | ||
| href="https://github.com/OpenSecretCloud/Maple/releases/download/v1.99.0-android-beta1/app-universal-release.apk" |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Hardcoded APK version will become stale quickly.
The APK download URL is hardcoded to a specific version (v1.99.0-android-beta1), while desktop downloads dynamically fetch the latest release using getLatestDownloadInfo(). As new Android releases are published, this link will point to an outdated version, degrading the user experience.
Consider one of these approaches:
Option 1 (Recommended): Extend the existing dynamic release fetching
Add Android APK URL to the DownloadUrls interface and update getLatestDownloadInfo() to include it:
interface DownloadUrls {
macOS: string;
linuxAppImage: string;
linuxDeb: string;
linuxRpm: string;
+ androidApk: string;
}Then update the fallback and use the dynamic URL:
const FALLBACK_URLS: DownloadUrls = {
macOS: `${FALLBACK_BASE_URL}/Maple_${FALLBACK_VERSION}_universal.dmg`,
linuxAppImage: `${FALLBACK_BASE_URL}/Maple_${FALLBACK_VERSION}_amd64.AppImage`,
linuxDeb: `${FALLBACK_BASE_URL}/Maple_${FALLBACK_VERSION}_amd64.deb`,
- linuxRpm: `${FALLBACK_BASE_URL}/Maple-${FALLBACK_VERSION}-1.x86_64.rpm`
+ linuxRpm: `${FALLBACK_BASE_URL}/Maple-${FALLBACK_VERSION}-1.x86_64.rpm`,
+ androidApk: `${FALLBACK_BASE_URL}/app-universal-release.apk`
};Update the link to use the dynamic URL:
<a
- href="https://github.com/OpenSecretCloud/Maple/releases/download/v1.99.0-android-beta1/app-universal-release.apk"
+ href={downloadUrls.androidApk}
className="py-2 px-4 rounded-lg text-center font-medium transition-all duration-300 blockOption 2: Use a separate constant for the Android release tag
If Android releases follow a different versioning scheme or cadence, define a constant at the top of the file:
const ANDROID_BETA_TAG = "v1.99.0-android-beta1";
const ANDROID_APK_URL = `https://github.com/OpenSecretCloud/Maple/releases/download/${ANDROID_BETA_TAG}/app-universal-release.apk`;This at least makes the version easier to update in one place.
🤖 Prompt for AI Agents
In frontend/src/routes/downloads.tsx around line 259, the APK download URL is
hardcoded to a specific release tag making it stale; update the code to fetch
the APK URL dynamically by extending the DownloadUrls interface to include an
androidApk (or apkUrl) field, modify getLatestDownloadInfo() to populate that
field from the release assets (falling back to the existing hardcoded URL if not
found), and replace the hardcoded href with the new dynamic download field;
alternatively, if Android uses a separate cadence, add a single ANDROID_BETA_TAG
constant and construct ANDROID_APK_URL from it and use that constant in place of
the hardcoded URL.
Added a direct download link for the Android APK alongside the existing Google Play Beta link, giving users an alternative installation method.
🤖 Generated with Claude Code
Summary by CodeRabbit