Notifications, files, payments and AI
Give people control over actions that affect their data, attention or money.
Notifications and preferences
Let people choose the updates they need. Keep essential account or task information available inside the product.
Implementation guide for notifications and preferences
When to use it
Distinguish inline feedback, persistent in-product notifications, browser notifications and outbound email/SMS. A save result usually needs inline status; it does not justify a notification service. Use persistent notifications when users must find a later event or action. Request browser permission only when the user chooses the benefit. Marketing preferences are separate from necessary service notices.
States and recovery
Empty/unread/read, delivery queued/sent/failed/unknown, permission unavailable/denied/revoked, paused and preference-save failure. “Sent” is not “read”; a queued message is not delivered. A dismissed message must not erase the only recovery route. Support duplicate suppression and a meaningful order for concurrent events. A click marks read only according to the documented product rule.
Keyboard and screen readers
Use a list with meaningful headings, dates and destination links. “Mark as read” is a button, not a navigation link. Expose unread state in text or accessible naming as well as colour. New background notifications do not steal focus. Announce concise relevant changes, not the whole feed. Do not put a changing global badge into an incessant alert. An auto-dismissing toast cannot contain the sole essential action; timing controls follow applicable accessibility requirements.
Layout and preferences
Notifications remain reachable in compact navigation; do not rely on a desktop hover bell. Long subjects/actions wrap. Respect reduced motion and the user's notification choices; no autoplay sounds as a substitute for text. Test native permission prompts and actual mobile delivery only if that channel is implemented.
Implementation
Use ordinary lists, links, buttons, status and native checkbox settings. A short action menu can offer item commands; a list of notification destinations is not an ARIA menu. Example: Common shows “Import finished: 8 links added, 2 need review” with a link to the retained result. The product owns event storage, channel preferences, deduplication, delivery receipts and failure handling; there is no core toast/notification-centre API.
Data and permissions
Authorise each notification and linked object. Avoid sensitive record details in lock-screen or email previews. Validate destinations and escape external text. Configure sender credentials and recipient scoping server-side; rate-limit abuse and define retention. A user preference does not itself authorise the agent or application to contact a person outside the agreed task.
Checks to run
- Deny/revoke permission, change preferences and fail delivery without blocking the main task.
- Duplicate events create one intended notice; its link works after refresh and respects current access.
- Keyboard/AT can discover unread state and recover a dismissed action.
- Actual delivery claims match channel evidence, with no sensitive preview leakage. Not verified; edition 0.2.0-rc.2.
Upload and download files
Show accepted file types before a person chooses a file. Keep the filename visible through checking, transfer and recovery.
Implementation guide for upload and download files
When to use it
Use a native picker for file entry; drag/drop is an additional convenience. State useful type/size/count limits before selection. Prefer a simple attachment over a complex preview/editor when editing is not required. Separate upload from scanning, conversion, import and publication. Download links identify format and useful size/version information.
States and recovery
No selection → selected → validating → transferring → processing → accepted, partly accepted, rejected, cancelled or outcome unknown. Multiple files have individual outcomes and a clear aggregate. Selecting a file is not uploading it; reaching 100% transfer is not successful processing. Retry only failed files when safe; identify duplicates. A cancelled client request may need server cleanup. A failed download offers a durable link or regeneration route without pretending a file reached disk.
Keyboard and screen readers
Keep a labelled input type="file" reachable; the entire drop zone must not be the only keyboard path. Give each remove/retry action a name including its file. Use a labelled native progress element for measured transfer; omit its value for unknown progress. Announce start and significant outcomes, not every byte. Removing a file restores logical focus; choosing files does not move focus into a silent hidden queue.
Layout and preferences
Long filenames wrap with useful type/size retained; don't hide the extension under ellipsis when it matters. Display controls remain reachable above the mobile keyboard. Avoid forced image previews, autoplay or huge eager downloads. Test picker return, portrait/landscape and cancelled selection on a real phone. Light/dark and forced colours must distinguish selected, rejected and completed files without colour alone.
Implementation
Existing labels, native input, buttons and status can form the interface:
<label class="ex-label" for="collection-file">Import a collection</label>
<p class="ex-hint" id="collection-file-help">Choose one JSON file.</p>
<input class="ex-input" id="collection-file" type="file"
accept=".json,application/json" aria-describedby="collection-file-help">This example selects a file only; it neither reads nor uploads it. accept is a picker hint, not security validation. A real product owns limits, parser/worker, queue, retry/cancel protocol, processing result and cleanup. No core upload API is implied.
Data and permissions
Independently validate allowed size/type/content and authorization server-side; use generated storage identifiers, safe download names and isolated storage/processing. Do not trust the client MIME, extension or filename. Choose scanning/content-disarm controls for the actual file threat; enforce processing/decompression budgets and keep private objects private. Prevent active content executing on the trusted application origin. Protect retrieval as well as upload and expiry of signed links. OWASP file-upload guidance.
Checks to run
- Picker and drop produce equivalent flows; cancel/replace/remove/retry maintain focus.
- Test over-limit, spoofed type, malformed content, traversal filename, processing failure and mixed batches against the actual service.
- Wrong-user upload/download and expired-link requests fail without object leakage.
- Lost responses and retries do not duplicate an import; verified download bytes/MIME/name match the intended artifact. Not verified; edition 0.2.0-rc.2.
Payments and purchases
Show the amount, currency and commitment before payment. Keep an interrupted payment from becoming a duplicate charge.
Implementation guide for payments and purchases
When to use it
Add payment only for a real commercial requirement. Prefer a suitable established provider's hosted or supported payment interface over collecting card details in generic fields. Quotes, trials, one-off purchases and subscriptions have different commitments. A visual price card alone is not a checkout.
States and recovery
Review price/currency/tax/recurrence → confirm → provider processing → additional verification if needed → authorised result. Include abandonment, declined payment, provider unavailable, delayed confirmation, duplicate attempt, changed price, refund/cancellation requested and refund/cancellation confirmed. A redirect back to “success” cannot itself establish payment. Pending must remain visible while authoritative confirmation is unavailable.
Keyboard and screen readers
Present the full payable commitment before the action, with a specific label such as “Pay £12” only when the reviewed total is actually £12. Identify renewal and cancellation terms where relevant. Provide an opportunity to correct or reverse the applicable consequential submission. Keep errors near their relevant inputs and test third-party hosted fields/verification. After a provider return, show a heading with the actual order state and a stable support/reference route. Do not trap people in a disabled pay button with no status.
Layout and preferences
Verify the entire provider journey on narrow screens, high zoom and keyboard/AT, including challenge screens and return navigation. Separate provider appearance limits from the EX theme; do not claim themed checkout without checking it. The total and commitment cannot disappear in a collapsed panel while the pay action stays visible.
Implementation
Use EX layout, headings, review rows, primary action and status around the provider integration. An example flow for Common's fictional paid export is “Review export → provider checkout → checking payment → download available”; no payment or entitlement service exists here. The server calculates/validates authoritative price, binds the order to its owner, creates provider operations and grants fulfilment only from verified state.
Data and permissions
Use stable logical operation keys and server duplicate protection; payment-provider idempotency is scoped to its documented API/version/retention and does not replace application order reconciliation. Stripe's idempotency reference illustrates one provider, not a required studio vendor. Verify webhook authenticity using the provider's supported implementation, process duplicates safely and tolerate out-of-order events. Never trust client totals or return-URL flags. Stripe webhook guidance. Keep secrets/card data out of client code and logs; determine actual compliance obligations for the chosen integration.
Checks to run
- Provider test-mode success/decline/challenge/cancel and delayed confirmation recover truthfully.
- Repeated submission, lost response and duplicate/out-of-order events produce one intended order/charge/entitlement.
- Forged webhook, tampered amount and wrong-owner receipt/download are denied.
- Refund/cancel states match provider evidence; only actual completed actions say completed. Test mode does not authorise live charges or establish live operation. Not verified; edition 0.2.0-rc.2.
Review AI suggestions
Let people inspect a suggestion and decide whether to use it. Show the details before an assistant acts on their behalf.
Implementation guide for review ai suggestions
When to use it
Use AI where its benefit outweighs uncertainty, latency and data cost. Deterministic rules or ordinary search may be simpler. Distinguish suggesting text, changing local drafts and taking external actions. Choose human review proportionate to consequence; do not require ceremonial approval for harmless reversible assistance already authorised.
States and recovery
Input/context selected → generating → draft → edited/reviewed → action ready → executing → verified result, partial effect, failure or unknown outcome. Include refusal, unsupported request, low-evidence answer, provider timeout, budget reached and cancellation. Stopping generation is not undoing an already executed tool call. Show what actually changed and what did not; do not report a model's assertion as verified completion.
Keyboard and screen readers
Label AI-produced content and make it editable or rejectable where appropriate. Keep focus in the user's task during streaming; do not announce every token. Offer a stable Stop control and announce meaningful completion/failure. For external effects, review exact destination, scope, data and consequences with specific controls. Generated Markdown/HTML must not create uncontrolled focus targets or masquerade as a trusted instruction panel.
Layout and preferences
Long output wraps and supports reading without a forced auto-scroll away from the user's position. Keep Stop/review controls reachable at narrow and short heights. Streaming/motion is optional; reduced motion retains progress text. Provide a concise result and expandable supporting detail; never conceal uncertainty solely in a tooltip. Manual workflow remains usable when AI is unavailable.
Implementation
Use textarea, buttons, status, a readable result region and native dialog only for a bounded consequential review. Example: Common proposes three collection names; accepting a name fills an editable field. A separate hypothetical “Share collection” action requires its own authorised service flow. Core provides neither model integration nor agent/tool runtime. The adopter owns provider/model pinning, prompts, retrieval, cost limits, safe rendering, evaluation and execution records.
Data and permissions
Treat retrieved documents and model output as untrusted data. Enforce tool/resource permissions outside the model; bound tools, costs and iterations. Where approval is required, bind it to the exact actor/action/parameters and verify it at execution; a model-supplied approval flag is insufficient. Separate tenant context, redact sensitive logs and check output before a tool consumes it. Prompt wording alone cannot prevent tool misuse. OWASP agent-security guidance.
Checks to run
- Representative tasks include useful, wrong, unsupported and ambiguous results; record model/prompt/tool versions and observed quality.
- Adversarial documents attempt instruction injection, exfiltration and cross-user access; actual tool boundaries deny them.
- Alter target/amount after approval, replay approval and retry a timed-out action; no unauthorised or duplicate effect occurs.
- Cancellation, partial effect and cost limit yield truthful recovery and a manual fallback. Not verified; edition 0.2.0-rc.2.
