diff --git a/.claude/skills/factory-report/SKILL.md b/.claude/skills/factory-report/SKILL.md index 03e05596..27a84704 100644 --- a/.claude/skills/factory-report/SKILL.md +++ b/.claude/skills/factory-report/SKILL.md @@ -6,7 +6,8 @@ argument-hint: # Station: report -**In:** a factory PR whose Zoom run is done (or that no Zoom-client spec covers). +**In:** a factory PR whose Zoom run is done, or that needs none (no Zoom-client spec covers +it, or the change reaches no part of the Zoom-only surface, CLAUDE.md). **Out:** the PR body as the report, PR out of draft, label `ready-for-review`. 1. **Gather:** the issue, the plan, `.factory/oracles/.json`, `git diff --stat @@ -16,7 +17,8 @@ argument-hint: 2. **Write the body** in the shape of `.github/pull_request_template.md`, the way PR #128 reads: Why from the issue's problem and evidence; What changes behaviour first; Testing with real counts; Evidence from `run.md`, quoting non-pixel proof (request lines, KV, - localStorage) since screenshots stay local in `test-runs/`; Not verified listing every ⏭ + localStorage) since screenshots stay local in `test-runs/`, or, with no run, the Playwright + tests that stood in and why no real run was needed (the station's note); Not verified listing every ⏭ and anything else not run; Look here first with 1–3 file:line links to the hunks most worth a human's read (riskHigh paths first). 3. **Publish:** `scripts/factory/gh.sh pr edit --body-file …`, `gh.sh pr ready `, diff --git a/.claude/skills/factory-zoom/SKILL.md b/.claude/skills/factory-zoom/SKILL.md index dfab510f..38469587 100644 --- a/.claude/skills/factory-zoom/SKILL.md +++ b/.claude/skills/factory-zoom/SKILL.md @@ -1,6 +1,6 @@ --- name: factory-zoom -description: Factory station "zoom" (this Mac only). Take the dev lock, deploy a factory PR's branch to dev, run the Zoom-client specs its diff touches in the real Zoom client with the zoom-app-testing skill, record the evidence, restore dev, then run factory-report. Use for "/factory-zoom ", the daily scheduled Zoom run, or when scripts/factory/state.mjs says next is zoom. +description: Factory station "zoom" (this Mac only). Take the dev lock, deploy a factory PR's branch to dev, run the Zoom-client specs its diff touches in the real Zoom client with the zoom-app-testing skill when the change reaches the Zoom-only surface (CLAUDE.md), record the evidence, restore dev, then run factory-report. Use for "/factory-zoom ", the daily scheduled Zoom run, or when scripts/factory/state.mjs says next is zoom. argument-hint: | next --- @@ -15,7 +15,11 @@ re-verified, then `factory-report`. Needs this Mac: `cliclick`, the Zoom client, 2. **Lock.** One Mac, one Zoom client, one dev host. If any open PR has `zoom:testing`, end (busy). Otherwise add `zoom:testing` to this PR. 3. **Which specs.** Check out the branch, pull, `node scripts/factory/stop-gate.mjs --hits`. - None → note "no Zoom-client spec covers this change" and skip to step 7. + Keep the hits whose change reaches the Zoom-only surface (CLAUDE.md "When a change needs + the real Zoom client"); when you can't tell, keep it. For each hit you drop, add the spec's + review note (the Playwright tests that stand in for its moved steps), commit and push it. + None left → note "no Zoom-client spec needs a real run for this change" with the reason, and + skip to step 7. 4. **Deploy.** Apply each spec's `needs` (flag values) to `env.dev.vars` in `wrangler.jsonc` without committing, then `npm run cf:deploy:dev`. Note the version id it prints. 5. **Run** the specs with the `zoom-app-testing` skill, run name `--`: its diff --git a/.claude/skills/zoom-app-testing/SKILL.md b/.claude/skills/zoom-app-testing/SKILL.md index 87e10d6a..7a647f30 100644 --- a/.claude/skills/zoom-app-testing/SKILL.md +++ b/.claude/skills/zoom-app-testing/SKILL.md @@ -1,6 +1,6 @@ --- name: zoom-app-testing -description: Drive the real Zoom desktop client (plus the web app and Worker logs) to run Toastmusters Timer manual test plans end to end, with screenshots and a timestamped run log as proof. Use this whenever the user wants to test, verify, QA, smoke-test or "click through" the Zoom app or a feature on dev/staging inside Zoom — e.g. "test the dev branch in my Zoom client", "run the club pro test plan", "check the badge on real video", "verify FINISH uploads", "automate the manual testing" — even if they don't say "skill" or name cliclick. Also use it unasked right after implementing a change whose files a Zoom-client spec `covers`: running those specs is part of done (CLAUDE.md), not a separate request. Also use it to plan which steps of a test plan can run unattended versus which need the user. +description: Drive the real Zoom desktop client (plus the web app and Worker logs) to run Toastmusters Timer manual test plans end to end, with screenshots and a timestamped run log as proof. Use this whenever the user wants to test, verify, QA, smoke-test or "click through" the Zoom app or a feature on dev/staging inside Zoom — e.g. "test the dev branch in my Zoom client", "run the club pro test plan", "check the badge on real video", "verify FINISH uploads", "automate the manual testing" — even if they don't say "skill" or name cliclick. Also use it unasked right after implementing a change that touches files a Zoom-client spec `covers` and reaches the Zoom-only surface (CLAUDE.md, "When a change needs the real Zoom client"): running those specs is then part of done, not a separate request. A change that reaches none of it gets Playwright and a review note instead, not a Zoom run. Also use it to plan which steps of a test plan can run unattended versus which need the user. --- # Zoom app testing (Toastmusters Timer) @@ -21,7 +21,8 @@ directory `$S` below). Project facts — hosts, Worker name, KV ids, CLI, test p The source of truth for *what to test* is `e2e/zoom-client/` (read its `README.md` for the format, then `INDEX.md`). Pick the specs the user asked for, or those whose `covers` files -changed (`npm run test:specs -- --stale`). Steps are already tagged `auto`/`human`. Honour +changed in a way that reaches the Zoom-only surface (CLAUDE.md); before a release, every spec +that `npm run test:specs -- --stale` lists. Steps are already tagged `auto`/`human`. Honour each spec's `needs` (deploy, gate value) in preflight. If the code and a spec disagree, say so in the run log and fix the spec in the same branch; don't test from memory. After a run, update the spec's `verified_at` (git sha tested) and `verified_on`, mark failed specs diff --git a/.claude/skills/zoom-app-testing/references/gotchas.md b/.claude/skills/zoom-app-testing/references/gotchas.md index c2b4844c..97cbe8cd 100644 --- a/.claude/skills/zoom-app-testing/references/gotchas.md +++ b/.claude/skills/zoom-app-testing/references/gotchas.md @@ -11,6 +11,10 @@ Each of these cost time in the 2026-09-28 Club Pro run. Grouped by where they bi symlink; use ⌘⇧G or drag from `open -R`) **and** the Claude Code binary (`~/Library/Application Support/Claude/claude-code//claude.app` — quote the space; re-add after Claude updates). Restart Claude. +- **A locked screen looks like a working one to the tools** (2026-11-30): `screencapture` + writes a file (all black), `open -a zoom.us` starts Zoom, and no window ever appears. + `preflight.sh` now reports it and `zoom-up.sh` exits 2 before launching Zoom. Run preflight + before deploying or flipping flags for a run, so a locked Mac costs nothing to find out. - **Sleep** kills everything: tail stream, scratchpad files, even the Zoom meeting. Keep the display awake for the whole run. - After a session restart the shell may default to **Node 20**; wrangler refuses it. The @@ -44,6 +48,19 @@ Each of these cost time in the 2026-09-28 Club Pro run. Grouped by where they bi click again. Worse while a Zoom dialog is pending. `click.sh --activate` does both. - **Dropdowns / toggles**: single click only — a double click opens and closes them. - **Page Down doesn't scroll** the webview and cliclick can't scroll → `scroll.sh`. +- **Never chain clicks through a dialog without looking** (2026-11-30). After a text or number + field had focus, the next click on a button often only takes the focus (Add role, Save + Changes, a confirm's Clear All, Read with AI): the dialog stays open and every later click + and keystroke in the chain goes to it. The club survey does the same from the other side: + it opens a few seconds after FINISH and swallows what follows. Snap after each dialog step + (a 560 px copy is enough to tell) and click again when nothing changed. +- **`pbcopy` follows the shell's locale** (2026-11-30). Under the C locale a file's "–" and + curly quotes reach the webview as mojibake. Use `LC_ALL=en_US.UTF-8 pbcopy < file`. A picture + goes on the clipboard with `osascript -e 'set the clipboard to (read (POSIX file "") as + «class PNGf»)'`. Save the user's clipboard first and put it back at the end. +- **A file input opens the macOS file dialog over Zoom** (2026-11-30). ⌘⇧G, type the path, + Return selects the file; then click Open. Zoom stays the frontmost app throughout, so + `click.sh` works on the dialog. - Zoom opens external links through `marketplace.zoom.us/z/`; for hosts not on the app's Domain Allow List it stops at "Accessing Untrusted Web Site". Read the final URL with `osascript -e 'tell application "Google Chrome" to get URL of active tab of front window'` diff --git a/.claude/skills/zoom-app-testing/references/toastmusters.md b/.claude/skills/zoom-app-testing/references/toastmusters.md index 26044dec..f3a92ca9 100644 --- a/.claude/skills/zoom-app-testing/references/toastmusters.md +++ b/.claude/skills/zoom-app-testing/references/toastmusters.md @@ -23,14 +23,23 @@ club lapse. Flipping it for a spec's `needs` is pre-approved (CLAUDE.md "Standin revert + redeploy at the end — while `"1"`, other dev testers without Pro are refused sync. ## Club tooling -- `node scripts/club-cli.mjs pending|create|show|rotate --env dev …` (`create` also takes - `--customer cus_…` to link Stripe). -- Useful keys: `club:`, `club-by-code:`, `club-member::zoom:`, - `club-device::`, `club-pending:`. -- Device state lives in `localStorage`: `toastmaster_club` (token, ver, plan, role…), - `toastmaster_club_presets`, `toastmaster_club_outbox` (speeches not yet uploaded). -- The admin console only recognises a Zoom sign-in in a browser that has also activated the - club code (open `/pro/` first) — see `docs/plans/08-club-pro-bugfix-plan.md` #1. +- `node scripts/club-cli.mjs pending|create|show|rotate|backfill-club-of --env dev …` + (`create` also takes `--customer cus_…` to link Stripe; `rotate --club `; + `backfill-club-of` is dry until `--apply`). +- Since #167 a club belongs to Zoom accounts: a signed-in, approved account joins with the + code (3 places besides the owner, the count kept by the `ClubPlaces` Durable Object), and + the club follows that account. There is no club token, no `X-Club` header and no + `club-device:` row; every club request carries the session (Bearer in Zoom, cookie on the + web). +- Useful keys: `club:` (`ownerUid`), `club-by-code:`, `club-member::zoom:` + (`{role,…}`, or `{blockedAt,…}` when blocked), `club-of:zoom:` (`{clubId, at}`), + `club-pending:`. +- Device state lives in `localStorage`: `toastmaster_club` (the account's copy: uid, ver, + plan, role, isOwner…), `toastmaster_club_presets`, `toastmaster_club_outbox` (speeches not + yet uploaded); sessionStorage `toastmaster_pending_club_code` holds a code a guest typed + before approving the app. +- The admin console's Zoom door is the account's own club (`club-of`), so signing in with + Zoom in any browser is enough; the billing-address link is the other door. ## Test plans and past runs - `e2e/zoom-client/` — **versioned specs, the source of truth** (see its README and INDEX). diff --git a/.claude/skills/zoom-app-testing/scripts/_env.sh b/.claude/skills/zoom-app-testing/scripts/_env.sh index f08c633f..06c0d6c0 100755 --- a/.claude/skills/zoom-app-testing/scripts/_env.sh +++ b/.claude/skills/zoom-app-testing/scripts/_env.sh @@ -7,4 +7,9 @@ BIN="$ROOT/test-runs/.bin" for n in "$HOME"/.nvm/versions/node/v2[2-9]*/bin /opt/homebrew/opt/node@2[2-9]/bin; do [ -x "$n/node" ] && { export PATH="$n:$PATH"; break; } done +# True while the Mac's screen is locked. A locked screen still lets screencapture +# write a file (all black) and lets Zoom launch, but shows no window and takes no +# clicks; unlocking is the user's to do. Seen 2026-11-30: a run got as far as +# deploying and launching Zoom before a black screenshot gave it away. +screen_locked() { ioreg -n Root -d1 -a 2>/dev/null | grep -A1 CGSSessionScreenIsLocked | grep -q ''; } need_run() { [ -n "$RUN" ] && [ -d "$RUN" ] || { echo "No active run — start one with new-run.sh " >&2; exit 1; }; } diff --git a/.claude/skills/zoom-app-testing/scripts/preflight.sh b/.claude/skills/zoom-app-testing/scripts/preflight.sh index ba8756b0..a2dab63a 100755 --- a/.claude/skills/zoom-app-testing/scripts/preflight.sh +++ b/.claude/skills/zoom-app-testing/scripts/preflight.sh @@ -4,6 +4,8 @@ source "$(dirname "$0")/_env.sh" KV=""; [ "$1" = "--kv" ] && KV=$2 fail=0; ok(){ echo "✅ $1"; }; bad(){ echo "❌ $1"; echo " fix: $2"; fail=1; }; warn(){ echo "⚠️ $1"; [ -n "$2" ] && echo " note: $2"; } +screen_locked && bad "the Mac's screen is locked: Zoom can show no window and take no clicks" "the user has to unlock it (human-only). The run is blocked until then: don't deploy or flip flags for it yet" \ + || ok "screen unlocked" T=$(mktemp -t zt).png screencapture -x "$T" 2>/dev/null && [ -s "$T" ] && ok "Screen Recording (screencapture works)" \ || bad "screencapture fails ('could not create image from display')" "System Settings → Privacy & Security → Screen & System Audio Recording → enable Claude, then quit & reopen Claude" diff --git a/.claude/skills/zoom-app-testing/scripts/zoom-up.sh b/.claude/skills/zoom-app-testing/scripts/zoom-up.sh index d34fffc3..d06a62cf 100755 --- a/.claude/skills/zoom-app-testing/scripts/zoom-up.sh +++ b/.claude/skills/zoom-app-testing/scripts/zoom-up.sh @@ -21,6 +21,7 @@ front() { osascript -e 'tell application "System Events" to get name of first pr wait_for() { local n=$1; shift; for _ in {1..$n}; do "$@" && return 0; sleep 1; done; return 1; } in_meeting && { echo "✅ Zoom meeting already open"; exit 0; } +screen_locked && { echo "⏸ the Mac's screen is locked — unlocking is a human step. Zoom not launched."; exit 2; } if ! pgrep -x zoom.us >/dev/null; then open -a zoom.us || { echo "❌ could not launch zoom.us"; exit 1; } diff --git a/.dev.vars.example b/.dev.vars.example index 5ededeb9..d2de2d62 100644 --- a/.dev.vars.example +++ b/.dev.vars.example @@ -28,3 +28,10 @@ STRIPE_SECRET_KEY= # Signing secret of the webhook endpoint (`stripe listen --forward-to localhost:8787/api/stripe/webhook` # prints one for local dev). STRIPE_WEBHOOK_SECRET= +# Table Topics theme search (worker/tabletopics-match.js), free OpenRouter models +# only. Empty: /tabletopics/api/match answers 503 and the page uses its offline +# keyword match. The Pro agenda import (worker/agenda-import.js) uses the same +# key as its fallback when Workers AI fails; its first choice is the `AI` +# binding in wrangler.jsonc, which needs no secret but always calls the real +# service, even under `wrangler dev`. +OPENROUTER_API_KEY= diff --git a/.factory/README.md b/.factory/README.md index bd2cd840..0fc31b7b 100644 --- a/.factory/README.md +++ b/.factory/README.md @@ -90,6 +90,12 @@ They run Claude Code on Opus 5.5 at high effort (`--model claude-opus-5-5 --effo `claude_args`). With `CLAUDE_CODE_OAUTH_TOKEN` they use the account's Claude subscription, so each run counts against the same usage limits as interactive sessions. +`factory-build.yml` gives the Claude step the job's own token (`github_token`) instead of the +Claude App token. The App token expires after 60 minutes, and a build runs longer; past that +hour the station can't push, label or comment, and ends without a word. Commits pushed with +the job token don't start CI, so a factory PR's checks stay on the oracle commit until the +Zoom station pushes from the Mac. Verify runs the whole suite inside the build anyway. + `master` is the default branch, so `factory-plan.yml` and `factory-build.yml` must be identical on `dev` and `master`: issue-label events run the default branch's copy, and the Claude action skips a workflow that differs from it (the run then fails at "Check the station diff --git a/.factory/oracles/160.json b/.factory/oracles/160.json new file mode 100644 index 00000000..d3a15bf7 --- /dev/null +++ b/.factory/oracles/160.json @@ -0,0 +1,17 @@ +{ + "issue": 160, + "files": [ + "packages/shared/__tests__/appLinks.test.js", + "worker/routing.test.js", + "apps/web/src/pages/Landing.test.jsx", + "apps/web/src/components/Footer.test.jsx", + "apps/web/src/staticPages.patron.test.js", + "apps/zoom-app/src/components/Footer.test.jsx", + "apps/zoom-app/src/components/ProComingSoon.test.jsx", + "apps/zoom-app/src/b/TopBar.test.jsx", + "apps/zoom-app/src/b/NewLookShell.test.jsx", + "e2e/web.patron-link.spec.js", + "e2e/zoom.new-look.spec.js", + "e2e/zoom.pro-coming-soon.spec.js" + ] +} diff --git a/.factory/oracles/167.json b/.factory/oracles/167.json new file mode 100644 index 00000000..025b1c45 --- /dev/null +++ b/.factory/oracles/167.json @@ -0,0 +1,21 @@ +{ + "issue": 167, + "files": [ + "worker/club-places-fake.js", + "worker/club-membership-helpers.js", + "worker/club-places.test.js", + "worker/club-membership.test.js", + "worker/club-membership-admin.test.js", + "worker/no-club-token.test.js", + "packages/shared/__tests__/clubAccount.test.js", + "packages/shared/__tests__/clubOutbox.test.js", + "apps/zoom-app/src/components/UpgradeModal.clubJoin.test.jsx", + "apps/zoom-app/src/utils/zoomIdentity.refresh.test.js", + "apps/zoom-app/src/main.clubOrder.test.jsx", + "apps/web/src/pages/ProActivate.test.jsx", + "apps/web/src/components/ClubCodeSection.test.jsx", + "apps/web/src/pages/ClubAdmin.members.test.jsx", + "e2e/zoom.club-join.spec.js", + "e2e/web.club-join.spec.js" + ] +} diff --git a/.factory/oracles/168.json b/.factory/oracles/168.json new file mode 100644 index 00000000..a4ba5ff0 --- /dev/null +++ b/.factory/oracles/168.json @@ -0,0 +1,17 @@ +{ + "issue": 168, + "files": [ + "packages/shared/__tests__/speakerEntry.test.js", + "packages/shared/__tests__/storage.test.js", + "packages/shared/__tests__/profileMerge.test.js", + "apps/zoom-app/src/context/TimerContext.test.jsx", + "apps/web/src/context/TimerContext.test.jsx", + "apps/zoom-app/src/hooks/useLiveTimer.test.jsx", + "apps/zoom-app/src/components/LiveTab.speakerEntry.test.jsx", + "apps/zoom-app/src/b/TimerTab.speakerEntry.test.jsx", + "apps/web/src/components/LiveTab.speakerEntry.test.jsx", + "e2e/zoom.speaker-entry.spec.js", + "e2e/zoom.new-look.speakers.spec.js", + "e2e/web.speaker-entry.spec.js" + ] +} diff --git a/.factory/oracles/80.json b/.factory/oracles/80.json new file mode 100644 index 00000000..47109075 --- /dev/null +++ b/.factory/oracles/80.json @@ -0,0 +1,22 @@ +{ + "issue": 80, + "files": [ + "worker/durable-object-fake.js", + "worker/polls.test.js", + "worker/polls-zoom.test.js", + "worker/club-poll-template.test.js", + "worker/club-meetings.test.js", + "worker/club-share.test.js", + "worker/routing.test.js", + "worker/csp.test.js", + "worker/gating.test.js", + "packages/shared/__tests__/polls.test.js", + "packages/shared/__tests__/profileMerge.test.js", + "packages/shared/__tests__/reportImage.test.js", + "packages/shared/__tests__/clubArchive.test.js", + "apps/zoom-app/src/utils/zoomSdk.test.js", + "apps/zoom-app/src/components/PollTab.test.jsx", + "apps/zoom-app/src/components/TimerStage.test.jsx", + "e2e/zoom.meeting-polls.spec.js" + ] +} diff --git a/.factory/plans/160-patron-coffee-link.md b/.factory/plans/160-patron-coffee-link.md new file mode 100644 index 00000000..8be213bc --- /dev/null +++ b/.factory/plans/160-patron-coffee-link.md @@ -0,0 +1,188 @@ +# Monetization: add a "Buy Me a Coffee" patron option alongside Pro (#160) + +## Problem +Pro is the only way to pay for Toastmusters today. People who like the free timer and want to +say thanks, without needing Pro's features, have no way to do it. The issue asks for a low-key +"Buy Me a Coffee" patron link that sits beside Pro, never replaces it and never locks anything. + +Plan review (2026-11-28) widened it: the link also goes in the Zoom app, in both looks, in one +footer that is always visible. Feedback and Review merge into one item to make room, so "Buy me +a coffee" and "Upgrade to Pro" can show their full text. + +## Findings +Nothing donation-related exists yet. A search for coffee, ko-fi, donat, sponsor, patron and tip +only finds "Coffee break" agenda fixtures and the "not sponsored by Toastmasters International" +disclaimer. + +**External link constants.** These belong in `packages/shared/appLinks.js`. Its header (:1-3) +says it holds "external links that more than one component needs". Two examples: +`ZOOM_MARKETPLACE_REVIEW_URL` (:9) and `TUTORIALS_URL` (:32). The file is re-exported from +`packages/shared/index.js:9`. + +**Landing page footer** (`apps/web/src/pages/Landing.jsx:985-1037`): +- It has four columns: Resources, Legal, Get Started and Tools. Under them is the copyright line (:1036). +- External links use `target="_blank" rel="noopener noreferrer"` with `onClick={trackCta(cta, 'footer')}` (e.g. :1016). `trackCta` is at :605 and sends `cta_clicked`. + +**Web timer footer** (`apps/web/src/components/Footer.jsx:40-70`, mounted at +`apps/web/src/pages/TimerApp.jsx:119`): +- It holds three icon links: Add to Zoom, Send Us Feedback and Leave a Review. +- Each external link already uses `target="_blank" rel="noopener noreferrer"` and `trackEvent('cta_clicked', { …, location: 'timer-footer' })` (:47). +- At the panel's 480 px width its labels already wrap to two lines; a fourth item does not make it taller (measured 2026-11-28). + +**Static pages.** All 13 pages in `apps/web/public/*.html` (the 11 SEO pages, `404.html` and +`tutorials.html`) hand-copy one `