diff --git a/DEPLOY.md b/DEPLOY.md index 423c54b0..0422a8e7 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -1,13 +1,13 @@ # Deploy walkthrough -The HAND Protocol public surfaces are static HTML/CSS/JS, no build step. The site is **live on Netlify at `handprotocol.netlify.app`** as of 2026-05-12. Pushes to `main` of `HandProtocol/handprotocol` auto-deploy. Config for Vercel and Cloudflare Pages is also kept in the repo for host portability. +The HAND Protocol public surfaces are static HTML/CSS/JS, no build step. The site is **live on Netlify at [handprotocol.org](https://handprotocol.org)** (since 2026-05-12, Netlify DNS). Pushes to `main` of `HandProtocol/handprotocol` auto-deploy. Config for Vercel and Cloudflare Pages is also kept in the repo for host portability. ## Pre-flight checklist - [x] GitHub repo public at `github.com/HandProtocol/handprotocol` - [x] Netlify connected, auto-deploy on `main` enabled -- [ ] Custom domain (`handprotocol.org` or alternative) pointed at Netlify -- [ ] OG / sitemap meta tags reference the canonical live domain (currently `https://handprotocol.org`, change in HTML if the canonical domain differs) +- [x] Custom domain `handprotocol.org` pointed at Netlify +- [x] OG / sitemap meta tags reference the canonical live domain `https://handprotocol.org` - [ ] Email `hand@handprotocol.org` exists and forwards somewhere readable ## Option 1: Netlify (current, live) @@ -26,6 +26,38 @@ The site is deployed here. `netlify.toml` at the repo root configures everything - Cache control (long for assets, short for HTML) 4. **Custom domain:** Site Settings → Domain Management → Add custom domain → `handprotocol.org`. Let's Encrypt SSL auto-provisions within ~10 min after DNS propagation. +## Other Netlify sites HAND runs + +Only handprotocol.org deploys from this repo's `main`. The rest deploy as listed, which matters because a push to `main` does NOT update them: + +| Site | Source | How it deploys | +|---|---|---| +| handprotocol.org | `web/` + `netlify/` | Push to `main` | +| command.handprotocol.org (Command Center) | `command/` | Push to `main` (its own Netlify site) | +| waterdrop.handprotocol.org | `waterdrop/` | Push to `main` (base dir `waterdrop`) | +| yuhm.handprotocol.org | `yuhm/` | Netlify CLI by hand | +| waterfall.handprotocol.org | `projects/waterfall/` | Netlify CLI by hand; its own `netlify.toml` overrides the root CSP | +| sps.handprotocol.org | `solarpunk/` | Netlify CLI by hand | +| Client sites (`clients//`) | per client | Netlify CLI by hand, except PrecisionFix, which deploys from its own public repo on the owner's account. See each client's `HANDOFF.md`. | + +New Netlify sites start with the "Powered by Netlify" badge on and Netlify Forms detection off; turn the badge off and, if the site uses forms, detection on. The Free plan cannot build private organization repos. + +## Function limits (handprotocol.org) + +Resend's free plan stops at 100 emails a day for the whole account, which yuhm's auth mail and some client sites share. The public functions are limited so that one flooded form cannot use it up. Counts live in the database (`command.rate_hits`, `command.rate_take`, migration 057), because function instances do not share memory. + +| Limit | Default | Env var to change it | +|---|---|---| +| Feedback notes per visitor per 10 minutes | 5 | `FEEDBACK_IP_BURST` | +| Feedback notes per visitor per day | 20 | `FEEDBACK_IP_DAILY` | +| Feedback notes from everyone per hour | 30 | `FEEDBACK_HOURLY_CAP` | +| Feedback notes that also send an email, per day | 10 (later notes still reach `/pins` and Telegram) | `FEEDBACK_EMAIL_DAILY_CAP` | +| All email sent by this site's functions per 24 hours | 50 | `EMAIL_DAILY_CAP` | + +Visitors over a limit get HTTP 429 and the widget retries ten minutes later. The same note sent twice within an hour is accepted once. If the counter cannot be reached, feedback is still accepted but email is skipped. Any new function that sends email should use `sendEmail` from `netlify/functions/_email.js` so it counts against the daily cap. + +Database changes go first: apply a migration through the Supabase management API and record it in `supabase_migrations.schema_migrations` before deploying code that needs it. + ## Option 2: Vercel (former, ad-hoc / archived) 1. Sign in at [netlify.com](https://netlify.com), connect your GitHub account. @@ -77,7 +109,7 @@ After the site is live at your custom domain: ## Updating the site -Any commit pushed to `main` on the GitHub repo triggers an auto-deploy on the active host (currently Vercel). No manual deploy step needed. +Any commit pushed to `main` on the GitHub repo triggers an auto-deploy on Netlify. No manual deploy step needed. When making any change that affects deploy behavior (redirects, headers, routing), **update both `vercel.json` and `netlify.toml`** in the same commit. They mirror each other so the eventual Netlify switch is zero-rework. diff --git a/DESIGN.md b/DESIGN.md index ca902d6b..21f44876 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -40,7 +40,9 @@ The palette is **restrained**: tinted neutrals plus one signature accent. Additi | Token | Value | Role | |---|---|---| | `--color-accent` | `#D97706` | Signature amber. The HAND color. Used on links, CTAs, eyebrows, accent rules. Coverage ~5–10% of any surface. | -| `--color-accent-hover` | `#B45309` | Hover state of accent buttons | +| `--color-accent-hover` | `#B45309` | Darker accent for link and inline-control hover states. | +| `--color-accent-action` | `#B45309` | Accessible solid-button amber. White text reaches 5.02:1 contrast. | +| `--color-accent-action-hover` | `#92400E` | Accessible solid-button hover. White text reaches 7.09:1 contrast. | | `--color-accent-light` | `#FEF3C7` | Tinted accent backgrounds (callout fill, route-card gradient) | | `--color-accent-glow` | `rgba(217, 119, 6, 0.15)` | Hero gradient ambient glow | | `--color-teal` | `#0D9488` | Secondary accent, used for the "Models" doc accent stripe, teal callout variants | @@ -152,7 +154,7 @@ The component vocabulary, named and stable across surfaces. ### Buttons - **`.btn`** base, pill-shaped (`--radius-full`), `font-weight: 600`. -- **`.btn--primary`**, solid `--color-accent` background, white text, subtle hover lift. +- **`.btn--primary`**, solid `--color-accent-action` background, white text, subtle hover lift. - **`.btn--ghost`**, transparent with 1.5px border, used as secondary CTA. - **`.btn--dark`**, dark background `--color-bg-cta`, white text. Used inside CTA sections. - Size modifiers: `.btn--sm` (compact nav CTAs), `.btn--lg` (hero/primary actions). diff --git a/HANDOFF.md b/HANDOFF.md index f6832fdd..a737df63 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -1,13 +1,13 @@ # HAND Protocol Handoff **For the person picking this up cold (or for future-self after time away).** -*Last updated: 2026-05-15 · Pre-incorporation* +*Last updated: 2026-10-23 · Pre-incorporation* --- ## Orient in one paragraph -HAND Protocol Foundation is preparing to file as a 501(c)(3) in Austin, Texas, to operate a long-term, relational accompaniment model for impact entrepreneurs, community-rooted small businesses, and grassroots organizations. The repository contains the public website, the governance package, the AI workstream proposal, and the working documents that explain the work in plain English. The site is live at [handprotocol.org](https://handprotocol.org), auto-deployed from `main` to Netlify. The filing raise is open with a $222,222 first goal. +HAND Protocol Foundation is preparing to file as a 501(c)(3) in Austin, Texas, to operate a long-term, relational accompaniment model for impact entrepreneurs, community-rooted small businesses, and grassroots organizations. The repository contains the public website, the governance package, the AI workstream proposal, and the working documents that explain the work in plain English. The site is live at [handprotocol.org](https://handprotocol.org), auto-deployed from `main` to Netlify. The filing raise is open with a $222,222 first goal. Alongside the foundation work, HAND runs a Develop practice (owner-editable websites for small businesses and practitioners, each on the owner's own domain), community tools (yuhm for food, WaterDrop for paddling, a driver sign-up for SolarPunk Summit), and koordi, the booking and coordination service those tools are moving onto. ## What just shipped (recent past, in order) @@ -17,7 +17,38 @@ HAND Protocol Foundation is preparing to file as a 501(c)(3) in Austin, Texas, t 4. **Audience and origin reframing.** The audience is impact entrepreneurs, community-rooted small businesses, and grassroots organizations. Origin narrative is regenerative impact and durable local enterprise. AI is positioned as one tool inside the larger mission, not the centerpiece. 5. **Brand voice sweep.** Zero em dashes across the project. See `AGENTS.md`. 6. **Custom domain live on Netlify.** [handprotocol.org](https://handprotocol.org), auto-deploy on `main`. Resend mailing list integration in production. See `DEPLOY.md` for infrastructure. -7. **WXL:FOOD simple and advanced modes.** The public WXL experience defaults to four clean paths: Find food, Contribute, Gather, and Requests. Coordinator dashboards are now an explicit Advanced workspace setting with a clear return to simple mode. See `wxl/docs/LIVING-DOCS.md`. +7. **WXL:FOOD (now yuhm) simple and advanced modes.** The public WXL experience defaults to four clean paths: Find food, Contribute, Gather, and Requests. Coordinator dashboards are now an explicit Advanced workspace setting with a clear return to simple mode. See `wxl/docs/LIVING-DOCS.md`. +8. **WXL (now yuhm) shared dialog motion.** Centered dialogs now use a shared 250 ms entry and exit treatment, delayed React unmounting, and a 150 ms opacity-only reduced-motion path. The implementation and tests shipped in commit `5fa66ebfb`. See `wxl/HANDOFF.md` for the focused desktop-app continuation. +9. **PrecisionFix client site (Develop pillar), 2026-09-15.** A factory-certified Mercedes-Benz mobile mechanic in Austin, rebuilt on the owner-editable client engine (`clients/_template` + the `hand-client-site` skill). Five owner-switchable themes, English and Spanish on every line, a Netlify booking form that emails him through Resend, and a phone-first Setup checklist inside `/admin/` (he has Claude Code on his phone and no computer). LIVE at https://precisionfix-austin.netlify.app, code mirrored to the private repo `HandProtocol/precisionfix-site` and git-linked, though pushes do not deploy yet (Free plan cannot build private org repos; see open items). The engine gained `select` fields, the Setup tab, form emails, runtime theme override, and `/sitemap.xml`; Legacy Care and Three Hands Healing were synced. Nothing committed in this repo. Read `clients/precisionfix/HANDOFF.md` first. +10. **Setup tab rework + client-skill Phase 3b + booking-calendar plan, 2026-09-16.** The owner editor's Setup tab is now buttons, not prose: every step jumps to the right field, section, tab, or page; items tick themselves where the site can tell; ticks save on the spot (new `PATCH /api/admin/content`); the first item is a Looks picker that previews the real site in each theme inside the editor and publishes the pick in one tap. The template ships a universal `site/checklist.mjs`, the scaffold takes `--domain= --old-site= --code-access`, and the skill documents it as Phase 3b. Synced and redeployed on PrecisionFix, Legacy Care, Three Hands Healing. Calendar for mechanics on the go and healers is planned, not built: `.claude/skills/hand-client-site/reference/booking-calendar-plan.md`. Later that day: the Setup tab's test-booking button was fixed (site actions now open the live site, not `/admin/#hash`; PrecisionFix redeployed, standalone commit `0ae6429`), Cal.com self-hosting was researched and rejected, and koH decided the calendar's shape (see open items). Nothing committed in this repo. +11. **Courtney site (Develop pillar, project `unfuckwithable`), 2026-09-16 to 17.** A new client, Courtney (the brand is her name; the project was first called Unfuckable With), sells two courses: The Energetic Reset ($167 mini-course, copy in hand) and Becoming Unfuckwithable (main course, copy and price to come); the real site will be built on Kajabi. Day one: four design directions in a pick-one gallery. Day two: she picked Halo (white), so the gallery was archived under `directions/` and a four-page site was built on it (cover, about, one sales page per course) with her words on the mini-course page and dotted-rose placeholder copy everywhere else. The project folder and URL were renamed from unfuckable-with to unfuckwithable (old links redirect). LIVE (noindex) at https://handprotocol.org/project/unfuckwithable/ (short https://handprotocol.org/unfuckwithable). Waiting on her copy, the main-course price and both Kajabi checkout URLs. Read `unfuckwithable/HANDOFF.md` first. +12. **Long Horn Wine Tours on the engine + multi-page engine, 2026-09-22.** koH's own client site + (`~/Documents/lhwt`, own repo, Netlify account `zantrra`) now runs on the owner-editable engine as + the first **external** client (`clients/_external`): eight server-rendered routes, 205 editable + fields, every photo slot in Media, a Setup tab made of its open owner items, the guest review + page at review.longhornwinetours.com with owner-pasted links. To get there the engine gained + multi-page packs (`ROUTES`, path-less `page.mjs` + rewrites, `lib/render.mjs`, 404/301 handling, + `render.fallback`), a configurable publish dir + pack-owned toml, `favicon`, `preferStatic` on + the sitemap, review links as a function of content, form subject hooks, and a sync that maps + `public/` to the client's publish dir. Migration 049 applied. LIVE 22 Sep, published once through + the editor. Existing clients are NOT synced yet (they drift by the 21 Sep review feature + today's + changes: run `sync-engine.mjs --check`). Nothing committed in this repo. +13. **yuhm, renamed from WXL:FOOD (2026-08-24), and the one-step sign-in (2026-09-08).** The food app lives at [yuhm.handprotocol.org](https://yuhm.handprotocol.org) (the old wxl address redirects), with a playful brand that now carries from the landing page through sign-in to the task. Sign-in is one email-and-password Continue form; guests can browse first and sign in only when they need to. yuhm deploys by hand from the CLI, not from `main`. See `yuhm/HANDOFF.md`. +14. **Booking calendar for client sites, 2026-09-16 to 17.** Request-mode booking is live on PrecisionFix: customers pick a service, a day and a time window; the owner confirms in a Bookings tab or from one-tap email links; customers get confirmation emails, a calendar file and reminders. Phase 2 part 1 (a privacy fix plus the first slice) shipped 2026-09-17 with migration 048. Reschedule and busy-calendar import moved to koordi. Plan: `.claude/skills/hand-client-site/reference/booking-calendar-plan.md`. +15. **Practitioner safety plan, 2026-09-16 (plan only).** How a healer can screen a first-time client before meeting them alone: traceability, a hello call, a safety contact with a check-out alarm, rules that apply to every new client equally. Nothing built. See `.claude/skills/hand-client-site/reference/booking-screening-plan.md`. +16. **(Sub)culture Audio portfolio, 2026-09-17.** Three themes for an Austin sound-system rental crew, built from their own copy, specs and photos, at [/project/subculture-audio/](https://handprotocol.org/project/subculture-audio/) (noindex). Workspace `subcultureaudio/`. +17. **koordi, the coordination service, 2026-09-19 onward.** Started as `book`, renamed `koord` then `koordi`. It is the booking and delivery layer (channels, consent, reminders, later push) that client sites and HAND communities will share. Private repo `HandProtocol/koordi`, nested at `koordi/`. Running on HAND's VPS at koordi.handprotocol.org in staging since 2026-10-13: demo tenant only, no real data or mail. Cold start: `cd koordi && node src/cli.mjs status`. +18. **yuhm THE MISSION and gatherings, plans and demo, 2026-09-19 to 20.** An opt-in game layer for people who want to help (routes, small tasks, seeds, weekly rhythm, a circle goal, no leaderboard; food seekers never see game UI) and a gatherings beta that starts with a food prep gathering. Money for gatherings settles directly between people, ticked off by hand; HAND holds no money. Plans `plans/004-yuhm-the-mission.md` and `plans/005-yuhm-gatherings-koord.md`. Nothing built; decisions wait on koH. +19. **Docs program, SEO tool, OmniOne scan, 2026-09-30 to 10-01.** A review of everything HAND has published, kept as internal docs under `docs/closed/` (ignored by git, because this repo is public), with page wireframes and a capture tool at `docs/tools/`. A client SEO tool, `.claude/skills/hand-client-seo/` (86 checks, a stage menu from basic setup to Search Console); Three Hands Healing scored 96 (A). A full scan of omnione.world for a planned redesign, in `omnione/` (redesign not started). +20. **yuhm pickup runs, 2026-09-30 to 10-06 (built, not live).** A run sheet for someone who picks food up and shares it out to several families: portions per family, who to contact, a per-family checklist, check-offs and seeds. Walked end to end in a browser on the `agent/yuhm-network` branch. Migration 050 is not applied and nothing is deployed. Plan `plans/006`; resume from `yuhm/_handoff-2026-09-30-pickup-runs.md`. +21. **Three Hands Healing on its own domain, 2026-10-06.** Maria's practice site is live at [3handshealing.com](https://3handshealing.com) on the owner-editable engine, with practice pages for body, mind and pets and Calendly booking. Her Google Workspace mail survived the nameserver move (records restored the same day). Read `clients/three-hands-healing/HANDOFF.md` first. +22. **yuhm sign-in fixed and auth email moved to Resend, 2026-10-06.** Sign-up had broken because email confirmation was switched on in the shared Supabase project; it is off again. Auth emails (password resets) now send through Resend as Yuhm Network with branded templates, instead of Supabase's two-per-hour mailer. +23. **Mystic Hearts site in the repo, 2026-10-06.** The site source now lives at `mystichearts/`; the public landing is two slides (the future village, "Coming fall 2027" with a way to get in touch) and the fuller demo sits behind the gate. +24. **SolarPunk Summit driver sign-up, 2026-10-06.** [sps.handprotocol.org](https://sps.handprotocol.org): volunteer drivers mark which airport runs they can drive; the transport team gets an email on every change. Behind an access code, no passenger details on the page. Source `solarpunk/`; a driver portal is planned in `solarpunk/PLAN-driver-portal.md`. +25. **FlowB switched off, 2026-10-13.** Its Fly app is scaled to zero; koordi takes over its people-coordination and event features. Do not restart it to check something. +26. **PrecisionFix on the owner's own accounts, 2026-10-14 to 23.** The site moved to the owner's own Netlify account and domain, [precisionfixmobile.com](https://precisionfixmobile.com), and now deploys itself on every push to the public repo `HandProtocol/precisionfix-mobile`. Deposit wording stays hidden until a Stripe key exists. 2026-10-15: the owner's admin became one portal (Home first, a small menu, a phone dock) with a Payments screen where the owner pastes a Stripe key and the site sets up the rest (engine change, migration 054). 2026-10-23: mail sends from the shop's own domain to the shop's inbox; customers can ask questions before booking through an account and a conversation thread (migration 056); editors can add a password next to the email link (engine change, migration 055). Read `clients/precisionfix/HANDOFF.md` first. +27. **Legacy Care: babysitting and childcare, 2026-10-23.** The in-home care site at [legacycare.llc](https://legacycare.llc) (owner-editable since 2026-09-11) now offers babysitting and childcare, with rates and design from the owner's flyer, in English and Spanish. +28. **Abuse limits on the public forms, 2026-10-23.** After an automated probe sent dozens of notes through the feedback form in half an hour (each one an email), the site's functions got durable limits: per-visitor and site-wide caps on feedback, a daily cap on feedback emails, and a site-wide daily email cap that protects the shared Resend quota. Migration 057 is applied; the code waits for its push to `main`. Details in `DEPLOY.md` under "Function limits". ## Active surfaces @@ -28,17 +59,41 @@ HAND Protocol Foundation is preparing to file as a 501(c)(3) in Austin, Texas, t | `web/sovereign-reciprocates/` | AI workstream public page. Reuses discovery design system. | Live | | `web/governance/` | Governance hub. Reuses discovery design system + own style.css. | Live | | `web/donate-crypto/` | Dedicated crypto-donation page. Crypto demoted from main campaign. | Live | +| `web/learn/` | HAND Learn: a nine-module "build your first app with Claude Code" course with accounts, progress and a coach dashboard. Unlinked from the public nav. | Live | +| `web/project//` | Client design previews and pick-one style galleries (Courtney, Untouchable Freedom, (Sub)culture Audio, Legacy Care's first page). All noindex. | Live | +| `yuhm/` | yuhm, Austin food coordination app, at yuhm.handprotocol.org. Manual CLI deploy. | Live | +| `waterdrop/` | WaterDrop, Central Texas paddling app, at waterdrop.handprotocol.org. Deploys from `main`. | Live | +| `projects/waterfall/` | HAND as a 3D waterfall, at waterfall.handprotocol.org. Manual CLI deploy. | Live | +| `solarpunk/` | SolarPunk Summit driver sign-up, at sps.handprotocol.org. Manual CLI deploy. | Live | +| `mystichearts/` | Mystic Hearts website source; built output served under `web/mystichearts/`. | Live (landing), demo gated | +| `clients//` | Owner-editable client sites, each on its own Netlify site (table below). | Live | +| `koordi/` | Booking and coordination service. Private repo, nested here and ignored. | Staging on the VPS | | `web/legacy/` | Archive of HAND's earlier landing-page and crowdfunding designs. Intentionally preserved with original $600 / $12K / $56K tiers as historical record. Do not update. | Live | | `web/landingpage/` | Pre-pivot Next.js Web3 starter homepage. | Preserved, not deployed | | `sweetspot/` | SweetSpot dApp + Solidity contracts + subgraph indexer. | Preserved, not deployed | +**Client sites on the owner-editable engine** (`clients/_template` + the `hand-client-site` skill): + +| Site | Address | Notes | +|---|---|---| +| Three Hands Healing | [3handshealing.com](https://3handshealing.com) | Healing practice. Calendly booking. | +| Legacy Care LLC | [legacycare.llc](https://legacycare.llc) | In-home senior care, babysitting and childcare. | +| PrecisionFix | [precisionfixmobile.com](https://precisionfixmobile.com) | Mobile Mercedes mechanic. On the owner's own Netlify; booking calendar, questions, payments screen. Deploys from its own public repo. | +| ZeroBlur | zeroblur.netlify.app | The hand-built original the engine came from. No custom domain yet. | +| Long Horn Wine Tours | longhornwinetours.com | koH's own business; own repo outside this one. | + ## Workstreams in motion - **Foundation filing raise.** Primary public ask. $222,222 first goal, $77,444 operating minimum, $22,777 filing floor. Campaign at `/foundation-campaign/`. See `PRODUCT.md` for strategic context. - **Sovereign Reciprocates (AI).** Three-phase build: $11,113 POC, $99,777 pilot, $333,223 production. Open source by default; per-group ownership; eight sovereignty principles. McGovern LOI drafted. See `AI-RECIPROCATES.md` and `AI-EVAL-FRAMEWORK.md`. - **Governance.** Pre-incorporation publication of bylaws, policies, and grants kit. Board prospect brief in `governance/board/`. Compliance calendar in `governance/COMPLIANCE-CALENDAR.md`. - **Mailing list.** Resend Audiences integration via Netlify Function (`netlify/functions/subscribe.js`). Live on `/foundation-campaign/#stay-close`. Audience UUID env var pending. See TODO. +- **GoFundMe channel.** Documentation-only so far, at `docs/closed/funding/gofundme-setup.md` (kept out of git). Covers why GoFundMe (parallel individual-giving channel, not a replacement for the filing raise), the pre-501(c)(3) non-deductibility constraint and required disclosure, GoFundMe's actual mechanics (fees, payout timing, identity verification), a setup checklist, and open questions (fiscal sponsor as charity-of-record, goal framing, personal-account commingling). Nothing published yet. - **Discovery iteration.** Living documents. Open-question pattern is being normalized. See TODO. +- **yuhm.** Live food finder plus coordinator tools. In motion: the pickup-run tool (built on `agent/yuhm-network`, migration 050 not applied, not deployed), THE MISSION game layer and the gatherings beta (plans 004 and 005, waiting on koH's decisions). See `yuhm/HANDOFF.md`. +- **koordi.** Booking and coordination service on the VPS in staging. Before a real tenant: database logins, production mode with its own send-only email key, a heartbeat alert. Its handoff is `koordi/HANDOFF.md`. +- **Docs program.** Internal review of everything HAND has published, a FAQ fact base, wireframes, and an onboarding funnel. Lives in `docs/closed/` (never committed). Resume from `docs/closed/HANDOFF.md`. +- **Owner-editable client sites (Develop pillar).** Five live instances on the shared engine (table above). Per-client state lives in `clients//HANDOFF.md`; engine fixes go through `clients/_template` + `sync-engine.mjs`, never inside a client. The engine now has a Home-first admin portal, a Setup tab of buttons, a booking calendar, an owner-connected Stripe screen, and optional password sign-in. Engine changes that add database columns need their migration applied on each live site before the sync. None of `clients/` is committed in this repo. ## Active funding ladder @@ -47,7 +102,7 @@ HAND Protocol Foundation is preparing to file as a 501(c)(3) in Austin, Texas, t - $77,444, operating minimum (heritage 77 + foundation/stability 444) - $222,222, first goal (pure angel destination) -**Sovereign Reciprocates** (anchored angels with asymmetric tails — parallel AI-funder asks): +**Sovereign Reciprocates** (anchored angels with asymmetric tails, the parallel AI-funder asks): - $11,113, POC (folded into the $222,222 filing-raise goal) - $99,777, one-year pilot (anchor + heritage-777 tail) - $333,223, production layer (the McGovern target; the 223 tail refuses to round) @@ -67,6 +122,12 @@ If you change any of these, update: `web/foundation-campaign/index.html`, `web/l - **Discovery research (40+ peer orgs, 6 skill-exchange categories, gap analysis):** `web/discovery/`. - **Governance package (bylaws, policies, grants kit):** `governance/`. - **AI workstream:** `AI-RECIPROCATES.md` (one-pager), `AI-EVAL-FRAMEWORK.md` (six-dimension eval), `funding/mcgovern-letter.md` (LOI). +- **yuhm (ex WXL):** `yuhm/HANDOFF.md`, then the dated `yuhm/_handoff-*.md` for the thread you are resuming; living docs at `yuhm/docs/LIVING-DOCS.md`; plans `plans/004` to `006`. +- **koordi:** `koordi/HANDOFF.md`, or `cd koordi && node src/cli.mjs status`. +- **Smaller live tools:** `solarpunk/HANDOFF.md` (driver sign-up), `mystichearts/` (site source), `projects/waterfall/README.md`, `waterdrop/`. +- **Client SEO:** `.claude/skills/hand-client-seo/HANDOFF.md`. +- **Internal docs (not in git):** `docs/closed/`. This repo is public, so internal state, people's contact details and anything sensitive go there, never in a tracked file. +- **Client-site engine (owner-editable sites):** `clients/_template/HANDOFF.md` (the engine's own handoff: what shipped 2026-09-16, live state per client, how to verify the Setup tab, uncommitted state, open decisions), `clients/_template/README.md` (architecture), `.claude/skills/hand-client-site/SKILL.md` (phases, scripts, opt-in engine features, instances table), `clients//HANDOFF.md` per client. PrecisionFix is the reference for the booking calendar, the admin portal, payments, customer questions and password sign-in. ## Open items worth knowing @@ -78,6 +139,12 @@ These are the load-bearing ones. Full list in `TODO.md`. - **Submit `sitemap.xml` to Google Search Console** once domain is fully canonical. - **Set up `hand@handprotocol.org` email forwarding** (ImprovMX or similar). - **Discovery iteration pass:** audit each doc for v0.1-sounding language; normalize the "Open question" pattern. +- **Ship the form abuse limits.** Migration 057 is applied; push the function changes and the widget to `main`. Then decide whether to lower Supabase's auth email limit (30 per hour today), which shares the same Resend daily quota. +- **Internal findings from the docs program** wait on koH; see `docs/closed/HANDOFF.md`. +- **yuhm pickup runs:** screen tests and entry links, then koH's go before applying migration 050 and deploying. +- **Booking calendar part 2** (customer reschedule, busy-calendar import) moved to koordi; the engine takes fixes only. +- **PrecisionFix follow-through:** the owner connects Stripe on the Payments screen (no real payment has run yet); reply-by-email for customer questions waits on Resend receiving for the shop's domain; delete the old interim site once koH says; lift the booking email polish into `clients/_template`. Ship by pushing its mirror repo; recipe in `clients/precisionfix/HANDOFF.md`. +- **Courtney (project `unfuckwithable`):** four-page site live on the Halo direction (cover, about, The Energetic Reset, Becoming Unfuckwithable), placeholder copy underlined in rose (`class="todo"`), buy buttons still `#checkout`; waiting on her copy for the about and main-course pages, the main-course price and both Kajabi checkout URLs; notes page for her at `/project/unfuckwithable/for-courtney/`; next task is the Kajabi upload prep (plan written 2026-09-18, not started). Details in `unfuckwithable/HANDOFF.md`. ## Conventions to honor diff --git a/README.md b/README.md index 0af7accd..b28bf611 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **HAND Protocol** (Holistic Approach to Nurture and Develop) is a nonprofit foundation incorporating as a 501(c)(3) in Austin, Texas in 2026. We provide long-term branding, marketing, web/dev, and one-on-one development support for **Reciprocates**, impact entrepreneurs, community-rooted small businesses, and grassroots community organizations doing work that matters. We don't build and bounce. -This monorepo holds the public web presence (foundation campaign + discovery research + legacy archive) and earlier Web3 tooling preserved as source history. +This monorepo holds the public web presence (foundation campaign + discovery research + legacy archive), HAND's community tools and Develop client sites, and earlier Web3 tooling preserved as source history. ## Surfaces @@ -15,6 +15,13 @@ This monorepo holds the public web presence (foundation campaign + discovery res | [`web/sovereign-reciprocates/`](web/sovereign-reciprocates/) | Sovereign Reciprocates: HAND's AI workstream as a public page. Reuses the discovery design system. | Live in source | | [`web/governance/`](web/governance/) | Governance package: Articles, Bylaws, all policies, board governance, theory of change, strategic plan, Form 1023 narrative. | Live in source | | [`web/legacy/`](web/legacy/) | Archive of HAND's earlier landing-page and crowdfunding designs. | Live in source | +| [`web/learn/`](web/learn/) | HAND Learn: a nine-module course on building a first app with Claude Code. | Live, unlisted | +| [`yuhm/`](yuhm/) | yuhm, Austin food coordination app ([yuhm.handprotocol.org](https://yuhm.handprotocol.org)). | Live | +| [`waterdrop/`](waterdrop/) | WaterDrop, Central Texas paddling app ([waterdrop.handprotocol.org](https://waterdrop.handprotocol.org)). | Live | +| [`solarpunk/`](solarpunk/) | SolarPunk Summit volunteer driver sign-up ([sps.handprotocol.org](https://sps.handprotocol.org)). | Live | +| [`mystichearts/`](mystichearts/) | Mystic Hearts website source. | Live (landing) | +| [`projects/waterfall/`](projects/waterfall/) | HAND as a 3D waterfall ([waterfall.handprotocol.org](https://waterfall.handprotocol.org)). | Live | +| `clients/` | Owner-editable websites for Develop clients, each deployed to its own Netlify site and domain. | Live, not in git yet | | [`web/landingpage/`](web/landingpage/) | Pre-pivot Next.js Web3 starter homepage. | Preserved, not deployed | | [`sweetspot/`](sweetspot/) | SweetSpot dApp + Solidity contracts + subgraph indexer. | Preserved, not deployed | | [`projects/spin/`](projects/spin/) | Vite + React + TS sub-project. | Standalone | @@ -66,4 +73,4 @@ Pre-incorporation. The foundation campaign is currently raising toward a $222,22 --- -Based in Austin, Texas. Operating since 2025. +Based in Austin, Texas. Operating since August 2024. diff --git a/TODO.md b/TODO.md index 3d5238b6..aed75443 100644 --- a/TODO.md +++ b/TODO.md @@ -4,6 +4,11 @@ A working list of what's next for the public website. Items added at the bottom; ## Now +- [x] **Push the form abuse limits to `main`** (landed 26c87d484, 2026-10-24) (feedback, intake, `_email.js`, `_ratelimit.js`, the feedback widget at `?v=2`). Migration 057 is already applied. After the deploy, send one real note from a page with the widget and confirm it lands on `/pins`. +- [ ] **Decide the auth email limit.** Supabase sends yuhm auth mail through Resend at up to 30 per hour, enough to use up Resend's 100-a-day quota on its own. Lowering it protects the quota but can slow real sign-ups. +- [ ] **Act on the internal findings from the docs program** (`docs/closed/HANDOFF.md`, kept out of git on purpose). +- [ ] **yuhm pickup runs:** screen tests, entry links, then koH's go to apply migration 050 and deploy. +- [ ] **Set up the GoFundMe fundraiser.** Working doc at `docs/closed/funding/gofundme-setup.md` (kept out of git) covers mechanics, the pre-501(c)(3) non-deductibility disclosure, organizer identity (default: Russell Herod), and the setup checklist. Nothing is live yet; this is documentation of the process so setup can proceed deliberately. - [ ] **Create the Resend audience** (via `POST /audiences` or dashboard), copy the UUID, and `netlify env:set RESEND_AUDIENCE_ID ` in production scope. Single opt-in: contacts join immediately, no confirmation email. Resend still adds the unsubscribe link to every audience send. - [ ] **Rotate the Resend API key.** The key was sent through chat (twice) and is now in conversation logs + this session's bash command history. The current key works and is set in Netlify env vars (`RESEND_API_KEY`, production scope). After rotating at resend.com/api-keys, update the Netlify env var via `netlify env:set RESEND_API_KEY ` from this directory (already linked), then trigger a redeploy. - [ ] **Smoke-test the live subscribe flow** after redeploy: submit on `/foundation-campaign/#stay-close`, confirm the contact appears in the Resend audience with `unsubscribed: false`. @@ -17,6 +22,11 @@ A working list of what's next for the public website. Items added at the bottom; - [ ] Tighten copy that says "operating for over a year" to reflect the actual August 2024 start (≈21 months as of May 2026). Hero badge, About section, Discovery hub lede, Backstory section, and the new `/donate-crypto/` page all carry this phrasing. - [ ] Consider scroll-spy `aria-current` on the campaign's anchor-link nav so screen-reader users get the same "you are here" signal that the discovery subnav pills already provide. - [ ] Submit `sitemap.xml` to Google Search Console after the canonical domain is live. +- [ ] PrecisionFix: the owner connects Stripe on the Payments screen; turn on reply-by-email for customer questions once Resend receiving is set up on the shop's domain; delete the old interim Netlify site when koH says; lift the booking email polish into `clients/_template`. +- [ ] Sync the engine's password sign-in (2026-10-23) to Three Hands Healing and Legacy Care: apply `gen-migration.mjs --passwords` on each live site first, then sync. +- [ ] SolarPunk driver portal (plan and seven open questions in `solarpunk/PLAN-driver-portal.md`). +- [ ] koordi before a real tenant: database logins, production mode with its own send-only email key, heartbeat alert (`koordi/docs/ops/vps-deployment.md`). +- [ ] yuhm THE MISSION and gatherings: koH's open decisions at the end of `plans/004` and `plans/005`. - [ ] Set up `hand@handprotocol.org` email forwarding (ImprovMX / ForwardEmail / registrar forwarding). - [ ] Install privacy-respecting analytics (Plausible Community Edition or Fathom), covered in `DEPLOY.md`. @@ -26,6 +36,18 @@ A working list of what's next for the public website. Items added at the bottom; ## Done (recent) +- **Form abuse limits built** (2026-10-23): durable counter (migration 057, applied), per-visitor and site-wide limits on feedback, daily caps on feedback emails and on all site email. Code waiting on its push (see Now). +- **Legacy Care: babysitting and childcare live** (2026-10-23) at legacycare.llc. +- **PrecisionFix**: moved to the owner's own Netlify, domain and auto-deploying public repo (2026-10-14); admin portal and Payments screen (2026-10-15, migration 054); shop-domain email, customer questions (migration 056) and editor passwords (migration 055) (2026-10-23). +- **FlowB switched off** (2026-10-13); koordi replaces it. +- **koordi running in staging** at koordi.handprotocol.org (2026-10-13). +- **Three Hands Healing live at 3handshealing.com** (2026-10-06). +- **yuhm sign-in fixed; auth email through Resend** (2026-10-06). +- **SolarPunk Summit driver sign-up live** at sps.handprotocol.org (2026-10-06). +- **Mystic Hearts site source in the repo; two-slide landing live** (2026-10-06). +- **Client SEO tool** `hand-client-seo` (2026-09-30 to 10-01); Three Hands Healing scored 96. +- **(Sub)culture Audio three-theme portfolio** (2026-09-17). +- **Booking calendar phase 1 and phase 2 part 1 live on PrecisionFix** (2026-09-16 to 17, migrations 047 and 048). - **Demoted crypto donation from full campaign section to dedicated `/donate-crypto/` page** (2026-05-12). Campaign no longer reads as crypto-focused. Two small inline references remain: a one-line "send crypto directly" link in the tiers note, and a one-line "Crypto-native? Send directly to our wallets" line below the Final CTA buttons. Footer Support col + `/crypto` redirect point at the new page. - **Built `#stay-close` mailing-list section + `netlify/functions/subscribe.js`** (2026-05-12). Asymmetric 2-col at ≥768px, email + name + audience radio pills, honeypot, all five states (default / submitting / success / error / already-subscribed). Server-side validation + Resend Audiences API integration. Single opt-in. Needs `RESEND_AUDIENCE_ID` env var set before live use. - **Custom domain `handprotocol.org` live on Netlify** (2026-05-12). Nameservers on Netlify DNS, A records `98.84.224.111` / `18.208.88.157`, all 17 routes 200, OG image and sitemap resolving at the canonical domain. The OG meta tags now work everywhere. diff --git a/docs/tools/build.mjs b/docs/tools/build.mjs new file mode 100644 index 00000000..e19f12c6 --- /dev/null +++ b/docs/tools/build.mjs @@ -0,0 +1,341 @@ +#!/usr/bin/env node +// Build the HAND docs site: static HTML that opens straight from disk. +// +// node docs/tools/build.mjs +// +// Reads docs/closed/*.md, docs/closed/{research,onboarding}/*.md, docs/certified/*.md, +// and the wireframe data in docs/closed/wireframes/ (capture.mjs writes layout, svg, shots; +// pages/*.json and routes.json are the written annotations). +// Writes docs/closed/site/ (inside the self-ignoring closed folder, so it cannot be committed). +// +// No dependencies. Markdown is converted by the small converter in lib/markdown.mjs. + +import fs from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { renderMarkdown, escapeHtml, slugify } from './lib/markdown.mjs' + +const HERE = path.dirname(fileURLToPath(import.meta.url)) +const ROOT = path.resolve(HERE, '../..') +const CLOSED = path.join(ROOT, 'docs/closed') +const CERTIFIED = path.join(ROOT, 'docs/certified') +const WIRE = path.join(CLOSED, 'wireframes') +const OUT = path.join(CLOSED, 'site') +const SNIPPET_LENGTH = 1400 + +const GROUPS = [ + { title: 'Start here', test: (n) => ['00', '21', '40'].includes(n) }, + { title: 'The organization', test: (n) => n >= '01' && n <= '04' }, + { title: 'The main site', test: (n) => n >= '05' && n <= '09' }, + { title: 'What HAND has built', test: (n) => n >= '10' && n <= '20' }, + { title: 'Audits', test: (n) => n >= '30' && n <= '39' }, +] + +const readJson = (file) => (fs.existsSync(file) ? JSON.parse(fs.readFileSync(file, 'utf8')) : null) +const listFiles = (dir, ext) => (fs.existsSync(dir) ? fs.readdirSync(dir).filter((f) => f.endsWith(ext)).sort() : []) + +// ---------- collect the documents ---------- + +function loadDoc(file, kind, group) { + const source = fs.readFileSync(file, 'utf8') + const base = path.basename(file, '.md') + const rendered = renderMarkdown(source) + return { + file, kind, group, base, source, + out: `${kind === 'certified' ? 'c' : 'd'}-${slugify(base)}.html`, + title: rendered.title || base, + words: source.split(/\s+/).length, + modified: fs.statSync(file).mtime, + } +} + +function collectDocs() { + const numbered = listFiles(CLOSED, '.md').filter((f) => /^\d\d-/.test(f)).map((f) => { + const n = f.slice(0, 2) + const group = GROUPS.find((g) => g.test(n)) + return loadDoc(path.join(CLOSED, f), 'closed', group ? group.title : 'Other') + }) + const extra = ['research', 'onboarding'].flatMap((dir) => + listFiles(path.join(CLOSED, dir), '.md').map((f) => loadDoc(path.join(CLOSED, dir, f), 'closed', 'Research and specs'))) + const handoff = fs.existsSync(path.join(CLOSED, 'HANDOFF.md')) ? [loadDoc(path.join(CLOSED, 'HANDOFF.md'), 'closed', 'Program')] : [] + const certified = listFiles(CERTIFIED, '.md').map((f) => loadDoc(path.join(CERTIFIED, f), 'certified', 'Certified set')) + return [...numbered, ...extra, ...certified, ...handoff] +} + +// ---------- wireframe data ---------- + +function collectPages() { + const summary = readJson(path.join(WIRE, 'layout/_summary.json')) + if (!summary) return { capturedFrom: 'not captured yet', pages: [] } + const pages = summary.pages.map((page) => ({ + ...page, + out: `w-${page.slug}.html`, + annotation: readJson(path.join(WIRE, 'pages', `${page.slug}.json`)), + layout: { + desktop: readJson(path.join(WIRE, 'layout', `${page.slug}.desktop.json`)), + phone: readJson(path.join(WIRE, 'layout', `${page.slug}.phone.json`)), + }, + })) + return { capturedFrom: summary.captured_from, pages } +} + +// ---------- page shell ---------- + +function navHtml(docs, pages, current) { + const order = [...GROUPS.map((g) => g.title), 'Wireframes', 'Research and specs', 'Certified set', 'Other', 'Program'] + const item = (href, label, badge = '') => `
  • ${escapeHtml(label)}${badge}
  • ` + const groups = order.map((title) => { + if (title === 'Wireframes') { + const items = [item('wireframes.html', 'Main site wireframes'), ...pages.map((p) => item(p.out, p.path))] + return `

    Wireframes

      ${items.join('')}
    ` + } + const items = docs.filter((d) => d.group === title).map((d) => item(d.out, d.title.replace(/^(\d\d)\. /, '$1 '))) + return items.length ? `

    ${title}

      ${items.join('')}
    ` : '' + }) + return `
      ${item('index.html', 'Overview')}
    ${groups.join('')}` +} + +function shell({ title, kind, body, toc = '', nav, current }) { + const badge = kind === 'certified' + ? `Certified set` + : `Closed` + return ` + + + + + +${escapeHtml(title)} · HAND docs + + + + + + + +
    + + HAND docs + ${badge} + +
    +
    + +
    ${body}
    + ${toc ? `` : ''} +
    + + + + +` +} + +const tocHtml = (headings) => { + const items = headings.filter((h) => h.level === 2) + return items.length > 1 ? `` : '' +} + +// ---------- document pages ---------- + +function docPage(doc, linkFor) { + const rendered = renderMarkdown(doc.source, { linkFor }) + const meta = `

    ${doc.kind === 'certified' ? 'docs/certified' : 'docs/closed'}/${escapeHtml(path.relative(doc.kind === 'certified' ? CERTIFIED : CLOSED, doc.file))} · ${doc.words.toLocaleString('en-US')} words · file last changed ${doc.modified.toISOString().slice(0, 10)}

    ` + return { body: `
    ${meta}${rendered.html}
    `, toc: tocHtml(rendered.headings), sections: rendered.sections } +} + +// ---------- wireframe pages ---------- + +function matchLayoutSection(annotation, layoutSections) { + const id = String(annotation.id || '').replace(/^~/, '') + const byId = layoutSections.find((s) => s.id && s.id === id) + if (byId) return byId + const selector = String(annotation.selector || '') + const tag = selector.match(/^(nav|footer|header|main)\b/) + return tag ? layoutSections.find((s) => s.tag === tag[1]) || null : null +} + +function bandsHtml(layout, slug, viewport) { + if (!layout) return `

    Not captured for this viewport.

    ` + const bands = layout.sections.map((s) => { + const top = (s.box.y / layout.height) * 100 + const height = (Math.max(s.box.h, 24) / layout.height) * 100 + const label = s.heading || s.id || s.tag + return `${s.n}` + }).join('') + return `
    Wireframe of ${escapeHtml(layout.path)} at ${layout.width} pixels wide${bands}
    ` +} + +const listHtml = (items, cls = '') => (items && items.length ? `
      ${items.map((i) => `
    • ${escapeHtml(i)}
    • `).join('')}
    ` : '') + +function annotationHtml(section, number) { + const ctas = (section.ctas || []).map((c) => `
  • ${escapeHtml(c.label)} ${escapeHtml(c.href)}
  • `).join('') + const forms = (section.forms || []).map((f) => `

    Form ${escapeHtml(f.id || '')} sends to ${escapeHtml(f.submits_to || '')}

    ${(f.fields || []).map((x) => ``).join('')}
    FieldLabelTypeRequired
    ${escapeHtml(x.name)}${escapeHtml(x.label)}${escapeHtml(x.type)}${x.required ? 'yes' : 'no'}
    ${f.states && f.states.length ? `

    States: ${escapeHtml(f.states.join(' · '))}

    ` : ''}
    `).join('') + return `
    +
    ${number || '·'}

    ${escapeHtml(section.kind || '')}${section.eyebrow ? ` · ${escapeHtml(section.eyebrow)}` : ''}

    ${escapeHtml(section.heading || section.id || '(no heading)')}

    + ${section.what_it_says ? `

    ${escapeHtml(section.what_it_says)}

    ` : ''} + ${section.job ? `

    Its job: ${escapeHtml(section.job)}

    ` : ''} + ${section.elements && section.elements.length ? `
    What is in it (${section.elements.length})${listHtml(section.elements)}
    ` : ''} + ${ctas ? `

    Calls to action

      ${ctas}
    ` : ''} + ${forms} + ${section.facts && section.facts.length ? `
    Checkable facts stated here (${section.facts.length})${listHtml(section.facts)}
    ` : ''} + ${section.notes ? `

    Notes: ${escapeHtml(section.notes)}

    ` : ''} +
    ` +} + +function layoutOnlyHtml(section) { + const links = (section.links || []).slice(0, 12).map((l) => `
  • ${escapeHtml(l.text)} ${escapeHtml(l.href)}
  • `).join('') + return `
    ${section.n}

    ${escapeHtml(section.tag)}${section.eyebrow ? ` · ${escapeHtml(section.eyebrow)}` : ''}

    ${escapeHtml(section.heading || section.id || section.tag)}

    ${links ? `

    Links

      ${links}
    ` : ''}
    ` +} + +function wireframePage(page) { + const a = page.annotation + const desktop = page.layout.desktop + const sections = a + ? a.sections.map((s) => { const m = desktop ? matchLayoutSection(s, desktop.sections) : null; return annotationHtml(s, m ? m.n : null) }).join('') + : (desktop ? desktop.sections.map(layoutOnlyHtml).join('') : '') + const facts = [ + ['Address', `${escapeHtml(page.path)}`], + ['Source', a ? `${escapeHtml(a.source_file)}` : 'not annotated yet'], + ['Status', a ? escapeHtml(a.status) : escapeHtml(page.group)], + ['In sitemap', a ? (a.in_sitemap ? 'yes' : 'no') : 'unknown'], + ['Robots', a ? escapeHtml(a.robots || 'none stated') : escapeHtml((desktop && desktop.robots) || 'none stated')], + ['Gate', a && a.gate ? escapeHtml(typeof a.gate === 'string' ? a.gate : JSON.stringify(a.gate)) : 'none'], + ['Audiences', a ? escapeHtml((a.audiences || []).join(', ')) : ''], + ['Length', ['desktop', 'phone'].map((v) => page.views[v] ? `${v} ${page.views[v].height.toLocaleString('en-US')} px (${page.views[v].screens} screens)` : '').filter(Boolean).join(' · ')], + ].filter(([, v]) => v) + const issues = a && a.issues && a.issues.length + ? `

    Issues found on this page

    ${[...a.issues].sort((x, y) => 'hml'.indexOf(String(x.severity)[0]) - 'hml'.indexOf(String(y.severity)[0])).map((i) => ``).join('')}
    SeverityIssueEvidence
    ${escapeHtml(i.severity)}${escapeHtml(i.issue)}${escapeHtml(i.evidence || '')}
    ` : '' + const scripts = a && a.scripts && a.scripts.length + ? `

    Scripts

    ${a.scripts.map((s) => ``).join('')}
    FileWhat it does
    ${escapeHtml(s.file)}${escapeHtml(s.does)}
    ` : '' + const body = `
    +

    Wireframe · measured from the deployed commit

    +

    ${escapeHtml(a ? a.title : page.title || page.path)}

    + ${a && a.purpose ? `

    ${escapeHtml(a.purpose)}

    ` : ''} +
    ${facts.map(([k, v]) => `
    ${k}
    ${v}
    `).join('')}
    +
    +
    +
    + + +
    +
    ${bandsHtml(page.layout.desktop, page.slug, 'desktop')}
    + +

    Screenshots: desktop · phone. Numbers are the page's sections, top to bottom.

    +
    +

    Sections

    ${sections}
    +
    + ${issues}${scripts} +
    ` + return { body, toc: '', sections: [{ id: '', heading: a ? a.title : page.path, text: a ? [a.purpose, ...a.sections.map((s) => `${s.heading} ${s.what_it_says || ''} ${(s.facts || []).join(' ')}`)].join(' ') : '' }] } +} + +function routesHtml(routes) { + if (!routes) return '' + const cell = (v) => escapeHtml(Array.isArray(v) ? v.join(', ') : v == null ? '' : String(v)) + const table = (head, rows) => `
    ${head.map((h) => ``).join('')}${rows.map((r) => `${r.map((c) => ``).join('')}`).join('')}
    ${h}
    ${c}
    ` + return `

    Gates

    + ${table(['Paths', 'Edge function', 'How it checks', 'Env vars (names only)', 'When the env var is unset'], routes.gates.map((g) => [`${cell(g.paths)}`, cell(g.edge_function), cell(g.mechanism), `${cell(g.env_vars)}`, cell(g.behaviour_when_env_unset)]))} +

    Functions

    + ${table(['Function', 'Methods', 'Purpose', 'Called from', 'Writes to', 'Notifies', 'Abuse protection'], routes.functions.map((f) => [`${cell(f.name)}`, cell(f.methods), cell(f.purpose), cell(f.called_from), cell(f.writes_to), cell(f.notifies), cell(f.spam_protection)]))} +

    Redirects (${routes.redirects.length})

    +
    Show every redirect${table(['From', 'To', 'Status', 'Defined in'], routes.redirects.map((r) => [`${cell(r.from)}`, `${cell(r.to)}`, cell(r.status), cell(r.defined_in)]))}
    +

    Headers

    + ${table(['For', 'Sets'], routes.headers.map((h) => [`${cell(h.for)}`, cell(h.sets)]))}` +} + +function linkMapHtml(pages) { + const internal = (href) => /^(\/|\.\.?\/|#)/.test(String(href)) + const rows = pages.filter((p) => p.annotation).map((p) => { + const links = new Map() + for (const s of p.annotation.sections) for (const c of s.ctas || []) { + if (!internal(c.href) || String(c.href).startsWith('#')) continue + links.set(c.href, [...(links.get(c.href) || []), c.label]) + } + const out = [...links.entries()].map(([href, labels]) => `
  • ${escapeHtml(href)} ${escapeHtml([...new Set(labels)].slice(0, 3).join(' · '))}
  • `).join('') + return `${escapeHtml(p.path)}${out ? `
      ${out}
    ` : 'no internal links out of its sections'}` + }).join('') + return `
    ${rows}
    PageWhere its calls to action lead (inside the site)
    ` +} + +function wireframesHub(data, linkFor) { + const journeysFile = path.join(WIRE, 'journeys.md') + const journeys = fs.existsSync(journeysFile) ? renderMarkdown(fs.readFileSync(journeysFile, 'utf8'), { linkFor, headingShift: 1 }).html : '' + const rows = data.pages.map((p) => { + const a = p.annotation + const high = a ? (a.issues || []).filter((i) => String(i.severity).startsWith('high')).length : 0 + return `${escapeHtml(p.path)}${escapeHtml(a ? a.status : p.group)}${escapeHtml(a ? a.purpose : 'not annotated yet')}${p.views.desktop ? p.views.desktop.sections : ''}${p.views.desktop ? p.views.desktop.screens : ''}${p.views.phone ? p.views.phone.screens : ''}${a ? (a.issues || []).length : ''}${high ? ` ${high} high` : ''}` + }).join('') + const body = `
    +

    Wireframe doc · captured from ${escapeHtml(data.capturedFrom)}

    +

    Main site wireframes

    +

    Every page of handprotocol.org that a visitor can reach from the navigation, measured from the commit that is deployed, with what each section says, what it is for, where each button goes, and what is wrong with it.

    +

    Pages

    +
    ${rows}
    PageStatusWhat it is forSectionsDesktop screensPhone screensIssues
    +

    A screen is 900 px on desktop and 844 px on a phone. Status words are defined in the overview.

    + ${journeys} + + ${linkMapHtml(data.pages)} + ${routesHtml(readJson(path.join(WIRE, 'routes.json')))} +
    ` + return { body, sections: [{ id: '', heading: 'Main site wireframes', text: 'wireframes pages journeys gates functions redirects headers' }] } +} + +// ---------- overview ---------- + +function overviewPage(docs, data, linkFor) { + const indexDoc = docs.find((d) => d.base.startsWith('00-')) + const intro = indexDoc ? renderMarkdown(indexDoc.source, { linkFor }).html : `

    HAND docs

    The internal record of everything HAND Protocol has built, what is public, and what is waiting on a decision.

    ` + const rows = docs.filter((d) => d !== indexDoc).map((d) => `${escapeHtml(d.title)}${escapeHtml(d.group)}${d.words.toLocaleString('en-US')}${d.modified.toISOString().slice(0, 10)}`).join('') + const body = `
    ${intro} +

    All documents

    +
    ${rows}
    DocumentGroupWordsFile changed
    Main site wireframesWireframes${data.pages.length} pages
    +
    ` + return { body } +} + +// ---------- write ---------- + +function build() { + const docs = collectDocs() + const data = collectPages() + const byName = new Map(docs.flatMap((d) => [[path.basename(d.file), d.out], [d.base, d.out]])) + const linkFor = (name) => byName.get(path.basename(String(name))) || null + const nav = navHtml(docs, data.pages, '') + const searchIndex = [] + const write = (file, html) => fs.writeFileSync(path.join(OUT, file), html) + const addToIndex = (file, title, sections) => { + for (const s of sections || []) searchIndex.push({ p: file, t: title, h: s.heading, a: s.id, x: s.text.replace(/\s+/g, ' ').slice(0, SNIPPET_LENGTH) }) + } + + fs.mkdirSync(path.join(OUT, 'assets'), { recursive: true }) + for (const f of listFiles(OUT, '.html')) fs.unlinkSync(path.join(OUT, f)) + + for (const doc of docs) { + if (doc.base.startsWith('00-')) continue + const page = docPage(doc, linkFor) + write(doc.out, shell({ title: doc.title, kind: doc.kind, body: page.body, toc: page.toc, nav, current: doc.out })) + addToIndex(doc.out, doc.title, page.sections) + } + for (const page of data.pages) { + const built = wireframePage(page) + write(page.out, shell({ title: `Wireframe ${page.path}`, kind: 'closed', body: built.body, nav, current: page.out })) + addToIndex(page.out, `Wireframe ${page.path}`, built.sections) + } + const hub = wireframesHub(data, linkFor) + write('wireframes.html', shell({ title: 'Main site wireframes', kind: 'closed', body: hub.body, nav, current: 'wireframes.html' })) + addToIndex('wireframes.html', 'Main site wireframes', hub.sections) + write('index.html', shell({ title: 'Overview', kind: 'closed', body: overviewPage(docs, data, linkFor).body, nav, current: 'index.html' })) + + for (const asset of ['site.css', 'site.js']) fs.copyFileSync(path.join(HERE, 'site-assets', asset), path.join(OUT, 'assets', asset)) + fs.writeFileSync(path.join(OUT, 'assets/search-index.js'), `window.HAND_DOCS_INDEX = ${JSON.stringify(searchIndex)};\n`) + + console.log(`Built ${docs.length} documents and ${data.pages.length} wireframe pages into ${path.relative(ROOT, OUT)}/`) + console.log(`Open ${path.join(OUT, 'index.html')}`) +} + +build() diff --git a/docs/tools/capture.mjs b/docs/tools/capture.mjs new file mode 100644 index 00000000..43a4ee9e --- /dev/null +++ b/docs/tools/capture.mjs @@ -0,0 +1,457 @@ +#!/usr/bin/env node +// Capture the rendered layout of HAND's public pages and turn it into wireframes. +// +// What it does, per page and per viewport (desktop 1440, phone 390): +// 1. serves the site exactly as committed on a git ref (default origin/main, which is what +// Netlify deploys), so the result matches the live site and never touches production; +// 2. loads the page in headless Chromium, with every call to a Netlify function stubbed out +// (no visit tracking, no form posts); +// 3. measures the real boxes: sections, headings, text, buttons, media, inputs, cards, tables; +// 4. writes layout JSON, a to-scale SVG wireframe, and a full-page screenshot. +// +// Usage: +// node docs/tools/capture.mjs all pages, from origin/main +// node docs/tools/capture.mjs --worktree use the working tree instead of a git ref +// node docs/tools/capture.mjs --ref some-branch +// node docs/tools/capture.mjs --only home,fiscal +// +// Output: docs/closed/wireframes/{layout,svg,shots}/..{json,svg,jpg} +// +// Chromium on this machine needs the sandbox off (AppArmor blocks unprivileged user namespaces). +// Playwright is imported from PLAYWRIGHT_MODULE, or from the gstack install, or from "playwright". + +import http from 'node:http' +import fs from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import { execFileSync, spawnSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' + +const HERE = path.dirname(fileURLToPath(import.meta.url)) +const ROOT = path.resolve(HERE, '../..') +const OUT = path.join(ROOT, 'docs/closed/wireframes') + +export const PAGES = [ + { slug: 'home', path: '/', group: 'core' }, + { slug: 'reciprocates', path: '/reciprocates/', group: 'core' }, + { slug: 'discovery', path: '/discovery/', group: 'core' }, + { slug: 'discovery-vision', path: '/discovery/skill-exchange-vision.html', group: 'core' }, + { slug: 'discovery-models', path: '/discovery/skill-exchange-models.html', group: 'core' }, + { slug: 'discovery-landscape', path: '/discovery/impact-org-landscape.html', group: 'core' }, + { slug: 'sovereign-reciprocates', path: '/sovereign-reciprocates/', group: 'core' }, + { slug: 'governance', path: '/governance/', group: 'core' }, + { slug: 'fiscal', path: '/fiscal/', group: 'core' }, + { slug: 'donate-crypto', path: '/donate-crypto/', group: 'core' }, + { slug: 'audio', path: '/audio/', group: 'core' }, + { slug: 'legacy', path: '/legacy/', group: 'core' }, + { slug: 'learn', path: '/learn/', group: 'core' }, + { slug: 'not-found', path: '/404.html', group: 'core' }, + { slug: 'reciprocates-preview-onboarding', path: '/reciprocates/preview-onboarding.html', group: 'unlisted' }, +] + +const EXPORT_PATHS = [ + 'web/assets', 'web/foundation-campaign', 'web/discovery', 'web/reciprocates', + 'web/sovereign-reciprocates', 'web/governance', 'web/fiscal', 'web/donate-crypto', + 'web/audio', 'web/legacy', 'web/learn', 'web/404.html', 'web/robots.txt', 'web/sitemap.xml', +] + +const VIEWPORTS = [ + { name: 'desktop', width: 1440, height: 900, scale: 0.5 }, + { name: 'phone', width: 390, height: 844, scale: 1 }, +] + +const args = process.argv.slice(2) +const flag = (name) => args.includes(name) +const opt = (name, fallback) => { + const i = args.indexOf(name) + return i >= 0 && args[i + 1] ? args[i + 1] : fallback +} + +const MIME = { + '.html': 'text/html; charset=utf-8', '.css': 'text/css; charset=utf-8', '.js': 'text/javascript; charset=utf-8', + '.mjs': 'text/javascript; charset=utf-8', '.json': 'application/json', '.svg': 'image/svg+xml', + '.png': 'image/png', '.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.webp': 'image/webp', '.gif': 'image/gif', + '.ico': 'image/x-icon', '.woff': 'font/woff', '.woff2': 'font/woff2', '.ttf': 'font/ttf', + '.mp3': 'audio/mpeg', '.m4a': 'audio/mp4', '.mp4': 'video/mp4', '.txt': 'text/plain; charset=utf-8', + '.xml': 'application/xml', '.md': 'text/markdown; charset=utf-8', '.glb': 'model/gltf-binary', +} + +function exportSite() { + if (flag('--worktree')) return { dir: path.join(ROOT, 'web'), ref: 'working tree', cleanup: () => {} } + const ref = opt('--ref', 'origin/main') + const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'hand-web-')) + const present = EXPORT_PATHS.filter((p) => spawnSync('git', ['cat-file', '-e', `${ref}:${p}`], { cwd: ROOT }).status === 0) + const tar = path.join(tmp, 'site.tar') + execFileSync('git', ['archive', '-o', tar, ref, ...present], { cwd: ROOT }) + execFileSync('tar', ['-xf', tar, '-C', tmp]) + fs.unlinkSync(tar) + const commit = execFileSync('git', ['rev-parse', '--short', ref], { cwd: ROOT }).toString().trim() + return { dir: path.join(tmp, 'web'), ref: `${ref} @ ${commit}`, cleanup: () => fs.rmSync(tmp, { recursive: true, force: true }) } +} + +function serve(dir) { + const server = http.createServer((req, res) => { + let p = decodeURIComponent(new URL(req.url, 'http://x').pathname) + if (p.startsWith('/.netlify/functions/')) { res.writeHead(204).end(); return } + if (p === '/') p = '/foundation-campaign/index.html' // same rewrite netlify.toml applies + let file = path.join(dir, p) + if (!file.startsWith(dir)) { res.writeHead(403).end(); return } + if (fs.existsSync(file) && fs.statSync(file).isDirectory()) { + if (!p.endsWith('/')) { res.writeHead(301, { Location: p + '/' }).end(); return } + file = path.join(file, 'index.html') + } + if (!fs.existsSync(file)) { + const nf = path.join(dir, '404.html') + res.writeHead(404, { 'Content-Type': MIME['.html'] }).end(fs.existsSync(nf) ? fs.readFileSync(nf) : 'not found') + return + } + res.writeHead(200, { 'Content-Type': MIME[path.extname(file).toLowerCase()] || 'application/octet-stream' }) + fs.createReadStream(file).pipe(res) + }) + return new Promise((resolve) => server.listen(0, '127.0.0.1', () => resolve(server))) +} + +// Runs inside the page. Returns measured boxes in page coordinates. +function measure() { + const round = Math.round + const docH = Math.max(document.documentElement.scrollHeight, document.body.scrollHeight) + const vw = window.innerWidth + const shown = (el) => { + for (let p = el; p && p !== document.documentElement; p = p.parentElement) { + const cs = getComputedStyle(p) + if (cs.display === 'none' || cs.visibility === 'hidden') return false + } + const r = el.getBoundingClientRect() + return r.width > 2 && r.height > 2 + } + const box = (el) => { + const r = el.getBoundingClientRect() + return { x: round(r.left + window.scrollX), y: round(r.top + window.scrollY), w: round(r.width), h: round(r.height) } + } + const txt = (el, n = 110) => (el.innerText || el.textContent || '').replace(/\s+/g, ' ').trim().slice(0, n) + const lum = (color) => { + const m = color.match(/rgba?\(([^)]+)\)/) + if (!m) return null + const [r, g, b, a = 1] = m[1].split(',').map((v) => parseFloat(v)) + if (a < 0.5) return null + return (0.2126 * r + 0.7152 * g + 0.0722 * b) / 255 + } + const bgLum = (el) => { + for (let p = el; p; p = p.parentElement) { + const l = lum(getComputedStyle(p).backgroundColor) + if (l !== null) return l + } + return 1 + } + // Light text means a dark surface. More reliable than background-color, which misses gradients. + const onDark = (el) => { + const l = lum(getComputedStyle(el).color) + return l !== null && l > 0.62 + } + const isFixed = (el) => { + for (let p = el; p && p !== document.body; p = p.parentElement) { + if (getComputedStyle(p).position === 'fixed') return true + } + return false + } + // One [x, y, w, h] per rendered line of text inside el. + const lineBoxes = (el) => { + const range = document.createRange() + range.selectNodeContents(el) + const lines = [] + for (const r of range.getClientRects()) { + if (r.width < 2 || r.height < 2) continue + const top = r.top + window.scrollY + const left = r.left + window.scrollX + let line = lines.find((l) => Math.abs(l.top - top) < Math.max(l.h, r.height) * 0.6) + if (!line) lines.push({ top, left, right: left + r.width, h: r.height }) + else { line.left = Math.min(line.left, left); line.right = Math.max(line.right, left + r.width); line.h = Math.max(line.h, r.height) } + } + return lines.sort((a, b) => a.top - b.top).slice(0, 48).map((l) => [round(l.left), round(l.top), round(l.right - l.left), round(l.h)]) + } + // The words of el grouped into the lines the browser actually broke them into. + const textLines = (el) => { + const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT) + const lines = [] + for (let node = walker.nextNode(); node; node = walker.nextNode()) { + const re = /\S+/g + for (let m = re.exec(node.data); m; m = re.exec(node.data)) { + const range = document.createRange() + range.setStart(node, m.index) + range.setEnd(node, m.index + m[0].length) + const r = range.getBoundingClientRect() + if (r.width < 1) continue + const top = r.top + window.scrollY + const left = r.left + window.scrollX + let line = lines.find((l) => Math.abs(l.top - top) < r.height * 0.5) + if (!line) { line = { top, left, right: left + r.width, h: r.height, words: [] }; lines.push(line) } + line.left = Math.min(line.left, left) + line.right = Math.max(line.right, left + r.width) + line.words.push(m[0]) + } + } + return lines.sort((a, b) => a.top - b.top).slice(0, 8).map((l) => ({ x: round(l.left), y: round(l.top), w: round(l.right - l.left), h: round(l.h), text: l.words.join(' ').slice(0, 120) })) + } + const SECTIONISH = new Set(['SECTION', 'HEADER', 'FOOTER', 'NAV', 'ARTICLE', 'ASIDE', 'MAIN', 'DIV', 'FORM']) + const blockKids = (el) => [...el.children].filter((c) => SECTIONISH.has(c.tagName) && shown(c) && c.getBoundingClientRect().height > 30 && !c.classList.contains('skip-link')) + + // Sections: start from body's children and open wrappers until we reach real sections. + let level = blockKids(document.body) + for (let depth = 0; depth < 4; depth++) { + let changed = false + const next = [] + for (const el of level) { + const kids = blockKids(el) + const real = kids.filter((k) => ['SECTION', 'HEADER', 'FOOTER', 'NAV', 'ARTICLE'].includes(k.tagName)) + const wrapper = el.tagName === 'MAIN' || ((el.tagName === 'DIV' || el.tagName === 'ARTICLE') && real.length >= 2) + if (wrapper && kids.length) { next.push(...kids); changed = true } else next.push(el) + } + level = next + if (!changed) break + } + const sectionEls = level.filter((el) => el.getBoundingClientRect().height > 30) + const sections = sectionEls.map((el, i) => { + const h = el.querySelector('h1, h2, h3') + const eyebrow = el.querySelector('[class*="eyebrow"], [class*="label"], [class*="kicker"]') + const cs = getComputedStyle(el) + const probe = [...el.querySelectorAll('h1, h2, h3, p')].find(shown) + return { + n: i + 1, + id: el.id || null, + tag: el.tagName.toLowerCase(), + cls: [...el.classList].slice(0, 4), + box: box(el), + heading: h ? txt(h, 140) : '', + eyebrow: eyebrow && shown(eyebrow) ? txt(eyebrow, 60) : '', + dark: probe ? onDark(probe) : bgLum(el) < 0.35, + fixed: cs.position === 'fixed' || cs.position === 'sticky', + links: [...el.querySelectorAll('a[href]')].filter(shown).slice(0, 60).map((a) => ({ text: txt(a, 70), href: a.getAttribute('href') })), + } + }) + + const blocks = [] + const floating = [] + // Fixed widgets (a floating feedback button, a cookie bar) are not part of the page flow: + // keep the top bar, list the rest separately. + const push = (b, el) => { + if (el && isFixed(el) && b.y > 150) { if (b.t === 'btn' || b.t === 'card') floating.push({ t: b.t, text: b.text || txt(el, 60), x: b.x, y: b.y, w: b.w, h: b.h }); return } + if (blocks.length < 3200) blocks.push(b) + } + const BTN = 'button, input[type="submit"], [role="button"], a[class*="btn"], a[class*="button"], a[class*="cta"]' + const isBtn = (el) => el.matches(BTN) + + document.querySelectorAll('[class*="card"], [class*="tier"], [class*="callout"], [class*="panel"], details, blockquote, fieldset').forEach((el) => { + if (!shown(el) || isBtn(el)) return + const b = box(el) + if (b.w < 110 || b.h < 50 || (b.w > vw * 0.99 && b.h > 1400)) return + const probe = [...el.querySelectorAll('h2, h3, h4, p, li')].find(shown) + push({ t: 'card', ...b, dark: probe ? onDark(probe) : bgLum(el) < 0.35 }, el) + }) + document.querySelectorAll('table').forEach((el) => { + if (!shown(el)) return + push({ t: 'table', ...box(el), rows: el.querySelectorAll('tr').length, cols: el.querySelector('tr') ? el.querySelector('tr').children.length : 0 }, el) + }) + document.querySelectorAll('h1, h2, h3, h4').forEach((el) => { + if (!shown(el)) return + const cs = getComputedStyle(el) + push({ t: 'h', level: +el.tagName[1], ...box(el), text: txt(el, 160), fs: parseFloat(cs.fontSize), ln: textLines(el), dark: onDark(el) }, el) + }) + document.querySelectorAll('nav a[href], [class*="subnav"] a[href], [class*="crumb"] a[href]').forEach((el) => { + if (!shown(el) || isBtn(el) || el.querySelector('img, svg')) return + const t = txt(el, 40) + if (!t) return + push({ t: 'link', ...box(el), text: t, fs: parseFloat(getComputedStyle(el).fontSize), dark: onDark(el) }, el) + }) + document.querySelectorAll('p, li, dt, dd, figcaption, summary, label, td, th').forEach((el) => { + if (!shown(el) || el.closest(BTN)) return + if (el.querySelector('p, li, ul, ol, h1, h2, h3, h4, table, input, textarea, select')) return + if (el.closest('nav') && el.querySelector('a[href]')) return // drawn as nav links + const t = txt(el, 60) + if (!t) return + const cs = getComputedStyle(el) + push({ t: 'p', ...box(el), fs: parseFloat(cs.fontSize), ln: lineBoxes(el), dark: onDark(el) }, el) + }) + document.querySelectorAll('img, picture, video, canvas, iframe, svg').forEach((el) => { + if (!shown(el) || el.closest('button, a[class*="btn"]')) return + // count a once (through its ) and skip svg fragments nested inside another svg + if (el.tagName === 'PICTURE') return + if (el.tagName.toLowerCase() === 'svg' && el.parentElement && el.parentElement.closest('svg')) return + const b = box(el) + if (b.w < 44 || b.h < 44) return + push({ t: 'img', ...b, alt: el.getAttribute('alt') || el.getAttribute('aria-label') || el.tagName.toLowerCase() }, el) + }) + document.querySelectorAll('input, textarea, select').forEach((el) => { + if (!shown(el) || ['hidden', 'submit', 'button'].includes(el.type)) return + const id = el.id + const lab = id ? document.querySelector('label[for="' + CSS.escape(id) + '"]') : el.closest('label') + push({ t: 'input', ...box(el), kind: el.tagName === 'INPUT' ? el.type : el.tagName.toLowerCase(), name: el.name || id || '', label: lab ? txt(lab, 60) : (el.placeholder || ''), required: !!el.required }, el) + }) + document.querySelectorAll(BTN).forEach((el) => { + if (!shown(el)) return + const cs = getComputedStyle(el) + const b = box(el) + if (b.w < 24 || b.h < 16) return + const bg = lum(cs.backgroundColor) + push({ t: 'btn', ...b, text: txt(el, 60), label: el.getAttribute('aria-label') || '', href: el.getAttribute('href') || '', solid: bg !== null && bg < 0.8, fs: parseFloat(cs.fontSize) }, el) + }) + + const forms = [...document.querySelectorAll('form')].filter(shown).map((f) => ({ + id: f.id || '', action: f.getAttribute('action') || '', method: (f.getAttribute('method') || 'get').toLowerCase(), ...box(f), + fields: [...f.querySelectorAll('input, textarea, select')].filter((el) => el.type !== 'hidden').map((el) => ({ name: el.name || el.id || '', type: el.tagName === 'INPUT' ? el.type : el.tagName.toLowerCase(), required: !!el.required })), + })) + + return { + title: document.title, + description: (document.querySelector('meta[name="description"]') || {}).content || '', + robots: (document.querySelector('meta[name="robots"]') || {}).content || '', + lang: document.documentElement.lang || '', + h1: [...document.querySelectorAll('h1')].filter(shown).map((h) => txt(h, 160)), + width: vw, height: docH, sections, blocks, floating, forms, + } +} + +const esc = (s) => String(s).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"') + +function wrap(text, widthPx, fontPx, maxLines) { + const perLine = Math.max(4, Math.floor(widthPx / (fontPx * 0.54))) + const words = text.split(' ') + const lines = [] + let cur = '' + for (const w of words) { + if ((cur + ' ' + w).trim().length > perLine && cur) { lines.push(cur); cur = w } else cur = (cur + ' ' + w).trim() + if (lines.length === maxLines) break + } + if (cur && lines.length < maxLines) lines.push(cur) + return lines +} + +export function toSvg(layout) { + const { width: W, height: H, sections, blocks } = layout + const o = [] + o.push(``) + o.push(``) + for (const s of sections) { + if (s.fixed && s.box.y < 4 && s.box.h < 140) continue + const fill = s.dark ? '#1f2530' : (s.n % 2 ? '#ffffff' : '#fafaf8') + o.push(``) + } + const ink = (dark, a, b) => (dark ? b : a) + for (const b of blocks.filter((x) => x.t === 'card')) { + o.push(``) + } + for (const b of blocks.filter((x) => x.t === 'table')) { + o.push(``) + const rows = Math.min(b.rows || 1, 40) + for (let i = 1; i < rows; i++) o.push(``) + const cols = Math.min(b.cols || 1, 10) + for (let i = 1; i < cols; i++) o.push(``) + } + for (const b of blocks.filter((x) => x.t === 'img')) { + o.push(``) + o.push(``) + } + for (const b of blocks.filter((x) => x.t === 'p')) { + const barH = Math.max(3, b.fs * 0.42) + for (const [x, y, w, h] of b.ln || []) { + o.push(``) + } + } + for (const b of blocks.filter((x) => x.t === 'h')) { + const fill = ink(b.dark, '#1b2430', '#f3f4f6') + const weight = b.level <= 2 ? 700 : 600 + if (b.ln && b.ln.length) { + // real line breaks, stretched to the measured width so the wireframe keeps the page's rhythm + for (const l of b.ln) o.push(`${esc(l.text)}`) + } else { + const maxLines = Math.max(1, Math.round(b.h / (b.fs * 1.15))) + wrap(b.text, b.w, b.fs, maxLines).forEach((line, i) => { + o.push(`${esc(line)}`) + }) + } + } + for (const b of blocks.filter((x) => x.t === 'link')) { + o.push(`${esc(b.text)}`) + } + for (const b of blocks.filter((x) => x.t === 'input')) { + o.push(``) + if (b.h >= 18 && b.w > 60) o.push(`${esc((b.name || b.kind).slice(0, Math.floor(b.w / 8)))}`) + } + for (const b of blocks.filter((x) => x.t === 'btn')) { + const rx = Math.min(b.h / 2, 999) + o.push(``) + const fsz = Math.min(b.fs || 14, b.h * 0.5) + const label = b.text.slice(0, Math.max(2, Math.floor(b.w / (fsz * 0.56)))) + if (label && b.w >= 56) o.push(`${esc(label)}`) + else if (!label || b.w < 56) { + // icon-only control (menu toggle, close, copy): three short strokes + const cx = b.x + b.w / 2, cy = b.y + b.h / 2, half = Math.min(b.w, b.h) * 0.22 + for (const dy of [-half * 0.7, 0, half * 0.7]) o.push(``) + } + } + for (const s of sections) { + if (s.fixed && s.box.y < 4 && s.box.h < 140) continue + o.push(``) + } + o.push('') + return o.join('\n') +} + +async function main() { + const PW = process.env.PLAYWRIGHT_MODULE || '/home/koh/.claude/skills/gstack/node_modules/playwright/index.mjs' + const { chromium } = await import(PW).catch(() => import('playwright')) + const only = opt('--only', '').split(',').filter(Boolean) + const pages = only.length ? PAGES.filter((p) => only.includes(p.slug)) : PAGES + for (const d of ['layout', 'svg', 'shots']) fs.mkdirSync(path.join(OUT, d), { recursive: true }) + + const site = exportSite() + const server = await serve(site.dir) + const base = `http://127.0.0.1:${server.address().port}` + const browser = await chromium.launch({ chromiumSandbox: false, args: ['--no-sandbox'] }) + const summary = { captured_from: site.ref, pages: [] } + try { + for (const pg of pages) { + const entry = { slug: pg.slug, path: pg.path, group: pg.group, views: {} } + for (const vp of VIEWPORTS) { + const ctx = await browser.newContext({ viewport: { width: vp.width, height: vp.height }, deviceScaleFactor: vp.scale, reducedMotion: 'reduce' }) + const page = await ctx.newPage() + await page.route('**/.netlify/functions/**', (route) => route.fulfill({ status: 204, body: '' })) + const resp = await page.goto(base + pg.path, { waitUntil: 'networkidle', timeout: 25000 }).catch(() => null) + await page.addStyleTag({ content: '*,*::before,*::after{animation-duration:0s!important;animation-delay:0s!important;transition:none!important;scroll-behavior:auto!important}.reveal{opacity:1!important;transform:none!important}' }) + await page.evaluate(async () => { + const h = document.documentElement.scrollHeight + for (let y = 0; y < h; y += 500) { window.scrollTo(0, y); await new Promise((r) => setTimeout(r, 30)) } + window.scrollTo(0, 0) + }) + await page.waitForTimeout(250) + const layout = await page.evaluate(measure) + layout.slug = pg.slug + layout.path = pg.path + layout.viewport = vp.name + layout.http_status = resp ? resp.status() : null + fs.writeFileSync(path.join(OUT, 'layout', `${pg.slug}.${vp.name}.json`), JSON.stringify(layout)) + fs.writeFileSync(path.join(OUT, 'svg', `${pg.slug}.${vp.name}.svg`), toSvg(layout)) + await page.screenshot({ path: path.join(OUT, 'shots', `${pg.slug}.${vp.name}.jpg`), fullPage: true, type: 'jpeg', quality: 64 }) + entry.views[vp.name] = { width: layout.width, height: layout.height, sections: layout.sections.length, blocks: layout.blocks.length, screens: +(layout.height / vp.height).toFixed(1) } + entry.title = layout.title + await ctx.close() + console.log(`${pg.slug.padEnd(34)} ${vp.name.padEnd(8)} ${String(layout.height).padStart(6)}px ${layout.sections.length} sections ${layout.blocks.length} blocks`) + } + summary.pages.push(entry) + } + } finally { + await browser.close() + server.close() + site.cleanup() + } + const file = path.join(OUT, 'layout', '_summary.json') + let prior = { pages: [] } + if (only.length && fs.existsSync(file)) prior = JSON.parse(fs.readFileSync(file, 'utf8')) + const merged = [...prior.pages.filter((p) => !summary.pages.find((q) => q.slug === p.slug)), ...summary.pages] + merged.sort((a, b) => PAGES.findIndex((p) => p.slug === a.slug) - PAGES.findIndex((p) => p.slug === b.slug)) + fs.writeFileSync(file, JSON.stringify({ captured_from: summary.captured_from, pages: merged }, null, 2)) + console.log(`\nCaptured ${summary.pages.length} pages from ${site.ref} into ${path.relative(ROOT, OUT)}`) +} + +if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) { + main().catch((err) => { console.error(err); process.exit(1) }) +} diff --git a/docs/tools/check.mjs b/docs/tools/check.mjs new file mode 100644 index 00000000..15967f4c --- /dev/null +++ b/docs/tools/check.mjs @@ -0,0 +1,145 @@ +#!/usr/bin/env node +// Mechanical checks on the docs this program writes. A wrong closed doc is worse than none. +// +// node docs/tools/check.mjs check docs/closed, docs/certified, web/faq, web/start +// node docs/tools/check.mjs --paths also list every quoted repo path that does not exist +// +// Checks: brand punctuation (no em dash, no double hyphen as punctuation), secret patterns, +// known gate values (read from their source lines at run time and never printed), personal +// email addresses and phone numbers, dossiers that stop before their last section, and quoted +// repo paths that exist neither in the working tree nor on origin/main. +// Exit code 1 when anything is found that must not be in a doc. + +import fs from 'node:fs' +import path from 'node:path' +import { execFileSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' + +const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..') +const SHOW_PATHS = process.argv.includes('--paths') +const MIN_SECRET_LENGTH = 6 + +const TARGETS = [ + { dir: 'docs/closed', ext: ['.md'], skip: ['site', '_workflow', 'wireframes/layout', 'wireframes/svg', 'wireframes/shots'] }, + { dir: 'docs/certified', ext: ['.md'] }, + { dir: 'web/faq', ext: ['.html', '.css', '.js'] }, + { dir: 'web/start', ext: ['.html', '.css', '.js'] }, +] + +const SECRET_PATTERNS = [ + ['Resend key', /\bre_[A-Za-z0-9_]{16,}/], + ['Anthropic key', /sk-ant-[A-Za-z0-9_-]{8,}/], + ['Stripe key', /\b(sk|rk)_(live|test)_[A-Za-z0-9]{8,}/], + ['Webhook secret', /\bwhsec_[A-Za-z0-9]{8,}/], + ['GitHub token', /\b(ghp_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,})/], + ['Slack token', /\bxox[baprs]-[A-Za-z0-9-]{10,}/], + ['AWS key id', /\bAKIA[0-9A-Z]{16}\b/], + ['Google API key', /\bAIza[0-9A-Za-z_-]{30,}/], + ['JWT', /\beyJhbGciOi[A-Za-z0-9_-]{10,}/], + ['Telegram bot token', /\b[0-9]{8,10}:[A-Za-z0-9_-]{35}\b/], + ['Private key block', /BEGIN [A-Z ]*PRIVATE KEY/], +] + +// Where gate values are written down (the audits list these). The values are read here so a doc +// that repeats one can be caught. They are compared, never printed. +const KNOWN_VALUE_SOURCES = [ + ['netlify/edge-functions/demos-pitch-auth.js', [10]], + ['netlify/edge-functions/demos-portfolio-auth.js', [9]], + ['netlify/edge-functions/mystichearts-demo-auth.js', [2, 8]], + ['netlify/edge-functions/airstreamstudio-auth.js', [4]], + ['netlify/edge-functions/mystichearts-brief-auth.js', [4, 5]], +] + +const ALLOWED_EMAIL = /@(handprotocol\.org|example\.(com|org)|users\.noreply\.github\.com|anthropic\.com)$/i +const EMAIL = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g +const PHONE = /(? { + const rel = path.join(dir, entry.name) + if (skip.some((s) => rel === path.join(dir.split('/').slice(0, 2).join('/'), s) || rel.endsWith(`/${s}`))) return [] + if (entry.isDirectory()) return walkFiles(rel, exts, skip) + return exts.includes(path.extname(entry.name)) ? [rel] : [] + }) +} + +function knownValues() { + const words = new Set() + for (const [file, lines] of KNOWN_VALUE_SOURCES) { + const abs = path.join(ROOT, file) + if (!fs.existsSync(abs)) continue + const all = fs.readFileSync(abs, 'utf8').split('\n') + for (const n of lines) { + const line = all[n - 1] || '' + for (const m of line.matchAll(/["'`]([^"'`\s]{6,})["'`]/g)) words.add(m[1]) + for (const m of line.matchAll(/(?:=|:|\bto\b|\bis\b)\s*["'`]?([A-Za-z0-9!@#$%^&*_+-]{6,})["'`]?\s*(?:[;,.)]|$)/g)) words.add(m[1]) + } + } + // Ordinary identifiers on those lines are not secrets, and neither is any word that the public + // routing config already uses (route names such as a gated folder's own name). + const routing = fs.existsSync(path.join(ROOT, 'netlify.toml')) ? fs.readFileSync(path.join(ROOT, 'netlify.toml'), 'utf8') : '' + return [...words].filter((w) => w.length >= MIN_SECRET_LENGTH && !routing.includes(w) && !/^(const|return|process|Netlify|password|PASSWORD|function|export|default|string|import)$/.test(w) && !/^[A-Z_]+$/.test(w)) +} + +let topLevel = null +let mainTree = null +function pathExists(candidate) { + if (!topLevel) topLevel = new Set(fs.readdirSync(ROOT)) + if (!topLevel.has(candidate.split('/')[0])) return null // not a repo path + if (fs.existsSync(path.join(ROOT, candidate))) return true + if (!mainTree) { + try { mainTree = new Set(execFileSync('git', ['--no-optional-locks', 'ls-tree', '-r', '--name-only', 'origin/main'], { cwd: ROOT, maxBuffer: 64 * 1024 * 1024 }).toString().split('\n')) } catch (error) { mainTree = new Set() } + } + const clean = candidate.replace(/\/$/, '') + return mainTree.has(clean) || [...mainTree].some((f) => f.startsWith(`${clean}/`)) +} + +function checkFile(rel, known) { + const text = fs.readFileSync(path.join(ROOT, rel), 'utf8') + const lines = text.split('\n') + const blocking = [] + const warnings = [] + const isDoc = rel.endsWith('.md') + + lines.forEach((line, i) => { + const at = `${rel}:${i + 1}` + if (line.includes('—')) blocking.push(`${at} em dash`) + if (/\s–\s/.test(line)) blocking.push(`${at} en dash used as punctuation`) + if (isDoc && /[A-Za-z0-9] -- [A-Za-z0-9]/.test(line) && !line.includes('`')) blocking.push(`${at} double hyphen used as punctuation`) + for (const [name, pattern] of SECRET_PATTERNS) if (pattern.test(line)) blocking.push(`${at} looks like a secret (${name})`) + for (const value of known) if (line.includes(value)) blocking.push(`${at} repeats a gate value that is written in source (value not shown)`) + for (const email of line.match(EMAIL) || []) if (!ALLOWED_EMAIL.test(email)) blocking.push(`${at} personal or third-party email address`) + if (isDoc && PHONE.test(line)) blocking.push(`${at} phone number`) + PHONE.lastIndex = 0 + }) + + const base = path.basename(rel) + for (const [test, heading] of LAST_SECTION) if (isDoc && test.test(base) && !text.includes(`\n${heading}`)) blocking.push(`${rel} stops before "${heading}"`) + + if (isDoc) { + const seen = new Set() + for (const m of text.matchAll(/`([A-Za-z0-9_.-]+\/[^`\s*{}<>$]*)`/g)) { + const candidate = m[1].replace(/[),.;:]+$/, '').replace(/:\d+(-\d+)?$/, '') + if (seen.has(candidate) || /^(https?:|docs\/closed\/site)/.test(candidate)) continue + seen.add(candidate) + if (pathExists(candidate) === false) warnings.push(`${rel} quotes a path that does not exist: ${candidate}`) + } + } + return { blocking, warnings } +} + +const known = knownValues() +const files = TARGETS.flatMap((t) => walkFiles(t.dir, t.ext, t.skip)) +const results = files.map((f) => checkFile(f, known)) +const blocking = results.flatMap((r) => r.blocking) +const warnings = results.flatMap((r) => r.warnings) + +console.log(`Checked ${files.length} files (${known.length} known gate values compared, none printed).`) +if (blocking.length) console.log(`\nMUST FIX (${blocking.length}):\n${blocking.map((b) => ` ${b}`).join('\n')}`) +console.log(`\nQuoted paths that do not exist: ${warnings.length}${SHOW_PATHS || !warnings.length ? '' : ' (run with --paths to list them)'}`) +if (SHOW_PATHS) console.log(warnings.map((w) => ` ${w}`).join('\n')) +if (!blocking.length) console.log('\nNo blocking problems.') +process.exit(blocking.length ? 1 : 0) diff --git a/docs/tools/lib/markdown.mjs b/docs/tools/lib/markdown.mjs new file mode 100644 index 00000000..2ccfae24 --- /dev/null +++ b/docs/tools/lib/markdown.mjs @@ -0,0 +1,179 @@ +// A small Markdown converter for the HAND docs site. It covers what the dossiers use: +// headings, paragraphs, blockquotes, nested lists, tables, fenced code, rules, and inline +// code, bold, italic and links. Raw HTML in the source is escaped, never passed through. + +export const escapeHtml = (value) => String(value ?? '').replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]) + +export const slugify = (text) => String(text).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') || 'section' + +const LIST_ITEM = /^(\s*)([-*+]|\d+[.)])\s+(.*)$/ +const TABLE_RULE = /^\s*\|?\s*:?-{2,}:?\s*(\|\s*:?-{2,}:?\s*)*\|?\s*$/ +const SAFE_URL = /^(https?:|mailto:|#|\/|\.\.?\/|[\w.-]+\.(html|md|json|jpg|svg)\b)/i + +function inline(text, options) { + const held = [] + const hold = (html) => `\u0000${held.push(html) - 1}\u0000` + let out = String(text).replace(/`([^`]+)`/g, (_, code) => { + const target = options.linkFor ? options.linkFor(code.trim()) : null + const html = `${escapeHtml(code)}` + return hold(target ? `${html}` : html) + }) + out = escapeHtml(out) + out = out.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g, (match, label, url) => { + if (!SAFE_URL.test(url)) return match + const target = options.linkFor && /\.md(#.*)?$/.test(url) ? options.linkFor(url.replace(/#.*$/, '')) : null + const href = target || url + const external = /^https?:/.test(href) + return hold(`${label}`) + }) + out = out.replace(/\*\*([^*]+)\*\*/g, '$1') + out = out.replace(/(^|[\s(])\*([^*\s][^*]*)\*(?=[\s).,;:!?]|$)/g, '$1$2') + out = out.replace(/(^|[\s(])_([^_\s][^_]*)_(?=[\s).,;:!?]|$)/g, '$1$2') + // Restore held fragments; a held link label may itself contain held code. + for (let pass = 0; pass < 3; pass += 1) out = out.replace(/\u0000(\d+)\u0000/g, (_, i) => held[Number(i)]) + return out +} + +function splitRow(line) { + const cells = [] + let current = '' + let inCode = false + const body = line.trim().replace(/^\|/, '').replace(/\|\s*$/, '') + for (let i = 0; i < body.length; i += 1) { + const ch = body[i] + if (ch === '`') inCode = !inCode + if (ch === '\\' && body[i + 1] === '|') { current += '|'; i += 1; continue } + if (ch === '|' && !inCode) { cells.push(current.trim()); current = ''; continue } + current += ch + } + cells.push(current.trim()) + return cells +} + +function renderList(lines, start, options) { + const first = lines[start].match(LIST_ITEM) + const baseIndent = first[1].length + const ordered = /\d/.test(first[2]) + const items = [] + let i = start + while (i < lines.length) { + const match = lines[i].match(LIST_ITEM) + if (match && match[1].length === baseIndent) { + items.push({ text: match[3], children: '' }) + i += 1 + continue + } + if (match && match[1].length > baseIndent && items.length) { + const nested = renderList(lines, i, options) + items[items.length - 1].children += nested.html + i = nested.next + continue + } + const indented = /^\s+\S/.test(lines[i]) && lines[i].search(/\S/) > baseIndent + if (indented && items.length) { items[items.length - 1].text += ` ${lines[i].trim()}`; i += 1; continue } + if (lines[i].trim() === '' && i + 1 < lines.length) { + const after = lines[i + 1].match(LIST_ITEM) + if (after && after[1].length >= baseIndent) { i += 1; continue } + } + break + } + const tag = ordered ? 'ol' : 'ul' + const body = items.map((item) => { + const task = item.text.match(/^\[( |x|X)\]\s+(.*)$/) + const text = task ? `${inline(task[2], options)}` : inline(item.text, options) + return `
  • ${text}${item.children}
  • ` + }).join('') + return { html: `<${tag}>${body}`, next: i } +} + +const startsBlock = (line, next) => /^(#{1,6}\s|```|>|\s*([-*+]|\d+[.)])\s+)/.test(line) || /^(-{3,}|\*{3,})\s*$/.test(line) || (line.trim().startsWith('|') && next !== undefined && TABLE_RULE.test(next)) + +export function renderMarkdown(source, options = {}) { + const lines = String(source).replace(/\r\n?/g, '\n').split('\n') + const shift = options.headingShift || 0 + const html = [] + const headings = [] + const sections = [] + const usedIds = new Map() + let title = '' + let section = { id: '', heading: '', text: '' } + const note = (text) => { section.text += ` ${text}` } + + let i = 0 + while (i < lines.length) { + const line = lines[i] + if (line.trim() === '') { i += 1; continue } + + const fence = line.match(/^```(\w*)/) + if (fence) { + const code = [] + i += 1 + while (i < lines.length && !lines[i].startsWith('```')) { code.push(lines[i]); i += 1 } + i += 1 + html.push(`
    ${escapeHtml(code.join('\n'))}
    `) + note(code.join(' ')) + continue + } + + const heading = line.match(/^(#{1,6})\s+(.*?)\s*#*$/) + if (heading) { + const level = Math.min(6, heading[1].length + shift) + const text = heading[2] + const plain = text.replace(/[`*_]/g, '') + const base = slugify(plain) + const count = usedIds.get(base) || 0 + usedIds.set(base, count + 1) + const id = count ? `${base}-${count + 1}` : base + if (level === 1 && !title) title = plain + headings.push({ level, id, text: plain }) + if (level <= 3) { + if (section.heading || section.text.trim()) sections.push(section) + section = { id, heading: plain, text: '' } + } else note(plain) + html.push(`${inline(text, options)}`) + i += 1 + continue + } + + if (/^(-{3,}|\*{3,})\s*$/.test(line)) { html.push('
    '); i += 1; continue } + + if (line.startsWith('>')) { + const quote = [] + while (i < lines.length && lines[i].startsWith('>')) { quote.push(lines[i].replace(/^>\s?/, '')); i += 1 } + const inner = renderMarkdown(quote.join('\n'), { ...options, headingShift: shift }) + html.push(`
    ${inner.html}
    `) + note(quote.join(' ')) + continue + } + + if (line.trim().startsWith('|') && i + 1 < lines.length && TABLE_RULE.test(lines[i + 1])) { + const head = splitRow(line) + i += 2 + const rows = [] + while (i < lines.length && lines[i].trim().startsWith('|')) { rows.push(splitRow(lines[i])); i += 1 } + const th = head.map((cell) => `${inline(cell, options)}`).join('') + const body = rows.map((row) => `${head.map((_, c) => `${inline(row[c] || '', options)}`).join('')}`).join('') + html.push(`
    ${th}${body}
    `) + note([head, ...rows].map((row) => row.join(' ')).join(' ')) + continue + } + + if (LIST_ITEM.test(line)) { + const startAt = i + const list = renderList(lines, i, options) + html.push(list.html) + note(lines.slice(startAt, list.next).join(' ')) + i = list.next + continue + } + + const paragraph = [line] + i += 1 + while (i < lines.length && lines[i].trim() !== '' && !startsBlock(lines[i], lines[i + 1])) { paragraph.push(lines[i]); i += 1 } + html.push(`

    ${inline(paragraph.join(' '), options)}

    `) + note(paragraph.join(' ')) + } + if (section.heading || section.text.trim()) sections.push(section) + const cleaned = sections.map((s) => ({ ...s, text: s.text.replace(/[`*|]/g, ' ') })) + return { html: html.join('\n'), title, headings, sections: cleaned } +} diff --git a/docs/tools/site-assets/site.css b/docs/tools/site-assets/site.css new file mode 100644 index 00000000..c2c63c9b --- /dev/null +++ b/docs/tools/site-assets/site.css @@ -0,0 +1,208 @@ +/* HAND docs site. Tokens follow DESIGN.md; the surface is the warm-paper archive variant, + set denser because this is reference material read at a desk. */ + +:root { + --bg: #FBF8F1; + --surface: #FFFFFF; + --ink: #111827; + --ink-2: #4B5563; + --ink-3: #6B7280; + --accent: #D97706; + --accent-action: #B45309; + --accent-deep: #92400E; + --accent-light: #FEF3C7; + --teal: #0F766E; + --teal-light: #CCFBF1; + --rose: #BE185D; + --rose-light: #FCE7F3; + --line: #E9E2D0; + --line-2: #E5E7EB; + --dark: #0F172A; + --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; + --serif: "Source Serif 4", Georgia, serif; + --mono: "JetBrains Mono", "Fira Code", ui-monospace, monospace; + --bar: 52px; + --side: 17.5rem; +} + +*, *::before, *::after { box-sizing: border-box; } +html { scroll-padding-top: calc(var(--bar) + 1rem); -webkit-text-size-adjust: 100%; } +body { margin: 0; background: var(--bg); color: var(--ink); font: 400 0.9375rem/1.6 var(--sans); -webkit-font-smoothing: antialiased; } +a { color: var(--accent-action); text-underline-offset: 0.16em; } +a:hover { color: var(--accent-deep); } +:focus-visible { outline: 2px solid var(--accent-action); outline-offset: 2px; border-radius: 3px; } +code { font: 0.84em var(--mono); background: rgba(146, 64, 14, 0.07); padding: 0.08em 0.32em; border-radius: 4px; overflow-wrap: anywhere; } +.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } +.skip { position: absolute; left: 1rem; top: -4rem; z-index: 30; background: var(--dark); color: #fff; padding: 0.5rem 0.9rem; border-radius: 8px; } +.skip:focus { top: 0.5rem; color: #fff; } +.small { font-size: 0.8125rem; color: var(--ink-3); } +.num { font-variant-numeric: tabular-nums; white-space: nowrap; } +.empty { color: var(--ink-3); } + +/* ---------- top bar ---------- */ + +.bar { + position: sticky; top: 0; z-index: 20; height: var(--bar); + display: flex; align-items: center; gap: 0.9rem; padding: 0 1.25rem; + background: var(--dark); color: #F9FAFB; +} +.bar__brand { color: #F9FAFB; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; } +.bar__brand:hover { color: #FCD34D; } +.bar__menu { display: none; background: none; border: 1px solid #475569; color: #F9FAFB; border-radius: 8px; padding: 0.35rem 0.7rem; font: inherit; cursor: pointer; } + +.badge { + font: 500 0.6875rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; + padding: 0.22rem 0.6rem; border-radius: 999px; white-space: nowrap; cursor: help; +} +.badge--closed { background: #7F1D1D; color: #FEE2E2; } +.badge--certified { background: var(--teal); color: #F0FDFA; } + +.search { position: relative; margin-left: auto; width: min(26rem, 46vw); } +.search input { + width: 100%; height: 34px; padding: 0 0.8rem; border: 1px solid #334155; border-radius: 8px; + background: #1E293B; color: #F9FAFB; font: inherit; +} +.search input::placeholder { color: #94A3B8; } +.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.35); } +.search__results { + position: absolute; right: 0; top: calc(100% + 8px); width: min(38rem, 92vw); max-height: 70vh; overflow: auto; + background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; + box-shadow: 0 24px 60px -24px rgba(15, 23, 42, 0.5); +} +.search__results a { display: block; padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; } +.search__results a:last-child { border-bottom: 0; } +.search__results a:hover, .search__results a:focus { background: var(--accent-light); outline: none; } +.search__results .r-doc { font: 500 0.6875rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-deep); } +.search__results .r-head { font-weight: 600; } +.search__results .r-snip { color: var(--ink-2); font-size: 0.8125rem; } +.search__results mark { background: #FDE68A; color: inherit; padding: 0 0.1em; border-radius: 2px; } +.search__results .r-none { padding: 0.9rem; color: var(--ink-3); } + +/* ---------- layout ---------- */ + +.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); } +.layout:has(.toc) { grid-template-columns: var(--side) minmax(0, 1fr) 14rem; } + +.side { + position: sticky; top: var(--bar); height: calc(100vh - var(--bar)); overflow-y: auto; + padding: 1.25rem 1rem 3rem 1.25rem; border-right: 1px solid var(--line); font-size: 0.875rem; +} +.side h2 { margin: 1.4rem 0 0.4rem; font: 500 0.6875rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); } +.side ul { list-style: none; margin: 0; padding: 0; } +.side a { display: block; padding: 0.28rem 0.55rem; border-radius: 6px; color: var(--ink-2); text-decoration: none; line-height: 1.35; } +.side a:hover { background: rgba(146, 64, 14, 0.07); color: var(--ink); } +.side a[aria-current="page"] { background: var(--accent-light); color: var(--accent-deep); font-weight: 600; } +.side__home a { font-weight: 600; color: var(--ink); } + +.content { min-width: 0; padding: 2.25rem clamp(1.25rem, 4vw, 3.5rem) 6rem; } +.toc { position: sticky; top: var(--bar); align-self: start; max-height: calc(100vh - var(--bar)); overflow-y: auto; padding: 2.4rem 1.25rem 2rem 0; font-size: 0.8125rem; } +.toc h2 { margin: 0 0 0.5rem; font: 500 0.6875rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); } +.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); } +.toc a { display: block; padding: 0.22rem 0 0.22rem 0.8rem; color: var(--ink-2); text-decoration: none; line-height: 1.35; } +.toc a:hover { color: var(--accent-action); } + +/* ---------- prose ---------- */ + +.meta { margin: 0 0 0.6rem; font: 500 0.6875rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); } +.prose, .wire { max-width: 62rem; } +.prose > p, .prose > ul, .prose > ol, .prose > blockquote, .prose > h1, .prose > h2, .prose > h3, .prose > h4 { max-width: 46rem; } +h1 { margin: 0 0 1rem; font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.12; letter-spacing: -0.028em; text-wrap: balance; } +h2 { margin: 2.75rem 0 0.75rem; padding-top: 1.1rem; border-top: 1px solid var(--line); font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.02em; } +h3 { margin: 1.9rem 0 0.5rem; font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.01em; } +h4 { margin: 1.4rem 0 0.4rem; font: 500 0.6875rem var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); } +p { margin: 0 0 0.9rem; } +.lede { font-size: 1.125rem; line-height: 1.6; color: var(--ink-2); max-width: 44rem; } +ul, ol { margin: 0 0 1rem; padding-left: 1.3rem; } +li { margin: 0.22rem 0; } +li > ul, li > ol { margin: 0.2rem 0 0.3rem; } +hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; } +blockquote { margin: 0 0 1.25rem; padding: 0.8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink-2); font-size: 0.875rem; } +blockquote p:last-child { margin-bottom: 0; } +.kind-closed .prose > blockquote:first-of-type { border-color: #FCA5A5; background: #FEF2F2; color: #7F1D1D; } +.kind-certified .prose > blockquote:first-of-type { border-color: #5EEAD4; background: #F0FDFA; color: #134E4A; } +pre { margin: 0 0 1.1rem; padding: 0.9rem 1rem; overflow-x: auto; background: var(--dark); color: #E2E8F0; border-radius: 10px; font: 0.8125rem/1.55 var(--mono); } +pre code { background: none; padding: 0; font: inherit; color: inherit; overflow-wrap: normal; } +.doclink { text-decoration: none; } +.doclink code { color: var(--accent-deep); border-bottom: 1px solid currentColor; } +.task { display: inline-block; width: 0.85rem; height: 0.85rem; margin-right: 0.45rem; border: 1.5px solid var(--ink-3); border-radius: 3px; vertical-align: -0.1rem; } +.task--done { background: var(--teal); border-color: var(--teal); } + +.table-wrap { margin: 0 0 1.25rem; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; } +table { width: 100%; border-collapse: collapse; font-size: 0.8438rem; line-height: 1.5; } +th, td { padding: 0.55rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); } +th { position: sticky; top: 0; background: #F6F1E4; font: 500 0.6875rem var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; } +tbody tr:last-child td { border-bottom: 0; } +tbody tr:hover td { background: #FFFCF3; } +td { min-width: 6rem; } +td:first-child { min-width: 0; } + +details { margin: 0 0 0.9rem; } +summary { cursor: pointer; color: var(--accent-action); font-weight: 600; padding: 0.25rem 0; } + +.sev { display: inline-block; font: 500 0.6875rem var(--mono); letter-spacing: 0.05em; text-transform: uppercase; padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; } +.sev--critical { background: #7F1D1D; color: #FEE2E2; } +.sev--high { background: var(--rose-light); color: #9D174D; } +.sev--medium { background: var(--accent-light); color: var(--accent-deep); } +.sev--low, .sev--info { background: #EEF2F6; color: #475569; } + +/* ---------- wireframe pages ---------- */ + +.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 0 1.5rem; margin: 1.25rem 0 2rem; padding: 0; border-top: 1px solid var(--line); } +.facts div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.5rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); } +.facts dt { font: 500 0.6875rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding-top: 0.15rem; } +.facts dd { margin: 0; } + +.wire { max-width: 78rem; } +.wire__grid { display: grid; grid-template-columns: minmax(16rem, 26rem) minmax(0, 1fr); gap: 2.5rem; align-items: start; } +.wire__frames { position: sticky; top: calc(var(--bar) + 1rem); max-height: calc(100vh - var(--bar) - 2rem); overflow-y: auto; padding-right: 0.5rem; } +.wire__notes h2 { margin-top: 0; padding-top: 0; border-top: 0; } + +.tabs { display: inline-flex; gap: 0.25rem; padding: 0.2rem; margin-bottom: 0.75rem; background: #EFE9D9; border-radius: 999px; } +.tabs button { border: 0; background: none; padding: 0.35rem 0.9rem; border-radius: 999px; font: 500 0.8125rem var(--sans); color: var(--ink-2); cursor: pointer; } +.tabs button[aria-selected="true"] { background: var(--dark); color: #F9FAFB; } + +.frame { position: relative; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); box-shadow: 0 18px 40px -30px rgba(68, 51, 17, 0.5); } +.frame--phone { max-width: 15rem; } +.frame img { display: block; width: 100%; height: auto; } +.band { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(180, 83, 9, 0.55); text-decoration: none; } +.band--fixed { border-top-color: transparent; } +.band:hover, .band.is-on { background: rgba(217, 119, 6, 0.14); outline: 2px solid var(--accent); outline-offset: -2px; } +.band__n { position: absolute; top: 2px; left: 2px; min-width: 1.35rem; padding: 0 0.3rem; background: var(--accent-action); color: #fff; font: 500 0.6875rem/1.35rem var(--mono); text-align: center; border-radius: 4px; } +.band--fixed .band__n { left: auto; right: 2px; background: var(--dark); } + +.ann { padding: 1rem 0 1.1rem; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--bar) + 1rem); } +.ann.is-on { background: #FFFCF3; box-shadow: -0.75rem 0 0 #FFFCF3, 0.75rem 0 0 #FFFCF3; } +.ann__head { display: flex; gap: 0.75rem; align-items: flex-start; margin-bottom: 0.4rem; } +.ann__n { flex: none; min-width: 1.7rem; padding: 0 0.3rem; background: var(--accent-action); color: #fff; font: 500 0.75rem/1.7rem var(--mono); text-align: center; border-radius: 5px; } +.ann__kind { margin: 0; font: 500 0.6875rem var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); } +.ann h3 { margin: 0.05rem 0 0; } +.ann__job { color: var(--ink-2); } +.ann__notes { padding: 0.55rem 0.75rem; background: var(--rose-light); color: #831843; border-radius: 8px; font-size: 0.875rem; } +.ctas { list-style: none; padding: 0; } +.ctas li { padding: 0.18rem 0; } +.cta { display: inline-block; padding: 0.05rem 0.5rem; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-weight: 500; font-size: 0.8438rem; } +.cta--primary { background: var(--accent-action); border-color: var(--accent-action); color: #fff; } +.cta--secondary { border-color: var(--ink-3); } +.formspec { margin: 0.75rem 0; } +.plainlist { list-style: none; margin: 0; padding: 0; } + +/* ---------- narrow ---------- */ + +@media (max-width: 1180px) { + .layout:has(.toc) { grid-template-columns: var(--side) minmax(0, 1fr); } + .toc { display: none; } +} +@media (max-width: 860px) { + .layout, .layout:has(.toc) { grid-template-columns: minmax(0, 1fr); } + .bar__menu { display: block; } + .side { display: none; position: fixed; inset: var(--bar) 0 0 0; z-index: 15; height: auto; background: var(--bg); } + .side.is-open { display: block; } + .wire__grid { grid-template-columns: minmax(0, 1fr); } + .wire__frames { position: static; max-height: none; } + .frame--desktop { max-width: 22rem; } +} +@media print { + .bar, .side, .toc, .tabs { display: none; } + .layout { display: block; } + body { background: #fff; } +} diff --git a/docs/tools/site-assets/site.js b/docs/tools/site-assets/site.js new file mode 100644 index 00000000..ee11fde3 --- /dev/null +++ b/docs/tools/site-assets/site.js @@ -0,0 +1,105 @@ +// HAND docs site: search, the phone menu, viewport tabs, and wireframe band highlighting. +(() => { + 'use strict' + + const MAX_RESULTS = 30 + const SNIPPET_RADIUS = 90 + const index = window.HAND_DOCS_INDEX || [] + const escapeHtml = (value) => String(value).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]) + const escapeRegex = (value) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + + // ---------- search ---------- + + const input = document.getElementById('q') + const results = document.getElementById('results') + + function snippet(text, words) { + const lower = text.toLowerCase() + const at = Math.max(0, Math.min(...words.map((w) => { const i = lower.indexOf(w); return i < 0 ? Infinity : i }))) + const start = Number.isFinite(at) ? Math.max(0, at - SNIPPET_RADIUS) : 0 + const cut = text.slice(start, start + SNIPPET_RADIUS * 2.4) + const marked = words.reduce((html, w) => html.replace(new RegExp(`(${escapeRegex(escapeHtml(w))})`, 'gi'), '$1'), escapeHtml(cut)) + return `${start > 0 ? '… ' : ''}${marked} …` + } + + function search(query) { + const words = query.toLowerCase().split(/\s+/).filter((w) => w.length > 1) + if (!words.length) return [] + return index + .map((entry) => { + const heading = `${entry.t} ${entry.h}`.toLowerCase() + const body = entry.x.toLowerCase() + if (!words.every((w) => heading.includes(w) || body.includes(w))) return null + const score = words.reduce((sum, w) => sum + (heading.includes(w) ? 5 : 0) + (body.includes(w) ? 1 : 0), 0) + return { entry, score } + }) + .filter(Boolean) + .sort((a, b) => b.score - a.score) + .slice(0, MAX_RESULTS) + .map(({ entry }) => ({ entry, words })) + } + + function showResults() { + const found = search(input.value) + if (!input.value.trim()) { results.hidden = true; return } + results.hidden = false + results.innerHTML = found.length + ? found.map(({ entry, words }) => `${escapeHtml(entry.t)}
    ${escapeHtml(entry.h || entry.t)}
    ${snippet(entry.x, words)}
    `).join('') + : '

    Nothing matches. Try fewer or different words.

    ' + } + + if (input && results) { + input.addEventListener('input', showResults) + input.addEventListener('focus', showResults) + input.addEventListener('keydown', (event) => { + if (event.key === 'Escape') { results.hidden = true; input.blur() } + if (event.key === 'ArrowDown') { const first = results.querySelector('a'); if (first) { event.preventDefault(); first.focus() } } + }) + results.addEventListener('keydown', (event) => { + const links = [...results.querySelectorAll('a')] + const at = links.indexOf(document.activeElement) + if (event.key === 'ArrowDown' && links[at + 1]) { event.preventDefault(); links[at + 1].focus() } + if (event.key === 'ArrowUp') { event.preventDefault(); (links[at - 1] || input).focus() } + if (event.key === 'Escape') { results.hidden = true; input.focus() } + }) + document.addEventListener('click', (event) => { if (!event.target.closest('.search')) results.hidden = true }) + document.addEventListener('keydown', (event) => { + if (event.key === '/' && !/^(INPUT|TEXTAREA)$/.test(document.activeElement.tagName)) { event.preventDefault(); input.focus() } + }) + } + + // ---------- phone menu ---------- + + const menu = document.querySelector('.bar__menu') + const side = document.getElementById('side') + if (menu && side) { + menu.addEventListener('click', () => { + const open = side.classList.toggle('is-open') + menu.setAttribute('aria-expanded', String(open)) + }) + } + const current = side && side.querySelector('[aria-current="page"]') + if (current) current.scrollIntoView({ block: 'center' }) + + // ---------- wireframe pages ---------- + + document.querySelectorAll('.tabs [role="tab"]').forEach((tab) => { + tab.addEventListener('click', () => { + document.querySelectorAll('.tabs [role="tab"]').forEach((other) => other.setAttribute('aria-selected', String(other === tab))) + document.querySelectorAll('[data-panel]').forEach((panel) => { panel.hidden = panel.dataset.panel !== tab.dataset.view }) + }) + }) + + const mark = (n, on) => { + document.querySelectorAll(`[data-band="${n}"], [data-ann="${n}"]`).forEach((el) => el.classList.toggle('is-on', on)) + } + document.querySelectorAll('[data-band]').forEach((band) => { + band.addEventListener('mouseenter', () => mark(band.dataset.band, true)) + band.addEventListener('mouseleave', () => mark(band.dataset.band, false)) + }) + document.querySelectorAll('[data-ann]').forEach((ann) => { + if (!ann.dataset.ann) return + ann.addEventListener('mouseenter', () => mark(ann.dataset.ann, true)) + ann.addEventListener('mouseleave', () => mark(ann.dataset.ann, false)) + }) +})() diff --git a/mystichearts/FUNNEL.md b/mystichearts/FUNNEL.md new file mode 100644 index 00000000..28552eae --- /dev/null +++ b/mystichearts/FUNNEL.md @@ -0,0 +1,234 @@ +# Mystic Hearts funnel: design flow + +*2026-11-01, revised twice the same night (the dissolve replaces the leaf turn). Design only, nothing built. Visual version, with a working +sketch of the page turn: the "Mystic Hearts funnel" artifact.* + +koH's ask: whichever of the four chapters someone opens, the path should carry them to the +calendar (what is unfolding), then suggest coming out to the land and signing up. Keep the +number of steps to the best action small, and give the chapters a direct way to the calendar and +to signup or get in touch. + +## The shape: read, see, come + +1. **Read.** The stage and the four chapters (Our vision, How we live, The land, Gatherings). +2. **See.** The What's on calendar: gold days hold a gathering, softly lit days are open to visit. +3. **Come.** Two asks, always together: + - **Come out to the land** (the best action: a visit request, confirmed by a person); + - **Keep me posted** (the safety net: one email field). + +Every screen ends by pointing at the next beat. No screen is a dead end. + +## Revision (2026-11-01 night): one book, closing in a circle + +koH, after reading the first version: the reader must be able to get back to the four chapters +from every other screen too, a full circle; be mindful of how they get there and how the cards are +presented; a swipe or book page-turn effect, unless that is too much. This revision replaces +"What changes" item 1 below and settles decision 1. + +- **One book, five pages, in a circle:** I Our vision · II How we live · III The land · + IV Gatherings · ✦ What's on. Turning on past What's on begins again at Our vision ("Begin + again · Our vision →" in its running foot). Every page has a running foot (previous and next + page by name). +- **Pages turn, slips rise.** The pages are the story and the calendar. The actions (Come out to + the land, Keep me posted, Say hello) are slips laid over whatever page you were on. The ribbon + of five pages stays on screen under every slip, so a chapter is always one tap away. +- **Every slip ends in Keep reading:** the four chapters as small cards, always I to IV, numeral, + name and one line. A filled dot marks a chapter read this visit, a hollow one is still waiting. + No counts, nothing stored. Tapping a card lowers the slip and turns to that chapter. +- **Ways in:** the chapter row opens its chapter; the gold hero button opens What's on; the glass + one opens What's on with the Come out slip up (closing it shows the calendar, not the video); + Get in touch opens the Say hello slip over What's on; hash links open the page or slip named. +- **The turn: the leaf turn** (recommended). One leaf lifts on its spine and falls left, with a + shadow over the page beneath, about 0.75 s. On a phone the thumb holds the page edge: past a + third, or a quick flick, finishes the turn; a short drag settles back. Buttons that act + (See what is unfolding, a chapter card) always turn forward; the ribbon takes the short way + round the circle. Reduced motion: a fade. Fallback if it feels like a costume: a plain swipe. +- **Not a real book curl.** A bending, peeling paper curl needs a page-flip library or WebGL, + fights the foggy glass (Safari flattens or flickers 3D under a blurred backdrop), stutters on + older phones, and makes long scrolling pages a gimmick. +- **Build notes:** a turning page is solid night, not glass, so the two pages never show through + each other; the new page starts at its top; the koordi calendar stays mounted across turns; a + drag starting inside the calendar or a form field is never a turn; vertical scroll wins when + the first movement is vertical. One `components/book.tsx` replaces `story-sheet.tsx` and + `contact-modal.tsx`; framer-motion (already a dependency) drives the turn. Check on an iPhone + in Safari for the glass case. +- **Decisions now:** (1) one book in a circle, (2) leaf turn, swipe or fade, (3) read dots or + plain cards, plus the three below (email only, The land opens the calendar, hash links). + +## Revision 4 (2026-11-02): open door on any event, and who is welcome, said plainly + +koH: "open house mode is for anyone, allow it to be an option when setting calendar events. make +sure to be clear on the display of the events who is welcome and how to join, lets make sure to +have all the features of partiful or eventbrite and when we work on these features make sure to +import to koordi." + +- **The sketch** (`design/funnel/dissolve.html`): sage now means *open to all, just come* and gold + *ask to join*; the community meal is open door too, to show it is a choice on any event. Every + event's dock says **Who is welcome** (the host's words) and **How to join** (worked out from the + admission and the seats, so it never disagrees with the button), who holds it, how many are + coming and the spots left, with Add to my calendar and Share. A full event offers the waitlist + (the sound bath in the sample). The strip tags each event open to all or ask to join. +- **koordi**: open door and the welcome line are being built now (feature 0062 and 0063, brief + `../koordi/docs/briefs/2026-11-02-open-door-and-who-is-welcome.md`; local only, no deploy). + Every Partiful and Eventbrite feature is a koordi feature entry (0062 to 0078), with the table + and the build order in `../koordi/docs/plans/2026-11-01-open-houses-and-the-calendar.md`. + +## Revision 3 (2026-11-01 night): the slips work, and a real calendar + +koH on the dissolve sketch: the features look good; the get-in-touch features did not work, and +the calendar needed design matching the rest. Then: a calendar with Come out to the land, maybe +open houses later, planned with koordi. All in `design/funnel/dissolve.html` (nothing is sent; a +mock send of one second): + +- **Three slips rise over the page**, the leaf dimmed behind and the ribbon still live: Come out + to the land (moonlight), Keep me posted (gold), Say hello (raspberry). Their words gather out of + light like a page. Each checks name and email, shows Sending…, then a finish: what happens next, + the other ask (Also keep me posted, or Come out to the land), and **Keep reading**: the four + chapter cards with a dot for each one read. Esc or × closes; Enter sends. +- **Ways in:** Get in touch (top right) opens Say hello over any page; Host a gathering opens it + with a first line written; the dock opens the visit slip on the chosen day; hash links + `#visit`, `#keep-posted`, `#hello`, `#whats-on` work on arrival and on a live page. +- **The calendar:** one month per page, round days. Weekdays open to visit are numerals with a + moonlit dot; gatherings are gold, breathing, with a turning halo; **open houses** (new, sample: + first Saturday, 10 to 2) are sage leaf-cut tiles; full and new moons are marked. A strip of + what is coming drifts past (tap to choose). The dock beside the month tells the chosen day in + words and changes its button: Come out to the land (choose two hours), Ask to join (a person + says yes), or Come to the open house (a count, no wait, Add to my calendar). Months turn with + the dissolve. "As it is today" shows the honest empty state. +- **koordi side:** `../koordi/docs/plans/2026-11-01-open-houses-and-the-calendar.md` (open + admission, repeating gatherings, the calendar options, the followable feed, newsletter topics, + the monthly letter, the after-open-house note). Five decisions there for koH. + +## Revision 2 (2026-11-01 late): the dissolve, and a light for every page + +koH on the leaf turn: not a fan. Instead of a page flip, the words should shimmer and come apart +like dispersing particles, then the next page's words appear; and the same gold button on every +page felt static. Working sketch: `design/funnel/dissolve.html` (open it in a browser; arrow keys +or the ribbon turn the pages; reduced motion gets a plain fade). + +- **The dissolve replaces the leaf turn.** Leaving a page, each letter of the heading and each word + of the text brightens, blurs and drifts up and away, top to bottom, and motes of light lift off + where it stood. The next page's words gather out of light: motes travel in and the words sharpen + into place. About 0.6 s out and 0.9 s in. Drawn on one canvas over the sheet plus Web Animations + on the words, so there is no library, no 3D and no clash with the foggy glass. +- **Each page carries its own light.** The page's colour tints the motes, the italic in the + headline, the glow on the sheet and the dot on the ribbon: + I Our vision gold · II How we live raspberry · III The land sage · IV Gatherings ember · + ✦ What's on moonlight. +- **Each page has its own button**, so no two pages ask the same way: + - Our vision: **See what is unfolding**, a pill with a gold halo that slowly circles its edge + and a sheen crossing the words. + - How we live: **Feel it in person**, a raspberry pill that breathes. + - The land: **Choose a day on the land**, a leaf-cut sage shape that flips its corners and grows + a root line on hover. + - Gatherings: **Join the circle**, an ember that flickers like the fire circle. + - What's on: **Come out to the land**, a pale pill with a small moon that waxes and wanes. + - The second action on every page stays quiet: words with a hairline underneath. +- **The next-page link breathes** (koH, same night): the running foot's next link, bottom right, + is a light warm cream with a soft gold glow that swells and settles every 4.5 s (faster on + hover). Reduced motion: a steady soft glow. +- **Build notes:** split the words at render (aria-label keeps the sentence whole for screen + readers); only words in view throw motes; the koordi calendar is faded, not split; the motes + canvas sits above the sheet and ignores pointers. Check Safari on an iPhone for the moving + `filter: blur` on many words, and fall back to opacity only if it stutters. + +## The calendar, refined (2026-11-01 night) + +koH: the calendar needs more refining. Seen live at 390 and 1440 wide, it works (a day, then Come +out to the land, opens koordi's visit form on that day) but: + +1. **One honest line when nothing is planned.** Today "Nothing on the calendar yet" sits above 22 + lit days, and a second "No gatherings" line sits under them. Refined: one line in the strip, + "First gatherings open fall 2027. Until then the land is open on weekdays, to walk and talk." +2. **Only gatherings glow.** Today every open weekday is a lit tile with a halo. Refined: gathering + days gold and breathing; open days plain numerals with a small dot; resting days faded; today a + thin ring. +3. **A calendar, not a wall.** Tiles about 118 by 96 on wide push the next step below the fold. + Refined: round days at most 42 wide, one month per page; on wide the dock sits beside the grid, + on a phone under it. +4. **A day is chosen from the start** (the first open day), told in words in the dock; a tap on + another day changes the words only. No day panel, no "Close this day". +5. **One gold button:** Come out to the land, or Ask to join on a gathering day. Hosting goes to + Say hello as a link. Past events appear only once there are some. +6. **Three layers above the grid, not seven:** heading, strip, month. The way tabs go (the dock is + the visit way); the legend is two keys under the grid. + +Where it lives: mostly koordi's `` element, added as options so other businesses +keep today's look (calm style, month per page, first lively day chosen, one-line day, host as a +link, past hidden while empty), plus a new event that tells the page which day is chosen. Split +`calendar.js`'s styles out first (864 lines). The heading, strip words and dock are the site's. +koordi deploys first; the site works with either version. + +For the owner, not the design: visit hours are still the default weekdays 9 to 5. If people +mostly come on weekends, the owner sets that in the console. + +Decisions added: (7) the six refinements, as options in koordi; (8) one month per page, or keep +five rolling weeks. + +Sketch note: the artifact's sketch is a working mock (no mail is sent). Its first version used +`
    ` submits, which claude.ai's sandboxed frame blocks before the submit event fires, so Keep +me posted and Send did nothing there; it now uses plain buttons. The live site's Come out to the +land was checked and works. + +## What changes (first version) + +1. **One sheet instead of two.** Today the chapters and What's on are separate sheets, so getting + from a chapter to the calendar means closing one and opening the other. One sheet, one tab bar: + `Our vision · How we live · The land · Gatherings · ✦ What's on` (the last tab gold). Say hello + stays reachable from the header's Get in touch and from the calendar. +2. **A bridge at the end of every chapter.** A card with one line that fits the chapter and two + buttons: gold **See what is unfolding** (opens What's on) and glass **Keep me posted** (opens an + email field in place, no navigation). + - Our vision: "The dream is already taking root." + - How we live: "These principles are lived on the land, not only read." + - The land: "Ten acres, open on chosen days." Its gold button reads **Choose a day on the + land** and opens the calendar instead of jumping straight to the visit form. + - Gatherings: "The first gatherings are being set now." Host a gathering stays as a link. +3. **A next-step dock on the calendar.** Pinned under the calendar: gold **Come out to the land** + (first open day, or the day chosen) and the one-field **Keep me posted**. It replaces the + "Something else in mind? Say hello" line, which moves into the dock as a small link. +4. **Keep me posted is its own one-field form.** Email only (name optional), separate from Say + hello's three fields. For now it posts to HAND's feedback function with + `source: "mystichearts-list"`; when koordi's list lands (record 0040 C1, C2 and C5) it moves + there with no change on the page. +5. **Every finish line points at the other ask.** + - Visit request sent: "A person confirms by hand." Then Keep me posted (if not already) and the + next gathering on the calendar. + - Signed up: "You are on the list." Then Come out to the land. + - Say hello sent: "Received, with thanks." Then See what is unfolding. +6. **Links that land inside the funnel.** The sheet state lives in the address hash: `#whats-on`, + `#visit`, `#keep-posted`, `#vision`, `#principles`, `#land`, `#gatherings`. A flyer QR, an + Instagram bio or a text message can open the calendar directly, and the back button closes the + sheet. + +The hero stays as it is: gold What's on and glass Visit the land, Get in touch in the header, +the chapter row at the foot. + +## Steps to the best action + +| From | To | Today | Proposed | +| --- | --- | --- | --- | +| Our vision or How we live | the calendar | 2 taps (close, then What's on) | 1 tap | +| Our vision or How we live | any action | none offered | 1 tap | +| Any chapter | signup | 2 taps (close, then Get in touch) and three fields | 1 tap and one field | +| The land | a visit request | 1 tap, but skips the calendar | 2 taps (calendar, then a day), seeing what is on | +| The calendar | a visit request | 1 tap, on a tab above the calendar | 1 tap, on a dock under it where the eye lands | +| Visit request sent | anything else | dead end | 1 tap | + +## Decisions for koH + +1. **One sheet** for chapters and What's on (recommended), or keep two sheets and add the bridge only. +2. **Keep me posted asks for email only** (recommended), or email and name. +3. **The land's button opens the calendar** (recommended, so they see what is on), or goes straight + to the visit form as today. +4. **Hash links** for every view (recommended). + +## Build (one session after sign-off) + +- Site only, no koordi change: `mystic-hearts-page.tsx`, `story-sheet.tsx` and `contact-modal.tsx` + fold into one funnel sheet; new `keep-posted.tsx`; bridge lines in `copy.ts`; dock and bridge + styles in `app/globals.css`. +- Later, with koordi: a compact "next three days" strip inside each bridge (the calendar's marquee + in a small mode), so a chapter reader can pick a day without opening the full calendar; and the + list moving to koordi (C5). +- Verify at 375 and 1440 wide, keyboard and reduced motion, then `./scripts/publish-mhh.sh`. diff --git a/plans/004-yuhm-the-mission.md b/plans/004-yuhm-the-mission.md index c9d77cdd..552b4931 100644 --- a/plans/004-yuhm-the-mission.md +++ b/plans/004-yuhm-the-mission.md @@ -4,7 +4,7 @@ Status: PROPOSED (demo built, nothing in the app changed) Date: 2026-09-19 Scope: `yuhm/` app, one new migration in `command/supabase/migrations/`, new Netlify functions in `yuhm/netlify/functions/` Demo: https://claude.ai/artifact/FwbwZigM85r1ECY2D2PB4Q (private to koH; source in `yuhm/prototypes/the-mission/`, outside the Vite build and the publish dir) -Companion: plan 005 (`005-yuhm-gatherings-koord.md`), gatherings and classes coordinated by koord. It shares this plan's notification pipeline, adds a `gathering` notification category, a `shop_run` mission source type, and seven gathering mission templates. Neither plan blocks the other. +Companion: plan 005 (`005-yuhm-gatherings-koord.md`), gatherings and classes coordinated by koordi. It shares this plan's notification pipeline, adds a `gathering` notification category, a `shop_run` mission source type, and seven gathering mission templates. Neither plan blocks the other. ## Why @@ -190,7 +190,7 @@ Rules: ### Migration notes -Next free number is 049 as of 2026-09-19, but `koord/` and the client sites share the folder: take the number at build time. Name it `NNN_yuhm_missions.sql` (applied `wxl` filenames stay as they are). Validate the full chain in the podman Supabase image, then apply through the management API. Migrate first, deploy second. +Next free number is 049 as of 2026-09-19, but `koordi/` and the client sites share the folder: take the number at build time. Name it `NNN_yuhm_missions.sql` (applied `wxl` filenames stay as they are). Validate the full chain in the podman Supabase image, then apply through the management API. Migrate first, deploy second. ## Notifications diff --git a/plans/005-yuhm-gatherings-koord.md b/plans/005-yuhm-gatherings-koord.md index 2f27661b..1c2f6cdb 100644 --- a/plans/005-yuhm-gatherings-koord.md +++ b/plans/005-yuhm-gatherings-koord.md @@ -1,14 +1,14 @@ -# Plan 005: yuhm gatherings (beta), coordinated by koord +# Plan 005: yuhm gatherings (beta), coordinated by koordi Status: PROPOSED (nothing built in the app; demo screens exist; decision 1 settled) Date: 2026-09-20 Demo: the "Gatherings beta" group (five screens) in https://claude.ai/artifact/FwbwZigM85r1ECY2D2PB4Q, version 3. Source: `yuhm/prototypes/the-mission/gather.js` and `gather.css`, loaded through a small extension hook in `mission.js`. -Scope: `yuhm/` app, one new migration in `command/supabase/migrations/`, new Netlify functions in `yuhm/netlify/functions/`, a host adapter that lets yuhm use `koord/` as a library +Scope: `yuhm/` app, one new migration in `command/supabase/migrations/`, new Netlify functions in `yuhm/netlify/functions/`, a host adapter that lets yuhm use `koordi/` as a library Companion: plan 004 (THE MISSION). The two share one notification pipeline and the mission templates. Neither blocks the other. ## Why -koH, 2026-09-20: plan the booking system (`book/`, renamed `koord/` the same day) into the yuhm work. koord will coordinate every HAND feature in time, but the first thing to present is a beta for **gatherings and classes**. The first worked case is a **food prep gathering**: +koH, 2026-09-20: plan the booking system (`book/`, renamed `koordi/` the same day) into the yuhm work. koordi will coordinate every HAND feature in time, but the first thing to present is a beta for **gatherings and classes**. The first worked case is a **food prep gathering**: - Each attendee says exactly what they want to prepare. - That generates their order as an itemized list. @@ -25,7 +25,7 @@ koH, 2026-09-20: plan the booking system (`book/`, renamed `koord/` the same day | "Source it from our app": inventory lots and allocations (031), harvest runs (030), rescues (028), drop-offs (040) | first-generation, browser to RPC | Live. | | `food_payment_orders` and Stripe tables | 033, 035 | Shaped for the marketplace lane: needs a `commitment_id` and carries a HAND fee (5 percent, capped at $3). Not a fit for pooled groceries as it stands, and plan 003 lists a reconciliation defect to fix before Stripe goes live. | | Notification queue, consent, quiet hours: `food_outbox`, `food_contact_channels` | 032 | Applied. Plan 004 builds the `mission-notify` function on them. | -| koord: plan and RSVP, time poll, reminders, notices, groups, invite codes, delivery policy, ladder, quiet hours, event aggregation | `koord/src` | Pure tested modules. No storage, no channel plugin, no API, nothing deployed, nothing committed. | +| koordi: plan and RSVP, time poll, reminders, notices, groups, invite codes, delivery policy, ladder, quiet hours, event aggregation | `koordi/src` | Pure tested modules. No storage, no channel plugin, no API, nothing deployed, nothing committed. | What is missing for food prep: recipes, per-attendee orders with a source per line, shop runs with a consolidated list, receipts and settle-up, bins and pick lists. @@ -33,7 +33,7 @@ What is missing for food prep: recipes, per-attendee orders with a source per li Four named deadlines drive everything: **cutoff** (default 48 hours before start), **shop window** (ends at most 90 minutes before start when the list has chilled or frozen lines), **start**, and **settle by** (default 3 days after). -1. **Create.** An organizer sets the type (`prep`), venue, capacity, and either a time or a koord time poll (three proposed times, approval voting, a deadline). They attach a **menu** of recipe kits, or leave the menu open. They set the cutoff, the stores, and how many covered spots exist. +1. **Create.** An organizer sets the type (`prep`), venue, capacity, and either a time or a koordi time poll (three proposed times, approval voting, a deadline). They attach a **menu** of recipe kits, or leave the menu open. They set the cutoff, the stores, and how many covered spots exist. 2. **Join and order.** An attendee answers yes, picks dishes and servings. The app scales each recipe and writes **order lines**. Every line has a **source**: `bring`, `network`, `buy`, or `pantry`. The attendee sets a default and can override any line (bring my own rice, network tomatoes, buy chicken). Each `buy` line carries a substitution choice: fine, ask me, or skip it. 3. **Cutoff.** Orders lock. The app turns `network` lines into allocations against real lots plus pickup runs, groups `buy` lines into **shop runs** by store, assigns each order a **bin number**, and computes each person's share. 4. **Pay.** Each buyer sees "your share": estimate plus a buffer. They pay the gathering's **money holder** (the organizer unless they name someone else) however the two of them agree: cash, Venmo, Cash App, Zelle. The money holder keeps a **paid checklist** and ticks each person by hand. The app moves no money and checks no payment (decision 1, settled 2026-09-20). Only ticked orders, covered orders, and orders the organizer chooses to keep go onto the shop list. @@ -55,11 +55,11 @@ A **class** is the same model with a teacher, one fixed kit for everyone, and an 6. **Food safety is in the model.** Catalog items carry `temperature_class` (the same values as `food_supplies`). A run with chilled or frozen lines gets a cooler step and a short window. The gathering page shows the allergen set computed from the locked orders ("this kitchen will handle peanuts, shellfish"). A private home keeps 033's rules: verified venue, address released on a timer to confirmed people only. 7. **Ground rule 1 from plan 004 holds.** A gathering may appear on the food map as a plain listing ("community cook, Saturday, covered spots"). No seeds, no prompts, no account wall to read it. -## Where koord fits +## Where koordi fits -koord is the engine; yuhm is its first host with real storage. +koordi is the engine; yuhm is its first host with real storage. -| Need | koord module | yuhm side | +| Need | koordi module | yuhm side | | --- | --- | --- | | Pick the date | `coordination/poll.mjs` | poll rows on the event | | RSVP rules, share link, invite codes | `coordination/plan.mjs`, `codes.mjs` | `food_event_rsvps`, `food_event_invites` | @@ -68,7 +68,7 @@ koord is the engine; yuhm is its first host with real storage. | Quiet hours, caps, consent, dedup, channel order | `delivery/policy.mjs`, `ladder.mjs`, `quiet-hours.mjs` | `food_contact_channels`, `food_notification_prefs`, `food_notification_log` (plan 004) | | Outside classes and events people can go to together | `events/` (Luma, Resident Advisor, a pasted link) | phase G4 | -This leans on koord's first open decision (where the layer runs). Recommended answer for yuhm: **koord runs as a library inside the host.** yuhm's Netlify functions import the pure modules; yuhm's tables are the store; yuhm's existing Resend wiring becomes koord's first real channel behind `defineChannel()`. A central service stays possible later because the modules do not know where they run. That also gives koord's missing contact model a concrete first shape: `food_participants` plus `food_contact_channels`. +This leans on koordi's first open decision (where the layer runs). Recommended answer for yuhm: **koordi runs as a library inside the host.** yuhm's Netlify functions import the pure modules; yuhm's tables are the store; yuhm's existing Resend wiring becomes koordi's first real channel behind `defineChannel()`. A central service stays possible later because the modules do not know where they run. That also gives koordi's missing contact model a concrete first shape: `food_participants` plus `food_contact_channels`. Record 0004 stays intact. A notice carries a type and a key, not order contents. Nothing about a gathering is mirrored into a HAND-run channel. Ruling 4 (money runs through the owner's own accounts, HAND does not hold it) drives decision 1. @@ -187,7 +187,7 @@ Functions (repo naming): `create_food_gathering`, `set_food_gathering_menu`, `up Migration: take the number at build time (plan 004 notes 049 was next free on 2026-09-19 and the folder is shared). `NNN_yuhm_gatherings.sql`. Validate the chain in the podman Supabase image; migrate first, deploy second. -## Notifications (through koord's policy, into plan 004's pipeline) +## Notifications (through koordi's policy, into plan 004's pipeline) | Message | Trigger | Channels | | --- | --- | --- | @@ -203,18 +203,18 @@ Add one category, `gathering`, to `food_notification_prefs` so people can mute i ## Phases -- **G0. Sign-off.** koH settles the decisions below (decision 1 is settled). The demo has five gathering screens: the gathering, build my order, the paid checklist with its settle tab, the shop run with the sort sheet, pick up my bin with the balance. Not in the demo: the organizer's create flow and the koord time poll. -- **G1. Beta, no money processing.** Public gathering page, RSVP, menu of kits, build my order with a source per line, cutoff lock, the money holder's paid checklist (ticked by hand, with covered, shop anyway, and drop), shop runs with the consolidated list and receipt, sort sheet, bins, pick list, balances with a hand-ticked settled box, email notices through koord. EN and ES. Seed data: about 60 catalog items and 8 kits written with koH or a cook. Done when twelve test orders lock into one list whose shares sum to a test receipt to the cent, and a phone walks shop to pick to balance. +- **G0. Sign-off.** koH settles the decisions below (decision 1 is settled). The demo has five gathering screens: the gathering, build my order, the paid checklist with its settle tab, the shop run with the sort sheet, pick up my bin with the balance. Not in the demo: the organizer's create flow and the koordi time poll. +- **G1. Beta, no money processing.** Public gathering page, RSVP, menu of kits, build my order with a source per line, cutoff lock, the money holder's paid checklist (ticked by hand, with covered, shop anyway, and drop), shop runs with the consolidated list and receipt, sort sheet, bins, pick list, balances with a hand-ticked settled box, email notices through koordi. EN and ES. Seed data: about 60 catalog items and 8 kits written with koH or a cook. Done when twelve test orders lock into one list whose shares sum to a test receipt to the cent, and a phone walks shop to pick to balance. - **G2. Network sourcing and missions.** `network` lines allocate against inventory lots and harvest stops; pickups and shop runs become missions with seeds (needs plan 004 phase 1 for the board, phase 2 for offers). - **G3. Money on rails, classes with a fee, recurring gatherings.** Decision 1, option B. Covered spots from a subsidy campaign. Needs plan 003's Stripe reconciliation fix and a `/hand-tax` pass. -- **G4. Outside events and the helper.** koord's event aggregation in the gather tab; helper tools ("what is on my list", "add cilantro", "I am running late"). +- **G4. Outside events and the helper.** koordi's event aggregation in the gather tab; helper tools ("what is on my list", "add cilantro", "I am running late"). G1 does not wait on plan 004. Whichever ships first builds the shared outbox to notify function once. ## Decisions for koH (recommendation in brackets) 1. **How grocery money moves. SETTLED by koH, 2026-09-20: option A, done by hand.** koH: "yes direct settle works. for first implementation, we can have a check list of users who have paid where we do it manually." So the first implementation is a paid checklist the money holder ticks; no "sent" button, no payment handles stored, no processor. Options as they were put: (A) Settle directly: the app computes shares, people pay each other outside the app (Venmo, Cash App, Zelle, cash at the door), balances settle the same way. HAND touches no money. (B) Stripe Connect on the organizer's or host kitchen's own account, which matches record 0004 ruling 4. A neighbor doing one grocery run should not have to pass Stripe identity checks, so the connected account is the organizer, who pays or reimburses the shopper. (C) HAND collects and pays out. [A for the beta, B in G3, never C without counsel: holding other people's grocery money raises custody, licensing, and restricted-fund questions that `/hand-tax` and `/fiscal` have not looked at.] -2. **Where koord runs for yuhm.** [As a library inside yuhm; yuhm's tables are the store. Record it as a koord decision.] +2. **Where koordi runs for yuhm.** [As a library inside yuhm; yuhm's tables are the store. Record it as a koordi decision.] 3. **Buffer on estimates.** [15 percent, rounded up to the dollar, refunded at settle.] 4. **After the cutoff, no refund on bought lines.** [Yes, with name-a-collector and release-to-the-table.] 5. **Pantry items: host kitchen supplies them, or pooled and split?** [Organizer chooses per gathering; default pooled.] @@ -229,6 +229,6 @@ G1 does not wait on plan 004. Whichever ships first builds the shared outbox to - **A shopper out of pocket.** Unpaid lines drop at pay-by; per-line ceilings cap overspend; the organizer sees an unclaimed run 36 hours out. - **Cold chain and allergens** in a shared kitchen. Temperature class, the cooler step, the short window, and the computed allergen notice are part of G1, not polish. - **Private homes.** Keep 033's venue verification and timed address release. Start the pilot in a public or partner kitchen. -- **Two RSVP models** (koord's plan attendees, yuhm's `food_event_rsvps`). yuhm's table is the store; koord's functions are the rules. An order needs an account; reading a gathering does not. +- **Two RSVP models** (koordi's plan attendees, yuhm's `food_event_rsvps`). yuhm's table is the store; koordi's functions are the rules. An order needs an account; reading a gathering does not. - **A hand-kept checklist can be wrong.** One money holder per gathering, every tick stamped with who and when, an audit row per change, and an undo. The attendee sees their own state ("marked paid" or "not marked yet"), so a missed tick gets noticed before the shop run, not at the door. - **Scope.** Nine tables is a real build. G1 can ship without `network` sourcing and without classes; the order, the list, the bins, and the balance are the beta. diff --git a/threehandshealing/HANDOFF.md b/threehandshealing/HANDOFF.md index 39c1912b..8b342178 100644 --- a/threehandshealing/HANDOFF.md +++ b/threehandshealing/HANDOFF.md @@ -15,8 +15,23 @@ licensed photos, indexable); the old three-direction preview moved to `styles/original/`. Next layer is planned, not built: `plan-eft-and-ghl-funnel.md` (EFT "what to expect" page + GoHighLevel funnel). Next human step: text Maria.** +## Owner-editable rebuild (2026-09-06) — `clients/three-hands-healing/` + +The Cathedral design now also exists as an **owner-editable site** on the +HAND client-site engine (the ZeroBlur pattern turned into a template): +Maria will edit every line and photo at `/admin/` with a one-time email +link. Built with the `hand-client-site` skill; state and next steps in +`clients/three-hands-healing/HANDOFF.md`. **LIVE since 2026-09-06 at +https://three-hands-healing.netlify.app** (own Netlify site, shared Supabase, +migration 044 applied). Owners who can sign in at `/admin/`: +maria.komie@gmail.com, cryptokoh@gmail.com, hand@handprotocol.org. The public +page at https://handprotocol.org/threehandshealing/ is unchanged; the +cut-over to 3handshealing.com stays a separate, later step. Not committed. + ## Start here (cold session) +0. **Booking safety / client vetting work (2026-09-16/17):** read + `../docs/closed/threehandshealing/HANDOFF-booking-safety.md` instead of this file; it is self-contained. 1. Read this file. Then `design-portfolio-brief.md` if you touch any style page. 2. Two things are waiting on Maria: **style picks** (she hearts styles in the gallery → "Send picks to koH" → `command.feedback_pins` row tagged diff --git a/web/discovery/style.css b/web/discovery/style.css index ddd70327..c1d07a4c 100644 --- a/web/discovery/style.css +++ b/web/discovery/style.css @@ -25,6 +25,8 @@ --color-accent: #D97706; --color-accent-hover: #B45309; + --color-accent-action: #B45309; + --color-accent-action-hover: #92400E; --color-accent-warm: #F59E0B; --color-accent-light: #FEF3C7; --color-accent-glow: rgba(217, 119, 6, 0.15); @@ -147,10 +149,12 @@ transition: opacity 180ms ease, transform 180ms ease, visibility 0s; } @media (max-width: 640px) { - .qf-link__tip { left: 0; transform: translateX(0) translateY(4px); max-width: min(280px, calc(100vw - 32px)); } + /* Collapse the hidden tip to zero width: a visibility:hidden box still + counts toward scrollable overflow and widened the mobile viewport. */ + .qf-link__tip { left: 0; transform: translateX(0) translateY(4px); max-width: min(280px, calc(100vw - 32px)); width: 0; padding: 0; overflow: hidden; } .qf-link__tip::after { left: 16px; transform: none; } .qf-link:hover .qf-link__tip, - .qf-link:focus-visible .qf-link__tip { transform: translateX(0) translateY(0); } + .qf-link:focus-visible .qf-link__tip { transform: translateX(0) translateY(0); width: max-content; padding: 0.625rem 0.875rem; overflow: visible; } } /* ---- Skip-link (keyboard accessibility) ---- */ @@ -269,8 +273,18 @@ p { color: var(--color-text-secondary); line-height: 1.75; margin-bottom: var(-- text-decoration: none; white-space: nowrap; } -.btn--primary { background: var(--color-accent); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); } -.btn--primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 6px 18px var(--color-accent-glow); } +.btn.btn--primary { + background: var(--color-accent-action); + color: #fff; + border: none; + box-shadow: 0 1px 2px rgba(0,0,0,0.05); +} +.btn.btn--primary:hover { + background: var(--color-accent-action-hover); + color: #fff; + transform: translateY(-1px); + box-shadow: 0 6px 18px var(--color-accent-glow); +} .btn--ghost { background: transparent; color: var(--color-text); border: 1.5px solid var(--color-border-strong); } .btn--ghost:hover { border-color: var(--color-text); } .btn--dark { background: var(--color-bg-cta); color: var(--color-text-on-dark); } diff --git a/web/foundation-campaign/style.css b/web/foundation-campaign/style.css index f5f098f1..93933cfe 100644 --- a/web/foundation-campaign/style.css +++ b/web/foundation-campaign/style.css @@ -29,6 +29,8 @@ --color-accent: #D97706; --color-accent-hover: #B45309; + --color-accent-action: #B45309; + --color-accent-action-hover: #92400E; --color-accent-warm: #F59E0B; --color-accent-light: #FEF3C7; --color-accent-glow: rgba(217, 119, 6, 0.15); @@ -166,14 +168,16 @@ strong { white-space: nowrap; } -.btn--primary { - background: var(--color-accent); +.btn.btn--primary { + background: var(--color-accent-action); color: #fff; + border: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); } -.btn--primary:hover { - background: var(--color-accent-hover); +.btn.btn--primary:hover { + background: var(--color-accent-action-hover); + color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px var(--color-accent-glow); } @@ -2243,11 +2247,14 @@ strong { transition: opacity 180ms ease, transform 180ms ease, visibility 0s; } @media (max-width: 640px) { - /* On narrow viewports a centred tip can clip; left-anchor it instead. */ - .qf-link__tip { left: 0; transform: translateX(0) translateY(4px); max-width: min(280px, calc(100vw - 32px)); } + /* On narrow viewports a centred tip can clip; left-anchor it instead. + While hidden, collapse it to zero width: a visibility:hidden box still + counts toward scrollable overflow, and a 280px tip hanging off a link + mid-line widened the mobile viewport and pushed the nav toggle off-screen. */ + .qf-link__tip { left: 0; transform: translateX(0) translateY(4px); max-width: min(280px, calc(100vw - 32px)); width: 0; padding: 0; overflow: hidden; } .qf-link__tip::after { left: 16px; transform: none; } .qf-link:hover .qf-link__tip, - .qf-link:focus-visible .qf-link__tip { transform: translateX(0) translateY(0); } + .qf-link:focus-visible .qf-link__tip { transform: translateX(0) translateY(0); width: max-content; padding: 0.625rem 0.875rem; overflow: visible; } } /* ======================================== @@ -2656,7 +2663,10 @@ strong { .stay-close__grid { display: grid; - grid-template-columns: 1fr; + /* minmax(0, 1fr): a bare 1fr track floors at min-content, and the text + inputs' intrinsic width (~266px) would widen the page past narrow + viewports and push the nav toggle off-screen. */ + grid-template-columns: minmax(0, 1fr); gap: var(--space-2xl); max-width: 64rem; margin: 0 auto; @@ -2737,6 +2747,8 @@ strong { } .stay-close__input { + width: 100%; + min-width: 0; font-family: inherit; font-size: 1rem; line-height: 1.5; diff --git a/yuhm/HANDOFF.md b/yuhm/HANDOFF.md index 067c4f38..58a38230 100644 --- a/yuhm/HANDOFF.md +++ b/yuhm/HANDOFF.md @@ -21,19 +21,19 @@ koH asked for a run-sheet tool for someone picking food up anywhere and sharing - **Browser pass, 2026-10-06:** the whole practice run (ask, pick up, split, deliver, finish) plus Families, Seeds, Advanced, and Plan a run, at 390 and 1280 wide, and in Spanish. No console errors, no horizontal overflow. Five fixes landed in `6c8c1eee7`. - **Not done:** screen tests, entry links (Contribute tab, member menus, coordinator dashboard), the living docs page with wireframes, the videos. **050 is not applied to production and nothing is deployed.** -## Gatherings beta, coordinated by koord: plan only, 2026-09-20 (nothing built) +## Gatherings beta, coordinated by koordi: plan only, 2026-09-20 (nothing built) -koH asked to plan the booking system (`../koord/`, renamed from `book/`) into the yuhm work, starting with a beta for gatherings and classes. First worked case: a food prep gathering where each attendee says what they want to prepare, gets an itemized order, picks a source per line (bring, network with a pickup, or buy through a shared grocery run), and finds their items in a numbered bin on arrival. +koH asked to plan the booking system (`../koordi/`, renamed from `book/`) into the yuhm work, starting with a beta for gatherings and classes. First worked case: a food prep gathering where each attendee says what they want to prepare, gets an itemized order, picks a source per line (bring, network with a pickup, or buy through a shared grocery run), and finds their items in a numbered bin on arrival. -- **Plan:** `../plans/005-yuhm-gatherings-koord.md` (the nine-step flow, what 033 already provides, where koord and THE MISSION fit, SQL sketch for ten new tables, functions, notifications, phases G0 to G4, nine decisions, risks). +- **Plan:** `../plans/005-yuhm-gatherings-koord.md` (the nine-step flow, what 033 already provides, where koordi and THE MISSION fit, SQL sketch for ten new tables, functions, notifications, phases G0 to G4, nine decisions, risks). - **Reuse found:** migration 033 already has `food_venues`, `food_events`, items, invites, RSVPs, assignments, and the `potluck` lane gate; 034 has `plan_food_potluck()` and `release_food_event_location()`. Only the undeployed coordination API uses them today. -- **Settled by koH, 2026-09-20:** grocery money settles directly between people, by hand. The first implementation is a paid checklist the money holder ticks (paid, covered, shop anyway, drop), then a second tick for settled. No processor, no stored payment handles, HAND holds no money (koord record 0004 ruling 4). -- **Proposed, still open:** koord runs as a library inside yuhm (yuhm's tables are the store, Resend is koord's first real channel). +- **Settled by koH, 2026-09-20:** grocery money settles directly between people, by hand. The first implementation is a paid checklist the money holder ticks (paid, covered, shop anyway, drop), then a second tick for settled. No processor, no stored payment handles, HAND holds no money (koordi record 0004 ruling 4). +- **Proposed, still open:** koordi runs as a library inside yuhm (yuhm's tables are the store, Resend is koordi's first real channel). - **Demo:** five gathering screens are the last group in THE MISSION demo (artifact version 3, same link as below): the gathering, build my order, paid checklist with a settle tab, shop run with a sort sheet, pick up my bin with the balance. Source: `prototypes/the-mission/gather.js` + `gather.css`, plugged in through `window.YUHM_DEMO_EXT` in `mission.js`. **Republishing now needs four files** in the `files` map: `mission.css`, `mission.js`, `gather.css`, `gather.js`. `preview.mjs` walks the gathering flow too and checks that the shares equal the receipt. - **Fixed along the way:** `.p-body > * { flex-shrink: 0 }` in `mission.css`. Tall phone screens were squashing children with `overflow: hidden` instead of scrolling. Still open in the core demo: a direct child of `.p-body` that sets `transform` (the thank-you note's tilt) loses it when the enter animation ends; use the `rotate` property instead, as `.bin-tag` does. - **Plain-language intro (artifact version 4):** koH found the page's first paragraph too obscure for someone who does not know yuhm. It now opens with what yuhm is (a free food network for Austin, no account to find food), then what the page is (a demo and plan for two unbuilt ideas, THE MISSION and Gatherings). - **Session handoff (read first when resuming):** `_handoff-2026-09-20-gatherings-koord.md` covers the settled and open decisions, the findings not to rediscover, the demo's extension hook and gotchas, what was verified, and how to republish. -- **Next step:** koH settles the remaining eight decisions in plan 005; where koord runs comes first because it unblocks storage. Not in the demo yet: the organizer's create flow and the koord time poll. +- **Next step:** koH settles the remaining eight decisions in plan 005; where koordi runs comes first because it unblocks storage. Not in the demo yet: the organizer's create flow and the koordi time poll. ## THE MISSION: demo and plan only, 2026-09-19 (nothing in the app changed) diff --git a/yuhm/docs/LIVING-DOCS.md b/yuhm/docs/LIVING-DOCS.md index b806c59b..f6a356e2 100644 --- a/yuhm/docs/LIVING-DOCS.md +++ b/yuhm/docs/LIVING-DOCS.md @@ -518,7 +518,7 @@ Sample content should remain labeled until it is replaced by auditable records. ### Decide THE MISSION and gatherings -1. Settle the open decisions in plans 004 and 005. Where the booking service (koord) runs comes first. +1. Settle the open decisions in plans 004 and 005. Where the booking service (koordi) runs comes first. 2. Start Meta business verification early if the WhatsApp helper stays in scope. ## Documentation maintenance