Organism · beta · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: The survey
Rendered by survey.tsOpen example: Team survey · Do: The survey Use the full-page example to follow page links.
Do: The results
Rendered by survey.tsOpen example: Team survey · Do: The results Use the full-page example to follow page links.
Don't: Indexed by search engines
Rendered by survey.tsOpen example: Team survey · Don't: Indexed by search engines Use the full-page example to follow page links.
Don't: Without its privacy link
Rendered by survey.tsOpen example: Team survey · Don't: Without its privacy link Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| Team survey is computed by Loom's code from each member's own answers, encrypted in the browser (survey-crypto.js) and compared by role on the results page, not drawn by hand. | A showcase is proof only if the product's own code produced what it shows. | Automated: scripts/site/interactives/check.ts (recomputes the showcase data and fails on drift) |
| Answers are encrypted in the browser before they are sent. | Team answers are sensitive. | Automated: tests/unit (survey crypto) |
API
| Prop | Type | Required | Default | What it does |
|---|---|---|---|---|
results | boolean | No | false | The results page's mount. |
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | survey |
| Layer | Organisms |
| Category | app |
| Owner | Site system lead |
| Status | beta |
| Version | 1.0.0 |
| Source | apps/showcase/site/system/organisms/survey.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-26 | Team survey: computed by Loom's code from each member's own answers, encrypted in the browser (survey-crypto.js) and compared by role on the results page. |
Use when
- /survey/ and /survey/results.html, sent by a Loom consultant. Why: A task that needs the whole screen.
Do not use when
- Public marketing pages. Why: It is noindex and reached by a link from the consultant.
Anatomy
| Part | What it is |
|---|---|
| progress | div#progress (the survey) |
| app | div#app: the intro until the script takes over |
| noscript | A notice |
Made of: showcase-frame, panel, form-field, button, facts-list, table.
Used in: task-body, page-apps.
Variants
| Variant | When | Why |
|---|---|---|
| full | On its demo page and its section. | The whole experience where the claim is made. |
States
| State | Rendered or not applicable |
|---|---|
| default | Build-time respondent/results mounts show Loading until their own survey.js/results.js boot. Without JavaScript the respondent mount displays its existing notice. |
| hover | Native question choices, buttons, links and local file controls retain task hover affordances. |
| focus-visible | Question and local results controls show focus; step changes focus the heading and invalid team labels focus the field. |
| active | The reader answers, advances/backtracks, edits, forgets, downloads or copies; the consultant loads local keys/files/codes. No timed playback exists. |
| disabled | Download and Copy are natively disabled until respondent encryption succeeds; encryption failure leaves them disabled with a status message. |
| loading | Own task boot, respondent encryption and local results file/key work are distinct task operations; no native showcase-host ready/dispose claim is made. |
| empty | Unanswered/unsure answers remain explicit; results with no added answers show the existing empty notice. |
| error | Incomplete/invalid encryption links are refused; team labels reject contact details; encryption, malformed answer/decryption and boot failures use the task messages. No answers are submitted by this client. |
| current | Checked question choices and written progress identify the respondent position; results identify accepted/rejected responses and role comparisons, not a playback frame. |
| visited | Not applicable: No visited state on this root; any contained native links retain their own browser history. |
| expanded | Not applicable: No disclosure state on this root; replacing a view is not aria-expanded. |
Tokens
| Part | Token |
|---|---|
| app.ground | --cotton |
| panel.background | --surface |
| --survey-margin-top-space-7 | var(--space-7) |
| --survey-gap-space-4 | var(--space-4) |
| --survey-padding-space-4 | var(--space-4) |
| --survey-padding-space-6 | var(--space-6) |
| --survey-background-surface | var(--surface) |
| --survey-border-ink | var(--ink) |
| --survey-padding-space-5 | var(--space-5) |
| --survey-border-rule-hair | var(--rule-hair) |
| --survey-border-radius-radius | var(--radius) |
| --survey-color-ink | var(--ink) |
| --survey-gap-space-5 | var(--space-5) |
| --survey-margin-top-space-9 | var(--space-9) |
| --survey-font-type-small | var(--type-small) |
| --survey-margin-space-5 | var(--space-5) |
| --survey-padding-left-space-7 | var(--space-7) |
| --survey-gap-space-3 | var(--space-3) |
| --survey-font-size-fs-small | var(--fs-small) |
| --survey-gap-space-6 | var(--space-6) |
| --survey-margin-space-6 | var(--space-6) |
| --survey-padding-space-3 | var(--space-3) |
| --survey-border-line | var(--line) |
| --survey-margin-top-space-11 | var(--space-11) |
| --survey-margin-bottom-space-4 | var(--space-4) |
| --survey-margin-bottom-space-7 | var(--space-7) |
| --survey-border-bottom-line | var(--line) |
| --survey-font-size-fs-label | var(--fs-label) |
| --survey-color-ink-2 | var(--ink-2) |
| --survey-padding-space-1 | var(--space-1) |
| --survey-background-teal-soft | var(--teal-soft) |
| --survey-color-teal-ink | var(--teal-ink) |
| --survey-background-saffron-soft | var(--saffron-soft) |
| --survey-color-saffron-ink | var(--saffron-ink) |
| --survey-background-madder-soft | var(--madder-soft) |
| --survey-color-madder-ink | var(--madder-ink) |
| --survey-padding-space-7 | var(--space-7) |
| --survey-font-size-fs-body | var(--fs-body) |
| --survey-margin-space-2 | var(--space-2) |
| --survey-margin-space-4 | var(--space-4) |
Layout
| Aspect | Value |
|---|---|
| breakpoints | Required review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; columns stack under 768 px and controls fill the row on phones. |
| wrapping | Text wraps; code panes scroll inside their own focusable region. |
| textExpansion | Japanese strings come from the i18n tables and wrap; engine output stays English. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | Inside the Showcase frame's padding, controls and caption at its foot. |
| external | Full width of its section. |
| rhythm | One showcase per section, after the section's claim (D-SITE-008). |
Motion
| Aspect | Value |
|---|---|
| None | Reader-controlled task progression and local encryption/results work; no autoplay or intrinsic timed sequence. |
Runtime and reuse
Render-only element; mount any registered child enhancements separately. Preserve required Site CSS, fonts, responsive and locale rules from nativeElement.
Accessibility passport
| Aspect | Value |
|---|---|
| role | Respondent task sections/forms and consultant local-results file controls/tables. |
| name | Its heading or caption |
| keyboard | Native question controls and Next/Back; Download/Copy after encryption; local file/code/key controls in results. |
| focus | Step changes focus the heading; invalid team input is focused. Clipboard fallback focuses/selects the existing response-code field. |
| screenReader | Written progress, encryption/copy statuses, rejected-file reasons and results; no Play/Pause announcements. |
| contrast | Ink on surface 14:1; state dyes only as marks with words. |
| target | Controls are 44 px. |
Content
| Slot | Length | Voice |
|---|---|---|
| question | 1 sentence | Plain, second person |
Good: “Where do you look for a component first?”
Bad: “Rate your synergy”
Japanese: English only: the survey loader reads the existing English question and survey catalogues. Japanese survey/results content and locale selection are not implemented.
Icons and illustrations
None: this element uses no icon or illustration of its own.
Decisions and exceptions
Usage
7 uses across the built pages (measured by npm run site:system).
Tests
| Aspect | Value |
|---|---|
| unit | tests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns |
| visual | Not yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts |
| a11y | tests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark |
| parity | scripts/site/system/check.ts: Library examples are rendered by the same render function the site imports |
Figma
not-yet: The Loom Site Figma library is the last stage of the plan; this element is not mapped yet.