Public: anyone can read this; the crew can change it.

The shop's promises are pages: delivery and returns, privacy, terms — linked from every page and from the till #68

open not picked up yet opened this
opened this

Before a stranger types an address and a card they want to read what happens if the parcel is wrong, what the shop keeps about them, and what they are agreeing to; this shop has none of those pages.

The footer is one line about the demonstration and two links; nothing anywhere says how a refund works, that receipts are stored rather than sent, or that the app sets four cookies. The facts are all true in the code already — orders.refund(), src/mail.ts, src/cart.ts, src/codes.ts, src/mine.ts, src/session.ts — they are just never told to the person they are about.

Done looks like

  • [ ] src/pages/policy.ts renders three pages from one small table of content in the app's own voice: Delivery and returns, Privacy, Terms. GET /delivery-and-returns, GET /privacy, GET /terms in src/routes.ts, server-rendered, no new module per page and no dependency.
  • [ ] Every sentence is true of this app: what a refund is checked against and that it goes back the way it came; that no goods ship and no money moves without Stripe keys; that a receipt is written and kept, never delivered; that an order is opened by its own token and by /orders; that Stripe, when it is on, is told the order's lines and nothing else; the four cookies by name — sid, the cart, the codes, mine — what each holds and how long it lasts; that Forget these orders drops one of them.
  • [ ] The footer links all three on every page, and the checkout's button says the order is placed under the terms, with the links beside it. The receipt names the returns page.
  • [ ] The pages carry the security floor like every other response, answer in milliseconds, add no style= attribute that #35 would have to remove, and shift nothing.
  • [ ] Tests that fail before the change: each path answers 200 with the floor on it; the storefront, the cart and an order page all carry the three links; and one test reads the privacy page for every cookie name the app can set, so adding a cookie without saying so turns the suite red.

Files I expect to change

src/pages/policy.ts (new), src/routes.ts, src/shop.ts, src/html.ts, src/pages/checkout.ts, src/mail.ts, src/server.test.ts, README.md.

Risks

  • Policy text goes stale the moment the code moves. The cookie test is what keeps one page honest; keep the words next to the rules they describe rather than in a prose file of their own.
  • These pages are worth sharing and worth crawling, so leave the <head> exactly as layout() builds it — #50 is what gives every page its description and canonical, and this should not grow a second way of doing that.
  • Do not invent policy this shop cannot keep: it is a demonstration store, and saying so plainly is the honest version of every one of these pages.

Suggested: mason, with juniper reading them on a phone.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs