stylegallery 0.1.4 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/DOMAINS.md +11 -9
  2. package/GOVERNANCE.md +8 -2
  3. package/LICENSE +28 -0
  4. package/LICENSE-DOCS +42 -0
  5. package/NOTICE +38 -0
  6. package/README.md +43 -6
  7. package/consumer-reference/agent-native/README.md +7 -7
  8. package/consumer-reference/agent-native/v2/admission-policy.json +241 -1
  9. package/consumer-reference/agent-native/v2/material-registry.json +1 -1
  10. package/consumer-reference/agent-native/v2/schema/admission-policy.schema.json +2 -2
  11. package/design-engineering/component-contract.md +114 -0
  12. package/design-engineering/decision-tree.md +70 -0
  13. package/design-engineering/index.md +60 -2
  14. package/design-engineering/loading-and-feedback.md +91 -0
  15. package/design-engineering/native-interaction-contracts.md +94 -0
  16. package/design-engineering/state-management/decision-tree.md +60 -0
  17. package/design-engineering/state-management/index.md +61 -0
  18. package/design-engineering/state-management/patterns/derived-state.md +85 -0
  19. package/design-engineering/state-management/patterns/draft-and-baseline.md +86 -0
  20. package/design-engineering/state-management/patterns/id-selection.md +85 -0
  21. package/design-engineering/state-management/patterns/identity-reset.md +89 -0
  22. package/design-engineering/state-management/patterns/latest-request-wins.md +94 -0
  23. package/design-engineering/state-management/patterns/optimistic-overlay.md +98 -0
  24. package/design-engineering/state-management/patterns/single-flight.md +92 -0
  25. package/design-engineering/state-management/patterns/single-owner.md +89 -0
  26. package/design-engineering/state-management/patterns/submitted-snapshot.md +107 -0
  27. package/design-engineering/state-management/patterns/unsaved-navigation.md +100 -0
  28. package/design-engineering/state-management/patterns/url-state.md +96 -0
  29. package/design-engineering/state-management/patterns/versioned-restore.md +95 -0
  30. package/design-engineering/state-management/recipes/delete-undo.md +65 -0
  31. package/design-engineering/state-management/recipes/index.md +64 -0
  32. package/design-engineering/state-management/recipes/multi-step-form.md +65 -0
  33. package/design-engineering/state-management/recipes/search-detail.md +65 -0
  34. package/design-engineering/state-management/recipes/settings-save.md +64 -0
  35. package/design-engineering/state-management/state-brief.md +83 -0
  36. package/design-engineering/state-management/verification.md +65 -0
  37. package/design-engineering/text-input-and-internationalization.md +91 -0
  38. package/design-engineering/worked-examples.md +129 -0
  39. package/design-terminology/comparison-workflow.md +98 -0
  40. package/design-terminology/conflict-cases.md +87 -55
  41. package/design-terminology/index.md +19 -5
  42. package/design-terminology/interaction-semantics.md +87 -0
  43. package/design-terminology/relation-types.md +12 -6
  44. package/design-terminology/source-vocabularies.md +33 -3
  45. package/design-terminology/token-semantics.md +90 -0
  46. package/design-terminology/typography-semantics.md +86 -0
  47. package/game-ui/decision-tree.md +81 -0
  48. package/game-ui/index.md +11 -1
  49. package/game-ui/screen-recipes.md +101 -0
  50. package/game-ui/verification-workflow.md +100 -0
  51. package/index.md +8 -0
  52. package/log.md +67 -0
  53. package/motion/accessible-motion.md +90 -0
  54. package/motion/decision-tree.md +70 -0
  55. package/motion/index.md +21 -2
  56. package/motion/interaction-recipes.md +170 -0
  57. package/motion/interruption-and-retargeting.md +90 -0
  58. package/motion/motion-brief.md +125 -0
  59. package/motion/observed-choreography.md +73 -0
  60. package/motion/rendering-and-performance.md +89 -0
  61. package/motion/review-workflow.md +8 -0
  62. package/motion/vocabulary.md +2 -2
  63. package/package.json +74 -8
  64. package/platform-guides/adaptation-workflow.md +76 -0
  65. package/platform-guides/adaptive-navigation.md +85 -0
  66. package/platform-guides/android-interaction.md +74 -0
  67. package/platform-guides/apple-interaction.md +9 -1
  68. package/platform-guides/compatibility-matrix.md +97 -0
  69. package/platform-guides/index.md +19 -2
  70. package/platform-guides/input-and-focus.md +91 -0
  71. package/platform-guides/preferences-and-accessibility.md +90 -0
  72. package/platform-guides/windows-interaction.md +75 -0
  73. package/recipes/homepage.md +8 -0
  74. package/scripts/compiler/README.md +112 -0
  75. package/scripts/compiler/cli.mjs +51 -0
  76. package/scripts/compiler/mcp.mjs +53 -0
  77. package/scripts/compiler/operations.mjs +70 -0
  78. package/scripts/compiler/runtime.mjs +156 -0
  79. package/scripts/sg-entry.mjs +20 -0
  80. package/scripts/sg-server.mjs +20 -0
@@ -0,0 +1,65 @@
1
+ ---
2
+ type: Domain Guide
3
+ title: Multi-Step Form With Retained Draft
4
+ description: Retain entered values across steps and guard progression and final submission.
5
+ domain: design-engineering
6
+ lifecycle: experimental
7
+ provenance_kind: local
8
+ ---
9
+
10
+ # Multi-Step Form With Retained Draft
11
+
12
+ ## Repository Boundary
13
+
14
+ Retain entered values across steps and guard progression and final submission. This is a consumer interaction composition in Design Engineering. Spatial structure comes from [Form Flow](../../../recipes/form-flow.md); this recipe adds no reusable Layout behavior.
15
+
16
+ ## Reusable Method
17
+
18
+ ### Selected Pattern Stack
19
+
20
+ [single owner](../patterns/single-owner.md), [draft/baseline](../patterns/draft-and-baseline.md), [submitted snapshot](../patterns/submitted-snapshot.md), [unsaved navigation](../patterns/unsaved-navigation.md).
21
+
22
+ ### Ownership And Event Flow
23
+
24
+ The flow owns all field values and current step; each field emits intents. Validity is derived from relevant fields. The final operation owns the submitted snapshot. Unmounting a step does not destroy the flow draft.
25
+
26
+ Edit → validate current step → advance if allowed. Back preserves values. Changing an earlier answer recomputes eligibility and invalidates dependent values under an explicit policy. Final Submit captures the whole valid draft once.
27
+
28
+ ### Composition And Substitution
29
+
30
+ An in-memory step is enough when deep links are not a requirement; use URL state when they are. Versioned restore is optional for long flows and requires retention/privacy decisions. Do not persist request-pending flags.
31
+
32
+ ### Acceptance Sequences
33
+
34
+ | Sequence | Expected outcome |
35
+ | --- | --- |
36
+ | Advance, go Back, revisit | Values persist; errors follow current validity |
37
+ | Change an earlier branching answer | Hidden dependent answers are cleared or excluded under declared policy |
38
+ | Deep-link to a later step | Guard prerequisites or redirect without silently submitting |
39
+ | Fail final submission | Retain all fields and provide a route to the relevant error |
40
+ | Edit while final save completes | Preserve later edits using snapshot semantics |
41
+
42
+ ## Opinionated Guidance
43
+
44
+ Keep the ownership boundaries visible when composing the patterns. One screen can combine these mechanisms without making every value global. Record the rejected alternative and its user-visible cost in the [state brief](../state-brief.md).
45
+
46
+ ## Platform-Specific Guidance
47
+
48
+ Announce step context and move focus to the step heading or first invalid field as appropriate. Step order, DOM order, and validation routes must agree.
49
+
50
+ ## Unsupported Absolutes
51
+
52
+ These acceptance sequences are proposed integration checks, not captured product evidence. Pattern model tests do not prove this entire screen, its backend, or its focus behavior.
53
+
54
+ ## Verification Contract
55
+
56
+ Adapt every acceptance row to the consumer and record actual results with the [verification matrix](../verification.md). Include the ordinary successful task and at least one interrupted task. The initial handoff is `consumer_reference: not_applicable` because this fictional recipe selects no consumer profile or conformance record.
57
+
58
+ ## Source, License, And Attribution
59
+
60
+ Locally authored synthesis and examples. No upstream implementation is copied. These experimental contracts describe consumer-owned behavior; review when a failure, ownership change, or platform change invalidates an assumption.
61
+
62
+ ## IA Navigation
63
+
64
+ Parent: [State Management](index.md).
65
+ Next: [Continue the state management route](../verification.md).
@@ -0,0 +1,65 @@
1
+ ---
2
+ type: Domain Guide
3
+ title: Search Filters And Detail Selection
4
+ description: Preserve query context and entity identity across asynchronous search and history navigation.
5
+ domain: design-engineering
6
+ lifecycle: experimental
7
+ provenance_kind: local
8
+ ---
9
+
10
+ # Search Filters And Detail Selection
11
+
12
+ ## Repository Boundary
13
+
14
+ Preserve query context and entity identity across asynchronous search and history navigation. This is a consumer interaction composition in Design Engineering. Spatial structure comes from [List Detail](../../../recipes/list-detail.md); this recipe adds no reusable Layout behavior.
15
+
16
+ ## Reusable Method
17
+
18
+ ### Selected Pattern Stack
19
+
20
+ [URL state](../patterns/url-state.md), [latest request wins](../patterns/latest-request-wins.md), [ID selection](../patterns/id-selection.md), [derived state](../patterns/derived-state.md).
21
+
22
+ ### Ownership And Event Flow
23
+
24
+ The field owns its typing buffer; the route owns committed query/filter/page; the request owner holds results and query identity; the screen or route owns selected ID. A result collection is not necessarily the full entity inventory.
25
+
26
+ Commit query → reset page → update history → start read → accept only matching outcome. Back reads the route and starts the corresponding read without pushing another entry. Selected detail may be fetched separately with its own keyed request owner.
27
+
28
+ ### Composition And Substitution
29
+
30
+ URL state can be replaced by screen-local committed state when sharing/history is explicitly unnecessary. Stable identity and stale-read handling remain essential. Debounce may reduce traffic but cannot substitute for request correlation.
31
+
32
+ ### Acceptance Sequences
33
+
34
+ | Sequence | Expected outcome |
35
+ | --- | --- |
36
+ | Request A/B, resolve B/A | B results and status remain displayed |
37
+ | Change query on page 3 | Commit new query with page 1 |
38
+ | Back then Forward | Controls, query identity, and results follow route history |
39
+ | Selected item absent from filtered page | Retain or explicitly mark unavailable; do not infer deletion |
40
+ | Delete selected entity authoritatively | Apply missing-detail policy and recover focus |
41
+
42
+ ## Opinionated Guidance
43
+
44
+ Keep the ownership boundaries visible when composing the patterns. One screen can combine these mechanisms without making every value global. Record the rejected alternative and its user-visible cost in the [state brief](../state-brief.md).
45
+
46
+ ## Platform-Specific Guidance
47
+
48
+ Preserve typed input during IME composition. Label previous results during refresh; an empty accepted result must differ from loading or failure.
49
+
50
+ ## Unsupported Absolutes
51
+
52
+ These acceptance sequences are proposed integration checks, not captured product evidence. Pattern model tests do not prove this entire screen, its backend, or its focus behavior.
53
+
54
+ ## Verification Contract
55
+
56
+ Adapt every acceptance row to the consumer and record actual results with the [verification matrix](../verification.md). Include the ordinary successful task and at least one interrupted task. The initial handoff is `consumer_reference: not_applicable` because this fictional recipe selects no consumer profile or conformance record.
57
+
58
+ ## Source, License, And Attribution
59
+
60
+ Locally authored synthesis and examples. No upstream implementation is copied. These experimental contracts describe consumer-owned behavior; review when a failure, ownership change, or platform change invalidates an assumption.
61
+
62
+ ## IA Navigation
63
+
64
+ Parent: [State Management](index.md).
65
+ Next: [Continue the state management route](../verification.md).
@@ -0,0 +1,64 @@
1
+ ---
2
+ type: Domain Guide
3
+ title: Settings With Explicit Save
4
+ description: Edit and save preferences without losing later input or leaving with unsaved work.
5
+ domain: design-engineering
6
+ lifecycle: experimental
7
+ provenance_kind: local
8
+ ---
9
+
10
+ # Settings With Explicit Save
11
+
12
+ ## Repository Boundary
13
+
14
+ Edit and save preferences without losing later input or leaving with unsaved work. This is a consumer interaction composition in Design Engineering. Spatial structure comes from [SaaS Settings](../../../recipes/saas-settings.md); this recipe adds no reusable Layout behavior.
15
+
16
+ ## Reusable Method
17
+
18
+ ### Selected Pattern Stack
19
+
20
+ [draft/baseline](../patterns/draft-and-baseline.md), [submitted snapshot](../patterns/submitted-snapshot.md), [single flight](../patterns/single-flight.md), [unsaved navigation](../patterns/unsaved-navigation.md).
21
+
22
+ ### Ownership And Event Flow
23
+
24
+ The form owns draft; the server owns persisted data; the save attempt owns the snapshot; the router owns pending departure. Dirty is derived. Account changes invalidate the entire form generation.
25
+
26
+ Edit → validate → capture snapshot → save → reconcile acknowledgement → re-evaluate dirty. For Save-and-leave, leave only after successful reconciliation and only if no newer edits remain.
27
+
28
+ ### Composition And Substitution
29
+
30
+ Explicit-save semantics require the snapshot and draft separation. A single-flight guard can share or ignore repeats; queuing requires a separately defined sequence of snapshots. Immediate autosave is a different recipe with debounce, ordering, and conflict rules.
31
+
32
+ ### Acceptance Sequences
33
+
34
+ | Sequence | Expected outcome |
35
+ | --- | --- |
36
+ | Submit A, edit B, acknowledge A | Baseline A; draft B remains dirty; stay if leaving was requested |
37
+ | Save fails, then retry | Preserve draft and release the operation guard |
38
+ | Remote revision conflict | Preserve draft; offer reload/merge under consumer policy |
39
+ | Cancel departure | Keep draft and return focus to the invoker |
40
+
41
+ ## Opinionated Guidance
42
+
43
+ Keep the ownership boundaries visible when composing the patterns. One screen can combine these mechanisms without making every value global. Record the rejected alternative and its user-visible cost in the [state brief](../state-brief.md).
44
+
45
+ ## Platform-Specific Guidance
46
+
47
+ The form must connect errors to fields and announce completion without implying newer edits were saved. A disabled submit control is not the duplicate guard.
48
+
49
+ ## Unsupported Absolutes
50
+
51
+ These acceptance sequences are proposed integration checks, not captured product evidence. Pattern model tests do not prove this entire screen, its backend, or its focus behavior.
52
+
53
+ ## Verification Contract
54
+
55
+ Adapt every acceptance row to the consumer and record actual results with the [verification matrix](../verification.md). Include the ordinary successful task and at least one interrupted task. The initial handoff is `consumer_reference: not_applicable` because this fictional recipe selects no consumer profile or conformance record.
56
+
57
+ ## Source, License, And Attribution
58
+
59
+ Locally authored synthesis and examples. No upstream implementation is copied. These experimental contracts describe consumer-owned behavior; review when a failure, ownership change, or platform change invalidates an assumption.
60
+
61
+ ## IA Navigation
62
+
63
+ Parent: [State Management](index.md).
64
+ Next: [Continue the state management route](../verification.md).
@@ -0,0 +1,83 @@
1
+ ---
2
+ type: Domain Guide
3
+ title: State Management Brief
4
+ description: Record authority, transitions, effects, lifetime, and acceptance cases before implementation.
5
+ domain: design-engineering
6
+ lifecycle: experimental
7
+ provenance_kind: local
8
+ ---
9
+
10
+ # State Management Brief
11
+
12
+ ## Repository Boundary
13
+
14
+ This is a consumer planning template within Design Engineering. It supplements the [Component Contract](../component-contract.md); it is not a profile schema or evidence record.
15
+
16
+ ## Reusable Method
17
+
18
+ For each independently owned value, complete one inventory row. Avoid a single status enum that conflates validation, request progress, persisted revision, and selection.
19
+
20
+ | Field | Required answer |
21
+ | --- | --- |
22
+ | User task | Action and observable result |
23
+ | Authoritative source | Server, route, form, component, or session owner |
24
+ | State shape | Valid values, initial value, identity and revision |
25
+ | Derived values | Inputs, equality, and cache invalidation if any |
26
+ | Writes | Accepted intents, payloads, rejection and normalization |
27
+ | Transitions | Event + guard → next state + effect |
28
+ | Lifetime | Creation, identity switch, navigation, disposal and cleanup |
29
+ | Async policy | Request identity, duplicates, stale results, uncertainty |
30
+ | Persistence | Stored fields, scope, version, expiry, restoration conflicts |
31
+ | Recovery | Retry, discard, reconciliation and focus destination |
32
+ | Composition | Selected patterns and any rejected alternatives |
33
+ | Evidence | Failure trace, expected result, runtime, actual result |
34
+
35
+ ### Worked Brief: Editing A Display Name
36
+
37
+ | Value | Owner | Lifetime | Write rule |
38
+ | --- | --- | --- | --- |
39
+ | Acknowledged name and revision | Server; cache holds observation | Account session | Matching authoritative response |
40
+ | Draft name | Settings form | Until discard, accepted save, or guarded departure | User edit |
41
+ | Dirty | Derived | Same as form | Compare draft to acknowledged baseline |
42
+ | Submitted name and request ID | Save operation | One attempt | Capture before starting effect |
43
+ | Pending destination | Router guard | Confirmation decision | Latest attempted destination |
44
+
45
+ Invariant: acknowledging A never marks later draft B saved. Failure trace: edit A → submit → edit B → acknowledge A. Expected result: A is the baseline; B remains visible and dirty. Rejected alternative: binding fields directly to the cache loses a reliable Cancel target.
46
+
47
+ ### Implementation Handoff
48
+
49
+ ```yaml
50
+ domain: design-engineering
51
+ state_patterns: [draft-and-baseline, submitted-snapshot, unsaved-navigation]
52
+ state_owner: settings form and save operation
53
+ persistence_owner: consumer backend
54
+ consumer_reference: not_applicable
55
+ consumer_reference_reason: This blank planning example selects no consumer profile or conformance record.
56
+ observed_results: not_run
57
+ remaining_evidence: consumer runtime, request traces, keyboard and focus recovery
58
+ ```
59
+
60
+ ## Opinionated Guidance
61
+
62
+ An unresolved owner is an implementation question, not a reason to introduce more booleans. Write product choices such as discard policy explicitly; do not hide them inside effects.
63
+
64
+ ## Platform-Specific Guidance
65
+
66
+ Include router, cache, framework, and persistence adapter versions only in the consumer handoff where they affect behavior. Check IME input and native form submission for editable fields.
67
+
68
+ ## Unsupported Absolutes
69
+
70
+ Completing this template does not establish executed evidence or backend persistence. A request token alone cannot resolve concurrent server edits.
71
+
72
+ ## Verification Contract
73
+
74
+ A second reader should identify every write owner and execute the failure trace without inventing policy. Record normal, failed, interrupted, and identity-changing cases before implementation.
75
+
76
+ ## Source, License, And Attribution
77
+
78
+ Locally authored synthesis and examples. No upstream implementation is copied. These experimental contracts describe consumer-owned behavior; review when a failure, ownership change, or platform change invalidates an assumption.
79
+
80
+ ## IA Navigation
81
+
82
+ Parent: [State Management](index.md).
83
+ Next: [Continue the state management route](verification.md).
@@ -0,0 +1,65 @@
1
+ ---
2
+ type: Domain Guide
3
+ title: State Management Verification Matrix
4
+ description: Test event ordering, failure recovery, navigation, and identity boundaries separately from UI presentation.
5
+ domain: design-engineering
6
+ lifecycle: experimental
7
+ provenance_kind: local
8
+ ---
9
+
10
+ # State Management Verification Matrix
11
+
12
+ ## Repository Boundary
13
+
14
+ This matrix verifies consumer behavior under Design Engineering. Shared [quality gates](../../quality/index.md) own evidence admissibility. Passing a local model does not promote a domain or certify a consumer.
15
+
16
+ ## Reusable Method
17
+
18
+ Start with the selected pattern's invariant. Use controlled promises or an injected transport to choose completion order. Assert both displayed state and effect count or persistence payload; a screenshot alone cannot show which snapshot was saved.
19
+
20
+ | Dimension | Required stress when applicable | Observable |
21
+ | --- | --- | --- |
22
+ | Ordering | Start A/B; resolve B/A; stale error after new success | Current result, status, and error remain correlated |
23
+ | Mutation | Edit during save; normalized result; version conflict | Draft, baseline, submitted payload, revision |
24
+ | Duplication | Keyboard + pointer + another caller | Declared count and outcome sharing |
25
+ | Failure | Definitive rejection versus unknown write outcome | Draft retained; reconciliation before unsafe retry |
26
+ | Lifetime | Dispose; A → B → A; logout | No old-generation updates or scope leakage |
27
+ | Navigation | Back, Forward, reload, deep link, canceled departure | URL, visible controls, draft, and selection agree |
28
+ | Persistence | Corrupt version, wrong scope, unavailable storage, delayed restore | Valid defaults and preserved newer edits |
29
+ | Accessibility | Pending, error, empty, removed invoker | Announcements and logical focus recovery |
30
+ | Composition | Filter while deleting; edit during save-and-leave | Combined invariants survive interleaving |
31
+
32
+ ### Executable Local Coverage
33
+
34
+ From a repository checkout, `npm run test:state-management` extracts and executes the standalone `js` block from each of the 12 pattern pages in an isolated Node process. The examples assert model outcomes for ownership, projections, selection, drafts, save snapshots, navigation decisions, stale completions, duplicate effects, optimistic recovery, URL parsing, identity generations, and restore validation.
35
+
36
+ The four recipes declare integration acceptance sequences; they are not runnable browser fixtures. Existing [Interaction Lab](../../examples/domain-interactions/README.md) is a separate prototype with its own evidence scope. New recipe acceptance remains unexecuted until adapted to a consumer.
37
+
38
+ ### Evidence Record
39
+
40
+ Record source revision, runtime, selected pattern/recipe, initial state, event sequence, submitted payload/effect count, expected state, actual state, and remaining limitations. Label unrun cases `not_run`; separate a model assertion from a browser observation and a server acknowledgement.
41
+
42
+ ## Opinionated Guidance
43
+
44
+ Use deterministic event ordering instead of sleeps. Test the stale failure path as well as stale success, and inspect cleanup/finally paths that can accidentally clear a newer pending operation.
45
+
46
+ ## Platform-Specific Guidance
47
+
48
+ Run browser navigation, focus, assistive-technology announcements, and storage failure checks in the actual target environment. Node URL and reducer examples cannot certify those integrations.
49
+
50
+ ## Unsupported Absolutes
51
+
52
+ A green model suite does not prove race freedom under every interleaving, real persistence, or accessibility. Synthetic transports do not establish server idempotency.
53
+
54
+ ## Verification Contract
55
+
56
+ For every consumer claim, identify a matching executed case or explicitly list missing evidence. Revisit the matrix when a real failure is not representable by its dimensions.
57
+
58
+ ## Source, License, And Attribution
59
+
60
+ Locally authored synthesis and examples. No upstream implementation is copied. These experimental contracts describe consumer-owned behavior; review when a failure, ownership change, or platform change invalidates an assumption.
61
+
62
+ ## IA Navigation
63
+
64
+ Parent: [State Management](index.md).
65
+ Next: [Continue the state management route](recipes/index.md).
@@ -0,0 +1,91 @@
1
+ ---
2
+ type: Domain Guide
3
+ title: Text Input And Internationalization
4
+ description: Design composition-aware editing, explicit text units, bidirectional content, and locale-bound presentation without corrupting user input.
5
+ domain: design-engineering
6
+ lifecycle: experimental
7
+ provenance_kind: local
8
+ reviewed_on: 2026-09-21
9
+ ---
10
+
11
+ # Text Input And Internationalization
12
+
13
+ Primary role: multilingual text interaction and verification guide.
14
+
15
+ ## Repository Boundary
16
+
17
+ This guide owns text editing and product-data decisions. Layout owns spatial constraints; a translation or input method does not authorize copying product typography into reusable Layout CSS. Browser text measurement is not proof that an editor preserves user intent.
18
+
19
+ ## Reusable Method
20
+
21
+ Declare three contracts before implementing formatting: what the user can edit, what the application stores, and what it displays. Name the unit of any limit or selection offset. Then inventory composition, paste, autofill, correction, undo, direction, and locale changes. An event sequence from one Latin keyboard is a narrow sample.
22
+
23
+ ### Source Findings
24
+
25
+ | Source | Bounded finding | Design consequence |
26
+ | --- | --- | --- |
27
+ | [UI Events](https://www.w3.org/TR/uievents/#events-compositionevents) | Composition has its own event lifecycle; `isComposing` identifies events within a composition session. | Do not treat every intermediate edit as a committed command. |
28
+ | [Input Events Level 2](https://www.w3.org/TR/input-events-2/) | Input types describe edit intentions. The draft distinguishes cancelability during IME composition. | Inspect actual events; a universal keydown filter cannot govern every edit path. |
29
+ | [Unicode Text Segmentation, UAX #29](https://www.unicode.org/reports/tr29/) | Grapheme clusters approximate user-perceived characters; boundaries are distinct from code points and words. | State whether a limit counts bytes, code units, code points, or grapheme clusters. |
30
+ | [ECMA-402 Segmenter](https://tc39.es/ecma402/#segmenter-objects) | `Intl.Segmenter` exposes locale-sensitive segmentation at named granularities. | Name locale and granularity when using segmentation in a UI. |
31
+ | [W3C bidirectional markup guidance](https://www.w3.org/International/questions/qa-html-dir) | HTML direction metadata and isolation help mixed-direction content retain its intended ordering. | Treat document direction and inserted user text separately. |
32
+ | [Accessible Authentication explanation](https://www.w3.org/WAI/WCAG22/Understanding/accessible-authentication-minimum.html) | WCAG 2.2's AA criterion limits required cognitive-function tests, with specified alternatives and assistance. | Do not casually remove paste or password-manager assistance from an authentication flow. |
33
+
34
+ Sources were inspected 2026-09-21. UI/Input Events and ECMA-402 publication states must be read as labeled; a draft API description is not a claim that every target implements it identically. UAX #29 has versioned rules, so record the Unicode/runtime boundary for a reproducible segmentation claim.
35
+
36
+ ### Worked Scenario: Korean Search With Suggestions
37
+
38
+ The user enters a Korean name, navigates candidates, commits composition, and then submits a search. Product state distinguishes the editable text, composition status, selected suggestion identity, and submitted query.
39
+
40
+ Local policy: preserve the browser's in-progress composition. Do not move focus, replace the input node, run destructive formatting, or submit the form merely because a command key arrived during composition. Commit-driven search is a product choice; live preview during composition needs a separate decision and stale-result policy.
41
+
42
+ | Event or condition | Proposed responsibility | Failure it prevents |
43
+ | --- | --- | --- |
44
+ | Composition starts | Keep the editing node and draft stable. | Rerendering discards the input method's active composition. |
45
+ | Intermediate input | Retain the edit without treating a candidate as the submitted query. | A provisional syllable becomes an unintended request or selection. |
46
+ | Candidate confirmation | Let the input method complete its edit before interpreting a separate application command. | Enter both confirms composition and submits unexpectedly. |
47
+ | Suggestions return out of order | Match them to current query intent. | An old response replaces suggestions for the current text. |
48
+ | User presses Escape | Resolve input-method, popup, and outer-surface ownership deliberately. | One key cancels composition, closes the popup, and closes the editor. |
49
+
50
+ The exact native event order is a target observation, not prescribed here. Test the real IME in each supported browser/OS; synthetic composition events do not recreate the operating system's input method. Use [latest request wins](state-management/patterns/latest-request-wins.md) for replaceable reads.
51
+
52
+ ### Text Units And Limits
53
+
54
+ For a visible “characters remaining” count, decide what users should perceive as one unit, then compare that policy with the backend limit. A grapheme count cannot guarantee that a byte-limited service accepts the value. Show the relevant limit rather than truncating silently after submission.
55
+
56
+ Use a corpus containing Hangul composition, a base letter plus combining mark, emoji sequences, an empty value, pasted line breaks, and a long unbroken identifier. Verify counters, truncation, deletion, selection restoration, and round trips. A correct count with corrupted cursor placement is still an editing failure.
57
+
58
+ Formatting belongs at a declared boundary. If a field needs grouping separators, preserve an editable representation and caret policy. A localized display string is not automatically a canonical stored number or date. Decide how incomplete input, ambiguous separators, and locale changes are resolved before adding automatic reformatting.
59
+
60
+ ### Direction And Mixed Content
61
+
62
+ Set the document's language and base direction intentionally. Isolate inserted names, identifiers, and other independently directed text where needed; test punctuation and adjacent controls as well as the text itself. CSS alignment alone cannot establish the semantic direction of user data.
63
+
64
+ Product tests should include an RTL name beside an LTR identifier, paired punctuation, numerals, and a trailing action. Preserve logical reading order while the Layout owner chooses logical spacing and containment.
65
+
66
+ ## Opinionated Guidance
67
+
68
+ Preserve raw editing intent until a clear commit boundary. Prefer a reversible validation message over eager rewriting that the user cannot undo. Store stable identity separately from the localized label of a suggestion.
69
+
70
+ ## Platform-Specific Guidance
71
+
72
+ Keyboard layouts, IMEs, dictation, autofill, and virtual keyboards can take different event paths. Record OS, browser, input method, locale, and assistive technology instead of a generic “mobile tested.” For typography and scaling, use [Preferences And Accessibility](../platform-guides/preferences-and-accessibility.md).
73
+
74
+ ## Unsupported Absolutes
75
+
76
+ One code point is not necessarily one perceived character. A keypress is not the only way to edit text. A segmentation API is not a locale-aware parser. Programmatically dispatched events are not evidence that a native IME works.
77
+
78
+ ## Verification Contract
79
+
80
+ The proposed cases cover real composition, candidate selection, paste, undo/redo, replacement selection, autofill, server rejection, mixed direction, and locale change with an unfinished draft. Bind observed input and submitted data to the same scenario; independently inspect the accepted backend value where that claim matters.
81
+
82
+ Record both intended and observed event/selection outcomes, without storing private user input in diagnostic artifacts. The examples above are test data proposals; no IME, browser, or backend execution is claimed. Re-review after editor, formatter, runtime, or locale-policy changes.
83
+
84
+ ## Source, License, And Attribution
85
+
86
+ Locally authored synthesis of the linked primary sources, inspected 2026-09-21. No upstream examples are reproduced. `consumer_reference: not_applicable` because no consumer editor record is selected.
87
+
88
+ ## IA Navigation
89
+
90
+ Parent: [Design Engineering](index.md).
91
+ Next: [Loading And Feedback](loading-and-feedback.md).
@@ -0,0 +1,129 @@
1
+ ---
2
+ type: Domain Guide
3
+ title: Design Engineering Worked Examples
4
+ description: Apply component contracts to settings, asynchronous search, and destructive list actions with explicit recovery cases.
5
+ domain: design-engineering
6
+ lifecycle: experimental
7
+ provenance_kind: local
8
+ ---
9
+
10
+ # Design Engineering Worked Examples
11
+
12
+ Primary role: product interaction recipe collection.
13
+
14
+ ## Repository Boundary
15
+
16
+ These fictional examples connect decisions to expected behavior. They are neither shipped components nor captured product evidence. Values and presentation belong to the consumer; the referenced Layout recipes retain their spatial boundaries.
17
+
18
+ The separate [Interaction Lab](../examples/domain-interactions/README.md) implements the save and search contracts as a local web prototype. Its [browser observations](../examples/domain-interactions/verification.md) apply to that exact example and source snapshot; they do not prove a consumer backend or the destructive-action recipe below.
19
+
20
+ ## Reusable Method
21
+
22
+ Choose a matching user task, adapt its state ownership through the [Component Contract](component-contract.md), and execute the listed failure cases in the consuming application. The decision is incomplete until expected and actual results are recorded separately.
23
+
24
+ The [State Management recipes](state-management/recipes/index.md) expand these tasks into explicit pattern stacks and substitution rules, including a multi-step form. These existing scenarios remain at their original anchors.
25
+
26
+ ## Settings With Explicit Save
27
+
28
+ Task: edit preferences, inspect changes, and save intentionally. Compose the [SaaS Settings recipe](../recipes/saas-settings.md); let its selected patterns own page structure and scrolling. The form owns the editable draft, the operation owns the submitted snapshot, and persistence determines success.
29
+
30
+ Keep field errors beside their inputs and provide a route to the first relevant error. On network failure, retain all entered values. A successful save of an older snapshot must leave subsequent edits dirty. If leaving the screen can lose changes, define discard/cancel/save behavior and what happens if saving fails.
31
+
32
+ | Test | Expected behavior |
33
+ | --- | --- |
34
+ | Submit missing required input | Expose the error and retain other values |
35
+ | Submit, edit again, then receive success | Confirm the submitted snapshot; preserve later edits |
36
+ | Fail and retry | Keep the draft; issue the retry under the declared request policy |
37
+ | Cancel navigation with dirty data | Stay on the form with the same draft and a usable focus target |
38
+
39
+ Evidence still needed: keyboard/error announcement, persistence responses, and source-bound runtime capture. A prototype cannot prove real data was saved.
40
+
41
+ ## Search With Detail Selection
42
+
43
+ Task: search a collection and inspect an item without losing the search context. Compose [List Detail](../recipes/list-detail.md). Separate query text, submitted query, active request, results, and selected item identity. Displayed detail must name the selected item even when the result set refreshes.
44
+
45
+ Keep typing responsive; a request for an older query cannot replace a newer result. Distinguish “no results” from loading and failure. On a tight surface, preserve selection and query when navigating between list and detail. If the selected item disappears, choose a documented empty detail or next-item policy instead of silently showing stale data.
46
+
47
+ | Test | Expected behavior |
48
+ | --- | --- |
49
+ | Submit A, then B; resolve B before A | Results remain for B after A arrives |
50
+ | Receive zero results | Show the submitted query and a recovery action |
51
+ | Resize with detail selected | Preserve selection and query; keep focus on a logical available target |
52
+ | Remove the selected item remotely | Explain its unavailability or choose the documented next target |
53
+
54
+ Evidence still needed: out-of-order response trace, selection identity, tight/wide rendered states, and input coverage. Motion is optional; use [Reorder and Filter](../motion/interaction-recipes.md#reorder-and-filter) only when it communicates stable identity.
55
+
56
+ ## Destructive Action In A List
57
+
58
+ Task: remove a selected item with understandable consequences. Separate the initiating control, decision surface, pending operation, and final list update. Choose confirmation or undo from actual reversibility and product requirements. Do not offer undo when the backend cannot restore the item.
59
+
60
+ Name the affected item and scope. During pending deletion, prevent unintended duplicate operations according to the contract. Failure preserves the item and a recovery path. On success, return focus to an appropriate neighboring item or list heading if the invoker was removed. A dialog's visual exit must not leave a blocker behind.
61
+
62
+ | Test | Expected behavior |
63
+ | --- | --- |
64
+ | Cancel confirmation | No deletion; return to the invoker |
65
+ | Fail the operation | Explain failure and preserve the item |
66
+ | Succeed while filters change | Remove by stable identity, not old row position |
67
+ | Remove the final item | Present an empty state and a logical focus destination |
68
+
69
+ Evidence still needed: actual operation result, focus trace, dialog semantics, and recovery behavior. Use [Modal Transition](../motion/interaction-recipes.md#modal-transition) only for optional presentation.
70
+
71
+ ## Implementation Handoff
72
+
73
+ ```yaml
74
+ example: # settings-save, search-detail, or destructive-list-action
75
+ consumer_reference: not_applicable
76
+ consumer_reference_reason: These fictional examples select no consumer-owned profile or evidence record.
77
+ layout_source: # the selected recipe and the consumer's pinned revision
78
+ state_owner: # component, screen, and persistence responsibilities
79
+ acceptance_cases: # adapted rows above
80
+ observed_results: not_run
81
+ remaining_evidence: # actual runtime, input, device, and user evidence
82
+ ```
83
+
84
+ ## Product Story And Media Handoff
85
+
86
+ Start with an observation sheet for a product homepage: section job, reading order, scene boundaries, changing objects, media crop, and source-confidence level. Record an unknown rendering mechanism as unknown; cinematic appearance alone does not establish video, Canvas, WebGL, or a library.
87
+
88
+ | Decision | Product-owned record | Verification |
89
+ | --- | --- | --- |
90
+ | Typography and rhythm | Heading measure, copy length, spacing, contrast and image ratio | Real copy, text growth, narrow windows |
91
+ | Scene composition | Subject identity, crop and focal point, transparent layers, background transitions | First/middle/last and transition frames |
92
+ | Media export | Dimensions, frame order, codec/format, alpha, poster, source/license | Decode readiness and failed asset |
93
+ | Runtime budget | Download bytes, decoded-memory estimate, cache and concurrency limits | Slow requests, repeated reversal, idle work |
94
+ | Static equivalent | Every essential message in semantic HTML, explicit reading mode | No script, reduced motion, keyboard access |
95
+
96
+ Use the [Motion scene contract](../motion/interaction-recipes.md#scene-composition-contract) and compare the [Flow and headphones examples](../examples/scroll-story/README.md). Their shared controller demonstrates content substitution; both are related local examples and establish no independent adopter evidence. Their different typography, colors, and assets remain product choices.
97
+
98
+ Complete one representative scene before producing an entire video or image sequence. Review its composition and transition framing, then export at the target dimensions. A polished poster does not validate the intervening frames. This section is locally authored practice guidance, not adapted external visual expression.
99
+
100
+ ### Persistent Subject And Page Navigation
101
+
102
+ The Flow story keeps one device shell mounted while its screen content and pose change with progress. The [Scene Navigation example](../examples/scene-navigation/README.md) carries that same identity principle into a page whose chapter selection changes while document position stays fixed. Background, text, device pose, and screen layers share one state owner. These are local product treatments, not profile values or reusable Layout CSS.
103
+
104
+ For this page type, add an input map and URL/history contract to the visual handoff. Specify which surface owns wheel/swipe, which copy regions retain native scrolling, how a focused outgoing action is recovered, and how the user reaches ordinary reading. Review intermediate frames as well as the endpoints; semantic availability must not depend on a visual completion callback.
105
+
106
+ ## Opinionated Guidance
107
+
108
+ Preserve the user's work across recoverable failures. Status text should explain the real operation; motion and color alone are insufficient descriptions of what happened.
109
+
110
+ ## Platform-Specific Guidance
111
+
112
+ Native navigation, browser history, component libraries, and platform controls differ. Record the exact implementation of cancellation and focus return rather than copying a screenshot's apparent behavior.
113
+
114
+ ## Unsupported Absolutes
115
+
116
+ Confirmation is not always safer than undo. Optimistic updates are not always appropriate. A worked example does not certify a consumer migration or establish universal usability.
117
+
118
+ ## Verification Contract
119
+
120
+ Execute all adapted acceptance rows plus long text, empty content, relevant constraints and preferences, and every claimed input method. For a migration use the larger [Migration Readiness](consumer-migration-readiness.md) contract. Review these examples when an observed failure lacks an owner or recovery action.
121
+
122
+ ## Source, License, And Attribution
123
+
124
+ Locally authored scenarios and expected-result tables. Repository links provide spatial and evidence contracts, not proof that these scenarios have run.
125
+
126
+ ## IA Navigation
127
+
128
+ Parent: [Design Engineering](index.md).
129
+ Next: [Interface Craft Decisions](interface-craft.md).