feat(site): add download landing page#992
Conversation
Standalone Astro static site under site/ for the PawWork download landing page. Plain CSS (no UI framework); deploys to Cloudflare Pages independently of the desktop app build. - Ported from the approved design (2026-05-30 download-landing final) - English first paint for basic SEO; client-side EN/中 and light/dark toggles, persisted in localStorage; anti-flash theme script in <head> - Download buttons point at the GitHub Releases page for now; China-hosted direct links to follow with the updater fallback (#219) - Per-language SEO routes intentionally deferred
|
Warning Review limit reached
More reviews will be available in 27 minutes and 52 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a new Astro-based static site under ChangesPawWork Download Landing Page Site
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request introduces a static landing page for PawWork built with Astro, featuring plain CSS styling, light/dark theme toggles, and client-side English/Chinese language switching. The code review feedback suggests several improvements to enhance client-side robustness and user experience, including wrapping localStorage access in a try-catch block to avoid security errors, checking for the existence of DOM elements before binding event listeners, dynamically updating the document title upon language changes, and centralizing the SEO title within the i18n dictionary to eliminate duplication.
The actions/labeler config had no path rule for the new site/ directory, so pr-triage failed with "must have at least one primary routing label". Add site/** to the ui glob set.
Triggers on push to dev when site/ changes, or via manual dispatch. Uses wrangler-action to deploy the Astro static build to Cloudflare Pages. Requires two repository secrets: - CLOUDFLARE_ACCOUNT_ID - CLOUDFLARE_API_TOKEN (with Pages edit permission)
- Add title to i18n dictionaries and reference it from seoTitle to eliminate duplication - Update document.title on language switch so the browser tab reflects the active language - Wrap localStorage.getItem in try-catch for strict privacy environments - Use optional chaining on toggle event listeners for defensive safety
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
.github/workflows/deploy-site.yml (1)
20-22: ⚡ Quick winConsider adding deployment environment tracking.
Adding an
environment:field enables GitHub's deployment tracking UI, providing visibility into deployment history, status, and protection rules.📊 Proposed enhancement for deployment visibility
deploy: runs-on: ubuntu-latest timeout-minutes: 5 + environment: + name: cloudflare-pages-dev + url: https://pawwork.pages.dev steps:🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/deploy-site.yml around lines 20 - 22, The deploy job currently defined with the job name "deploy" and keys "runs-on" and "timeout-minutes" lacks an environment declaration for GitHub deployment tracking; add an environment: block (for example environment: name: production or environment: name: ${{ secrets.DEPLOY_ENV }}) under the deploy job to enable deployment history, status, and protection rules in GitHub UI.site/src/pages/index.astro (1)
59-63: ⚡ Quick winConsider adding ARIA state attributes to toggle buttons.
The language and theme toggle buttons have
aria-labelattributes but lack state indicators. Addingaria-pressedoraria-checkedwould improve accessibility by announcing the current state to screen reader users.♿ Suggested enhancement for accessibility
Update the client-side script to set ARIA state attributes when applying theme/language:
function applyLang(l) { root.setAttribute("data-lang", l); root.setAttribute("lang", l === "cn" ? "zh" : "en"); + lg?.setAttribute("aria-pressed", l === "cn" ? "false" : "true"); const dict = I18N[l];function applyTheme(theme) { root.setAttribute("data-theme", theme); + tg?.setAttribute("aria-pressed", theme === "dark" ? "true" : "false"); try {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@site/src/pages/index.astro` around lines 59 - 63, The toggle buttons with ids "lg" and "tg" lack ARIA state attributes—update the client-side script that handles language and theme toggles to set and update an appropriate ARIA state (e.g., aria-pressed="true"/"false" or aria-checked="true"/"false") on the elements with id "lg" and "tg" (and any elements with class "toggle") whenever their state changes, ensure the initial state is set on page load to reflect the current language/theme, and keep the attribute in sync whenever the UI or persisted preference changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/deploy-site.yml:
- Around line 26-28: Replace the non-deterministic step using "uses:
oven-sh/setup-bun@..." that currently passes bun-version: latest by pinning
bun-version to a specific released version (replace "latest" with an explicit
version string) and disable the action's caching (add the cache: false input) to
prevent cache poisoning from forked PRs; update the action invocation that
references "uses: oven-sh/setup-bun@..." and the "bun-version" and "cache"
inputs accordingly.
- Line 24: The checkout step currently uses actions/checkout without disabling
credential persistence; update the checkout step (the actions/checkout@...
invocation) to include a "with: persist-credentials: false" option so GitHub
credentials are not persisted to the runner or artifacts — locate the line
containing "uses: actions/checkout@de0fac2e..." and add the persist-credentials:
false setting under its "with" configuration.
In `@site/README.md`:
- Around line 16-25: Update the fenced code block in README.md that begins with
the directory listing (the block showing "src/" and "public/") to include a
language specifier (e.g., change ``` to ```text) so the markdown linter accepts
it and rendering is consistent; locate the block containing the lines "src/",
"pages/index.astro", "layouts/Base.astro", "styles/global.css", "i18n.ts",
"config.ts", and "public/" and add the language token immediately after the
opening backticks.
In `@site/src/pages/index.astro`:
- Line 122: The lang attribute uses a generic "zh" tag; update the call to
root.setAttribute in the file so that when l === "cn" it sets a BCP 47 locale
like "zh-CN" (instead of "zh") to correctly indicate Simplified Chinese; keep
the existing conditional logic (root.setAttribute and variable l) but replace
the value for the "cn" branch with "zh-CN".
---
Nitpick comments:
In @.github/workflows/deploy-site.yml:
- Around line 20-22: The deploy job currently defined with the job name "deploy"
and keys "runs-on" and "timeout-minutes" lacks an environment declaration for
GitHub deployment tracking; add an environment: block (for example environment:
name: production or environment: name: ${{ secrets.DEPLOY_ENV }}) under the
deploy job to enable deployment history, status, and protection rules in GitHub
UI.
In `@site/src/pages/index.astro`:
- Around line 59-63: The toggle buttons with ids "lg" and "tg" lack ARIA state
attributes—update the client-side script that handles language and theme toggles
to set and update an appropriate ARIA state (e.g., aria-pressed="true"/"false"
or aria-checked="true"/"false") on the elements with id "lg" and "tg" (and any
elements with class "toggle") whenever their state changes, ensure the initial
state is set on page load to reflect the current language/theme, and keep the
attribute in sync whenever the UI or persisted preference changes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: f09ca9f1-3c51-49bc-9dbd-7e6989a36528
⛔ Files ignored due to path filters (2)
site/bun.lockis excluded by!**/*.locksite/public/app-icon.svgis excluded by!**/*.svg
📒 Files selected for processing (12)
.github/labeler.yml.github/workflows/deploy-site.ymlsite/.gitignoresite/README.mdsite/astro.config.mjssite/package.jsonsite/src/config.tssite/src/i18n.tssite/src/layouts/Base.astrosite/src/pages/index.astrosite/src/styles/global.csssite/tsconfig.json
Address review feedback: - Pin bun-version to 1.3.14 to match the rest of the workflows (was: latest) - Trigger on pull_request (site/** paths) so build breaks surface in the PR instead of after merge; the Cloudflare deploy step is skipped for PRs - Scope concurrency group by ref so PR build-checks don't cancel dev deploys
The bun-version-workflow guard test enumerates every setup-bun step and requires the audit-version comment above each bun-version line. The new deploy-site workflow tripped both checks; register its pin in the expected list and add the audit comment so the guard stays green.
- The pinned wrangler-action SHA did not exist, so the deploy-site job failed at 'Set up job' (Unable to resolve action). Repin to the v3 commit 9acf94ac that GitHub actually resolves. - Gate the deploy step on github.ref == 'refs/heads/dev' instead of just 'not a PR', so a manual workflow_dispatch from another branch build-checks only and can't publish non-dev content to the fixed --branch=dev target.
The mobile media query only handled hero/cards; the nav could overflow and clip the GitHub/language/theme controls on narrow screens. Add a <=600px breakpoint that tightens padding, shrinks the brand, and drops the secondary 'What it does' anchor so everything fits down to ~320px.
Address still-valid bot review findings on PR #992: - deploy-site checkout: set persist-credentials: false (zizmor artipacked hardening; the deploy step uses separate Cloudflare credentials) - lang switch: use BCP 47 zh-CN instead of generic zh for Simplified Chinese - README structure block: add text language specifier (markdownlint MD040) Other bot suggestions (i18n title keys, SEO title dedup, document.title on language switch) were already implemented in earlier commits. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Add a standalone download landing page as a new Astro static site under
site/.site/lives outside thepackages/*workspace).docs/design/scratch/2026-05-30-download-landing-pawwork-final.html, signed off 2026-05-30).localStorage. An inline anti-flash script sets the theme before first paint.site/src/config.tscentralizes the links so China-hosted direct links can drop in later.Why
China-market promotion (Xiaohongshu) is blocked on non-technical users in China downloading from GitHub reliably. This is PR A of the two-part download-distribution plan: PR A = the landing page (this PR); PR B = updater China fallback (#219). Stage 1 hosts installers on Cloudflare R2 behind
pawwork.ai, and this page is the front door.Related Issue
No standalone issue. Tracked as "PR A" of the download-landing / China-promotion plan; the companion updater work is #219.
Human Review Status
Pending
Review Focus
site/as a top-level dir outsidepackages/*(independent Cloudflare Pages deploy). No CI / deploy workflow wired yet.Risk Notes
site/yet; the build is verified locally only.site/is not covered by the existing labeler path rules; applieduias the closest fit — a maintainer may prefer a newsitelabel.How To Verify
Screenshots or Recordings
Verified the four EN/CN × light/dark combinations locally via Chrome headless against
astro preview(?lang=en|cn&theme=light|dark). Layout matches the approved design: paw logo + single floating chip, full-width primary download button over two equal secondary buttons, three capability cards. EN/light and CN/dark shared with the maintainer in-session.Checklist
bug,enhancement,task,documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.app,ui,platform,harness,ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.Summary by CodeRabbit
New Features
Documentation