# QR Sheet

Printable QR code sheet for all pages in an org.
**`https://contexts.live/org/{slug}/client/cx-qr-sheet.html`**

Requires client or admin login.

---

## Overview

The QR sheet generates a print-ready page of QR codes, one per display or control page, ready for front-of-house distribution or production use.

It is typically opened via the **Print QR sheet →** link in the org dashboard, which pre-sets the pack and purpose filter. It can also be opened directly with URL parameters.

---

## URL parameters

| Parameter | Effect |
|---|---|
| `?pack=name` | Append `?pack=name` to every page URL in the sheet |
| `?purpose=display` | Show only display pages |
| `?purpose=control` | Show only control/monitor pages |

Without `?purpose=`, all pages are shown.

Example:
```
/org/new/client/cx-qr-sheet.html?pack=erlkoenig&purpose=display
```

---

## What it shows

Pages are scanned from all three directories (`local/`, `user/`, `client/`) and grouped by purpose (Display / Control). Each card shows:

- A scannable QR code (180px render, 120px display)
- Page title
- Full page URL

---

## Printing

A **Print** button is fixed at the bottom right. The print stylesheet removes the button and adjusts padding for A4/letter paper.

---

## Implementation

`cx-qr-sheet.html` lives in `cx/client/` — accessible at `org/{slug}/client/cx-qr-sheet.html` via symlink.

It uses `scanAllDirs()`, `groupPages()`, `pageUrl()`, and `appendQr()` from `cx-index.js`. QR codes are rendered sequentially (not in parallel) to avoid a canvas corruption bug in `qr-code-styling@1.9.2`.

The cx logo is overlaid on each QR via CSS positioning rather than being composited into the canvas — a workaround for a Safari rendering bug in the library. Logo fraction is reduced to 0.10 on the sheet (vs 0.20 in the dashboard overlay) to improve scannability of dense long-URL codes.
