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.
- package/DOMAINS.md +11 -9
- package/GOVERNANCE.md +8 -2
- package/LICENSE +28 -0
- package/LICENSE-DOCS +42 -0
- package/NOTICE +38 -0
- package/README.md +43 -6
- package/consumer-reference/agent-native/README.md +7 -7
- package/consumer-reference/agent-native/v2/admission-policy.json +241 -1
- package/consumer-reference/agent-native/v2/material-registry.json +1 -1
- package/consumer-reference/agent-native/v2/schema/admission-policy.schema.json +2 -2
- package/design-engineering/component-contract.md +114 -0
- package/design-engineering/decision-tree.md +70 -0
- package/design-engineering/index.md +60 -2
- package/design-engineering/loading-and-feedback.md +91 -0
- package/design-engineering/native-interaction-contracts.md +94 -0
- package/design-engineering/state-management/decision-tree.md +60 -0
- package/design-engineering/state-management/index.md +61 -0
- package/design-engineering/state-management/patterns/derived-state.md +85 -0
- package/design-engineering/state-management/patterns/draft-and-baseline.md +86 -0
- package/design-engineering/state-management/patterns/id-selection.md +85 -0
- package/design-engineering/state-management/patterns/identity-reset.md +89 -0
- package/design-engineering/state-management/patterns/latest-request-wins.md +94 -0
- package/design-engineering/state-management/patterns/optimistic-overlay.md +98 -0
- package/design-engineering/state-management/patterns/single-flight.md +92 -0
- package/design-engineering/state-management/patterns/single-owner.md +89 -0
- package/design-engineering/state-management/patterns/submitted-snapshot.md +107 -0
- package/design-engineering/state-management/patterns/unsaved-navigation.md +100 -0
- package/design-engineering/state-management/patterns/url-state.md +96 -0
- package/design-engineering/state-management/patterns/versioned-restore.md +95 -0
- package/design-engineering/state-management/recipes/delete-undo.md +65 -0
- package/design-engineering/state-management/recipes/index.md +64 -0
- package/design-engineering/state-management/recipes/multi-step-form.md +65 -0
- package/design-engineering/state-management/recipes/search-detail.md +65 -0
- package/design-engineering/state-management/recipes/settings-save.md +64 -0
- package/design-engineering/state-management/state-brief.md +83 -0
- package/design-engineering/state-management/verification.md +65 -0
- package/design-engineering/text-input-and-internationalization.md +91 -0
- package/design-engineering/worked-examples.md +129 -0
- package/design-terminology/comparison-workflow.md +98 -0
- package/design-terminology/conflict-cases.md +87 -55
- package/design-terminology/index.md +19 -5
- package/design-terminology/interaction-semantics.md +87 -0
- package/design-terminology/relation-types.md +12 -6
- package/design-terminology/source-vocabularies.md +33 -3
- package/design-terminology/token-semantics.md +90 -0
- package/design-terminology/typography-semantics.md +86 -0
- package/game-ui/decision-tree.md +81 -0
- package/game-ui/index.md +11 -1
- package/game-ui/screen-recipes.md +101 -0
- package/game-ui/verification-workflow.md +100 -0
- package/index.md +8 -0
- package/log.md +67 -0
- package/motion/accessible-motion.md +90 -0
- package/motion/decision-tree.md +70 -0
- package/motion/index.md +21 -2
- package/motion/interaction-recipes.md +170 -0
- package/motion/interruption-and-retargeting.md +90 -0
- package/motion/motion-brief.md +125 -0
- package/motion/observed-choreography.md +73 -0
- package/motion/rendering-and-performance.md +89 -0
- package/motion/review-workflow.md +8 -0
- package/motion/vocabulary.md +2 -2
- package/package.json +74 -8
- package/platform-guides/adaptation-workflow.md +76 -0
- package/platform-guides/adaptive-navigation.md +85 -0
- package/platform-guides/android-interaction.md +74 -0
- package/platform-guides/apple-interaction.md +9 -1
- package/platform-guides/compatibility-matrix.md +97 -0
- package/platform-guides/index.md +19 -2
- package/platform-guides/input-and-focus.md +91 -0
- package/platform-guides/preferences-and-accessibility.md +90 -0
- package/platform-guides/windows-interaction.md +75 -0
- package/recipes/homepage.md +8 -0
- package/scripts/compiler/README.md +112 -0
- package/scripts/compiler/cli.mjs +51 -0
- package/scripts/compiler/mcp.mjs +53 -0
- package/scripts/compiler/operations.mjs +70 -0
- package/scripts/compiler/runtime.mjs +156 -0
- package/scripts/sg-entry.mjs +20 -0
- package/scripts/sg-server.mjs +20 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Domain Guide
|
|
3
|
+
title: Component Contract
|
|
4
|
+
description: Define product component semantics, states, events, asynchronous ownership, and verification before visual treatment.
|
|
5
|
+
domain: design-engineering
|
|
6
|
+
lifecycle: experimental
|
|
7
|
+
provenance_kind: local
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Component Contract
|
|
11
|
+
|
|
12
|
+
Primary role: product component implementation handoff.
|
|
13
|
+
|
|
14
|
+
## Repository Boundary
|
|
15
|
+
|
|
16
|
+
This contract describes consumer-owned behavior. It does not create a shared component library, new Layout primitive, or default visual values. Existing profile records have their own closed schema; this planning template cannot substitute for their evidence records.
|
|
17
|
+
|
|
18
|
+
## Reusable Method
|
|
19
|
+
|
|
20
|
+
Start with semantic HTML or the platform's native control. Name the public inputs, emitted events, internal state, and owner of persisted data. Then describe each transition and its observable outcome. Use the [Worked Examples](worked-examples.md) to check common failure paths.
|
|
21
|
+
|
|
22
|
+
For reusable ownership and transition mechanisms, use the [State Management catalog](state-management/index.md). The [submitted snapshot pattern](state-management/patterns/submitted-snapshot.md) provides an executable model of the save contract below.
|
|
23
|
+
|
|
24
|
+
## Contract Template
|
|
25
|
+
|
|
26
|
+
| Field | Required answer |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| Task | The user action and the outcome the component supports |
|
|
29
|
+
| Semantics | Element/control, accessible name, description, value, relationships |
|
|
30
|
+
| Inputs | Data and callbacks, required/optional values, identity and revision |
|
|
31
|
+
| Outputs | Events, payload meaning, when they are emitted, who commits the result |
|
|
32
|
+
| State | Initial, active, selected, disabled, pending, empty, error, completed as applicable |
|
|
33
|
+
| State ownership | Controlled inputs versus internal temporary state; reconciliation rule |
|
|
34
|
+
| Input and focus | Keyboard, pointer, touch, focus entry/return and unavailable actions; for any drag operation, the separate single-pointer and keyboard alternatives |
|
|
35
|
+
| Async ownership | Request identity, duplicate action policy, stale result handling, cancellation |
|
|
36
|
+
| Content | Empty, long, localized, unbroken and unavailable data |
|
|
37
|
+
| Spatial composition | Layout source, parent constraints, scroll owner and overflow behavior |
|
|
38
|
+
| Presentation | Product-owned values, density, visual hierarchy and optional motion brief |
|
|
39
|
+
| Lifecycle | Creation, navigation, rerender, removal, event/listener cleanup |
|
|
40
|
+
| Evidence | Expected behavior, actual result, runtime, source revision and artifacts |
|
|
41
|
+
| Handoff | `consumer_reference` record or `not_applicable` with a reason |
|
|
42
|
+
|
|
43
|
+
## Worked Contract: Save Action
|
|
44
|
+
|
|
45
|
+
Task: persist the current editable document. The form owns the draft; the save operation owns a submitted snapshot; the server owns the persisted result. A success for snapshot A must not mark newer draft B as saved.
|
|
46
|
+
|
|
47
|
+
| Current state | Event | Next state | Required effect |
|
|
48
|
+
| --- | --- | --- | --- |
|
|
49
|
+
| Clean | Edit | Dirty | Keep entered values; mark unsaved changes |
|
|
50
|
+
| Dirty | Submit valid draft A | Saving A | Capture A and a request identity; acknowledge pending |
|
|
51
|
+
| Saving A | Submit again | Saving A | Apply the declared duplicate policy; this example ignores the duplicate |
|
|
52
|
+
| Saving A | Edit to B | Saving A with dirty B | Preserve B and distinguish it from submitted A |
|
|
53
|
+
| Saving A | Matching success | Clean if draft still A; otherwise dirty B | Record persisted A without discarding B |
|
|
54
|
+
| Saving A | Matching failure | Dirty current draft with error | Keep values and offer retry |
|
|
55
|
+
| Any | Stale response | Unchanged | Ignore responses outside the active operation |
|
|
56
|
+
| Any | Unmount/navigation | Disposed | Stop UI updates; cancellation does not imply the server rolled back |
|
|
57
|
+
|
|
58
|
+
Implementation sketch, independent of framework:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
on submit:
|
|
62
|
+
if a request is active: return
|
|
63
|
+
validate the current draft
|
|
64
|
+
copy the draft into submittedSnapshot
|
|
65
|
+
create requestIdentity
|
|
66
|
+
start persistence(requestIdentity, submittedSnapshot)
|
|
67
|
+
on result(identity, result):
|
|
68
|
+
if disposed or identity is not active: return
|
|
69
|
+
clear the active request
|
|
70
|
+
if successful: set persistedSnapshot to submittedSnapshot
|
|
71
|
+
else: expose a recoverable error
|
|
72
|
+
derive dirty state by comparing current draft with persistedSnapshot
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
A real application also defines revision conflicts, server normalization, and retry semantics. The sketch is not a distributed consistency protocol. Its handoff is `consumer_reference: not_applicable` because this fictional example selects no consumer profile or conformance record.
|
|
76
|
+
|
|
77
|
+
## Drag Operations Need Two Alternatives
|
|
78
|
+
|
|
79
|
+
When a component commits a value through dragging (reorder, slider thumb, resize handle, board column move), answer the Input and focus field once per input path:
|
|
80
|
+
|
|
81
|
+
| Path | Required answer |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| Drag | What previews, what release commits, what cancellation restores |
|
|
84
|
+
| Single pointer without dragging | Which click or tap controls reach the same committed value, and where they are visible without hover |
|
|
85
|
+
| Keyboard | Which keys reach the same committed value, and where focus rests afterwards |
|
|
86
|
+
|
|
87
|
+
[WCAG 2.2 Success Criterion 2.5.7](https://www.w3.org/TR/WCAG22/#dragging-movements) (Level AA) is the named source for the second row. Its Understanding document evaluates it independently from keyboard operation, so a keyboard handler does not answer it and pointer-only buttons do not answer the keyboard row. The criterion excepts dragging that is essential and functionality the user agent determines without author modification; a custom slider, sortable list, or pan surface owns all three rows. A swipe or flick is not an acceptable second row because it is still a path-based gesture. All paths emit the same output event with the same payload meaning, so validation, duplicate policy, and stale-result handling are not bypassed by the alternative. The motion and cancellation side is in [Drag And Settle](../motion/interaction-recipes.md#drag-and-settle).
|
|
88
|
+
|
|
89
|
+
This contract names what to declare. It does not establish conformance; that requires the consuming product's rendered behavior under the [accessibility evidence gate](../quality/gates/accessibility-evidence.md). [Target Size (Minimum)](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html) is a different criterion for the size of those pointer controls and is measured in CSS pixels, not platform dp or pt.
|
|
90
|
+
|
|
91
|
+
## Opinionated Guidance
|
|
92
|
+
|
|
93
|
+
Use state names that expose meaningful differences. Two booleans can accidentally permit “saved and failed”; a state transition table helps reveal impossible combinations. Do not merge input validity, request state, and persisted revision into one visual status.
|
|
94
|
+
|
|
95
|
+
## Platform-Specific Guidance
|
|
96
|
+
|
|
97
|
+
For web forms, preserve native label and form relationships. Validate custom semantics against the applicable [accessibility evidence gate](../quality/gates/accessibility-evidence.md). Framework scheduling, request abort behavior, and server idempotency require separate implementation evidence.
|
|
98
|
+
|
|
99
|
+
## Unsupported Absolutes
|
|
100
|
+
|
|
101
|
+
A state table does not prove accessibility, successful persistence, race freedom, or device coverage. Cancelling a client request does not prove its remote side effects stopped.
|
|
102
|
+
|
|
103
|
+
## Verification Contract
|
|
104
|
+
|
|
105
|
+
Resolve responses out of order, edit during saving, fail then retry, activate repeatedly, and remove the component before completion. Inspect both persisted and displayed values. Include keyboard-only operation, long content, and constrained parents. For a drag operation, complete the task by drag, by click or tap without movement, and by keyboard, then compare the committed value, emitted event, and focus position. Record actual outcomes; the table above is an unexecuted reference contract. Review when a public input, event, or state meaning changes.
|
|
106
|
+
|
|
107
|
+
## Source, License, And Attribution
|
|
108
|
+
|
|
109
|
+
Locally authored contract and pseudocode; no framework or upstream implementation is copied. WCAG 2.2 (W3C Recommendation, 12 December 2024) and the informative Understanding pages for Success Criteria 2.5.7 (updated 10 August 2026) and 2.5.8 were rechecked on 2026-09-19 for the statements attributed to them; the three-path table is local synthesis and has not been executed against a product. Shared quality gates own evidence admissibility.
|
|
110
|
+
|
|
111
|
+
## IA Navigation
|
|
112
|
+
|
|
113
|
+
Parent: [Design Engineering](index.md).
|
|
114
|
+
Next: [Design Engineering Worked Examples](worked-examples.md).
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Domain Guide
|
|
3
|
+
title: Design Engineering Decision Tree
|
|
4
|
+
description: Route product craft work from the uncertain decision to a contract, example, and appropriate evidence.
|
|
5
|
+
domain: design-engineering
|
|
6
|
+
lifecycle: experimental
|
|
7
|
+
provenance_kind: local
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Design Engineering Decision Tree
|
|
11
|
+
|
|
12
|
+
Primary role: product implementation planning route.
|
|
13
|
+
|
|
14
|
+
## Repository Boundary
|
|
15
|
+
|
|
16
|
+
This route turns a product request into a bounded implementation decision. It owns neither shared quality policy nor a default design system. Use the existing Layout corpus for geometry and Motion for temporal behavior.
|
|
17
|
+
|
|
18
|
+
## Reusable Method
|
|
19
|
+
|
|
20
|
+
1. Write the user's action and the expected result in one sentence.
|
|
21
|
+
2. Identify what is uncertain: content, structure, state, identity, platform behavior, or perception.
|
|
22
|
+
3. Select the route below and produce its named artifact.
|
|
23
|
+
4. Implement the smallest slice containing the risky state, including failure and recovery.
|
|
24
|
+
5. Verify the observable and record the remaining limitation using [Interface Craft Decisions](interface-craft.md).
|
|
25
|
+
|
|
26
|
+
## Task Routes
|
|
27
|
+
|
|
28
|
+
| Uncertain decision | Primary route | Artifact to produce |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| What should this screen contain? | [Webpage Generation Workflow](../guides/webpage-generation-workflow.md) | Content inventory and task model |
|
|
31
|
+
| What owns size, flow, and scroll? | [Layout Planning Guide](../GUIDE.md) | Layout brief and pattern composition |
|
|
32
|
+
| Where should state live, and how do its transitions compose? | [State Management](state-management/index.md) | Owner map, selected patterns, and acceptance traces |
|
|
33
|
+
| What happens after activation or failure? | [Component Contract](component-contract.md) | State, event, focus, and asynchronous ownership tables |
|
|
34
|
+
| How should a form, search, or destructive action recover? | [Worked Examples](worked-examples.md) | Scenario-specific acceptance cases |
|
|
35
|
+
| Does a product detail serve the task? | [Interface Craft Decisions](interface-craft.md) | Claim with an observable and evidence boundary |
|
|
36
|
+
| How do distinct identities use one Layout contract? | [Reference Profiles](reference-profiles/index.md) | Explicit profile selection and value ownership |
|
|
37
|
+
| Will an existing consumer survive migration? | [Consumer Migration Readiness](consumer-migration-readiness.md) | Thirteen-dimension consumer-owned conformance record |
|
|
38
|
+
| What should move and why? | [Motion Decision Tree](../motion/decision-tree.md) | Motion brief with interruption policy |
|
|
39
|
+
| Is a platform convention transferable? | [Platform Adaptation Workflow](../platform-guides/adaptation-workflow.md) | Native fact, web mapping, fallback, and runtime matrix |
|
|
40
|
+
|
|
41
|
+
## Worked Intake
|
|
42
|
+
|
|
43
|
+
Request: “Make saving settings feel responsive.” The risky decision is whether acknowledgement means persistence. Begin with a component contract: clean, dirty, saving, saved, and failed. A saving label acknowledges submission; the saved state waits for the persistence response. Preserve unsaved edits when requests fail. Only then evaluate a completion treatment through Motion. This order exposes duplicate writes and lost edits before visual review.
|
|
44
|
+
|
|
45
|
+
An acceptance statement can be: “A failed save leaves the entered values available for retry.” “Feels responsive” remains a human perception hypothesis until measured in the relevant task.
|
|
46
|
+
|
|
47
|
+
## Opinionated Guidance
|
|
48
|
+
|
|
49
|
+
Prototype the uncertain state rather than an entire polished screen. A good first slice includes the initiating action, its failure, and a recovery path. Add complexity when it resolves an observed limitation.
|
|
50
|
+
|
|
51
|
+
## Platform-Specific Guidance
|
|
52
|
+
|
|
53
|
+
Distinguish browser, OS, assistive technology, framework, and component library versions in evidence. A library's state name is an implementation detail, not the user's task definition.
|
|
54
|
+
|
|
55
|
+
## Unsupported Absolutes
|
|
56
|
+
|
|
57
|
+
No selected framework, profile, token set, or prototype proves product quality. Component completion does not demonstrate migration readiness for an entire consumer.
|
|
58
|
+
|
|
59
|
+
## Verification Contract
|
|
60
|
+
|
|
61
|
+
The route succeeds when a reviewer can find the decision owner, artifact, failure case, and evidence needed without guessing. Verify one ordinary, one exceptional, and one interrupted task. Revisit when a route sends the reader to the wrong domain or cannot produce a testable acceptance statement.
|
|
62
|
+
|
|
63
|
+
## Source, License, And Attribution
|
|
64
|
+
|
|
65
|
+
Locally authored routing and settings example. Linked repository documents remain authoritative for their own contracts.
|
|
66
|
+
|
|
67
|
+
## IA Navigation
|
|
68
|
+
|
|
69
|
+
Parent: [Design Engineering](index.md).
|
|
70
|
+
Next: [Component Contract](component-contract.md).
|
|
@@ -8,6 +8,58 @@ In scope: purpose, frequency, interaction detail, implementation review, prototy
|
|
|
8
8
|
|
|
9
9
|
Out of scope: a second universal principle set, unsupported claims of beauty or adoption, and overrides of semantic, accessibility, Layout, or shared quality contracts.
|
|
10
10
|
|
|
11
|
+
## Start Here
|
|
12
|
+
|
|
13
|
+
| Task | Route |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| Route the uncertain product decision. | [Design Engineering Decision Tree](decision-tree.md) |
|
|
16
|
+
| Specify semantics, state, requests, and focus. | [Component Contract](component-contract.md) |
|
|
17
|
+
| Apply settings, search, and destructive-action contracts. | [Design Engineering Worked Examples](worked-examples.md) |
|
|
18
|
+
|
|
19
|
+
These workflows and worked cases are usable experimental guidance. Expected-result tables are test designs; actual product, engine, and reader evidence must be recorded separately. Review on a failed task, a source change, or a changed ownership contract.
|
|
20
|
+
|
|
21
|
+
## State Management
|
|
22
|
+
|
|
23
|
+
Choose [State Management](state-management/index.md) for UI state ownership, transitions, asynchronous consistency, and lifetime. The collection contains 12 patterns and four behavior recipes within this domain.
|
|
24
|
+
|
|
25
|
+
### Planning And Verification
|
|
26
|
+
|
|
27
|
+
- [State decision tree](state-management/decision-tree.md)
|
|
28
|
+
- [State brief](state-management/state-brief.md)
|
|
29
|
+
- [State verification matrix](state-management/verification.md)
|
|
30
|
+
- [State recipes and composition matrix](state-management/recipes/index.md)
|
|
31
|
+
|
|
32
|
+
### Ownership And Derivation
|
|
33
|
+
|
|
34
|
+
- [Single owner and controlled inputs](state-management/patterns/single-owner.md)
|
|
35
|
+
- [Derived state](state-management/patterns/derived-state.md)
|
|
36
|
+
- [Selection by stable identity](state-management/patterns/id-selection.md)
|
|
37
|
+
|
|
38
|
+
### Editing And Persistence
|
|
39
|
+
|
|
40
|
+
- [Draft and persisted baseline](state-management/patterns/draft-and-baseline.md)
|
|
41
|
+
- [Submitted snapshot](state-management/patterns/submitted-snapshot.md)
|
|
42
|
+
- [Unsaved navigation](state-management/patterns/unsaved-navigation.md)
|
|
43
|
+
|
|
44
|
+
### Asynchronous Consistency
|
|
45
|
+
|
|
46
|
+
- [Latest request wins](state-management/patterns/latest-request-wins.md)
|
|
47
|
+
- [Single flight](state-management/patterns/single-flight.md)
|
|
48
|
+
- [Optimistic overlay](state-management/patterns/optimistic-overlay.md)
|
|
49
|
+
|
|
50
|
+
### Navigation And Lifetime
|
|
51
|
+
|
|
52
|
+
- [URL state](state-management/patterns/url-state.md)
|
|
53
|
+
- [Identity reset](state-management/patterns/identity-reset.md)
|
|
54
|
+
- [Versioned restore](state-management/patterns/versioned-restore.md)
|
|
55
|
+
|
|
56
|
+
### Screen Compositions
|
|
57
|
+
|
|
58
|
+
- [Settings save](state-management/recipes/settings-save.md)
|
|
59
|
+
- [Search and detail](state-management/recipes/search-detail.md)
|
|
60
|
+
- [Multi-step form](state-management/recipes/multi-step-form.md)
|
|
61
|
+
- [Delete and supported undo](state-management/recipes/delete-undo.md)
|
|
62
|
+
|
|
11
63
|
## Documents
|
|
12
64
|
|
|
13
65
|
- [Interface Craft Decisions](interface-craft.md) connects product purpose, implementation detail, and verification without treating taste as proof.
|
|
@@ -18,11 +70,17 @@ Out of scope: a second universal principle set, unsupported claims of beauty or
|
|
|
18
70
|
|
|
19
71
|
This domain proposes product-layer questions. [Quality Gates](../quality/index.md) remain the shared authority for claims, evidence families, accessibility precedence, rationale, and debt.
|
|
20
72
|
|
|
73
|
+
## Source-Backed Deep Dives
|
|
74
|
+
|
|
75
|
+
- [Native Interaction Contracts](native-interaction-contracts.md). Choose dialog, disclosure, menu, popover, and combobox behavior.
|
|
76
|
+
- [Text Input And Internationalization](text-input-and-internationalization.md). Preserve IME composition, text units, mixed direction, and editing intent.
|
|
77
|
+
- [Loading, Progress, And Feedback](loading-and-feedback.md). Separate pending work, accepted results, announcements, and responsiveness.
|
|
78
|
+
|
|
21
79
|
## Domain Contract
|
|
22
80
|
|
|
23
|
-
See [StyleGallery Domains](../DOMAINS.md) for lifecycle, provenance, page membership, and
|
|
81
|
+
See [StyleGallery Domains](../DOMAINS.md) for lifecycle, provenance, page membership, and staleness rules.
|
|
24
82
|
|
|
25
83
|
## IA Navigation
|
|
26
84
|
|
|
27
85
|
Parent: [StyleGallery](../index.md).
|
|
28
|
-
Next: [
|
|
86
|
+
Next: [Design Engineering Decision Tree](decision-tree.md).
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Domain Guide
|
|
3
|
+
title: Loading, Progress, And Feedback
|
|
4
|
+
description: Separate input acknowledgement, pending work, stale content, confirmed completion, and measurable responsiveness.
|
|
5
|
+
domain: design-engineering
|
|
6
|
+
lifecycle: experimental
|
|
7
|
+
provenance_kind: local
|
|
8
|
+
reviewed_on: 2026-09-21
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Loading, Progress, And Feedback
|
|
12
|
+
|
|
13
|
+
Primary role: asynchronous presentation and measurement guide.
|
|
14
|
+
|
|
15
|
+
## Repository Boundary
|
|
16
|
+
|
|
17
|
+
This page owns the product's account of pending work and results. Request authority remains in [State Management](state-management/index.md), motion in [Motion](../motion/index.md), and evidence claims in [Quality](../quality/index.md). A loading treatment is not a reusable Layout pattern.
|
|
18
|
+
|
|
19
|
+
## Reusable Method
|
|
20
|
+
|
|
21
|
+
Identify the fact behind each displayed state. Distinguish input received, request started, work in progress, result accepted, result rendered, and result announced. Select a feedback mechanism only after its state owner and truth condition are explicit.
|
|
22
|
+
|
|
23
|
+
### Source Findings
|
|
24
|
+
|
|
25
|
+
| Source | Bounded finding | Implication |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| [HTML progress element](https://html.spec.whatwg.org/multipage/form-elements.html#the-progress-element) | A progress element can represent determinate or indeterminate task completion; omitting `value` expresses indeterminate progress. | Do not fabricate a percent complete when total work is unknown. |
|
|
28
|
+
| [WAI-ARIA 1.2 busy state](https://www.w3.org/TR/wai-aria-1.2/#aria-busy) | `aria-busy` indicates an element is being modified; assistive technologies may defer exposing changes while it is busy. | Clear the state on every terminal path and verify actual announcements. |
|
|
29
|
+
| [Status Messages explanation](https://www.w3.org/WAI/WCAG22/Understanding/status-messages.html) | A result summary may be a status message, while the entire returned result list is not thereby a status message. | Announce concise state/result information rather than every changing node. |
|
|
30
|
+
| [Interaction to Next Paint](https://web.dev/articles/inp) | INP measures interaction responsiveness through the next paint; good field responsiveness is described as at most 200 ms at the 75th percentile, assessed by device category. | Do not use that number as a required animation duration or server-response deadline. |
|
|
31
|
+
| [Optimize INP](https://web.dev/articles/optimize-inp) | Input delay, event processing, and presentation delay contribute to the interaction latency. | Diagnose which interval is slow before changing a loading indicator. |
|
|
32
|
+
| [Event Timing API](https://www.w3.org/TR/event-timing/) | The API defines event timing observations with implementation and exposure constraints. | Record the instrument and observation scope rather than treating callback time as total latency. |
|
|
33
|
+
| [Cumulative Layout Shift](https://web.dev/articles/cls) | CLS measures unexpected layout movement with defined exclusions and aggregation. | A stable placeholder can help spatial stability without proving timely or correct completion. |
|
|
34
|
+
|
|
35
|
+
Sources were inspected 2026-09-21. Browser metric guidance is a measurement convention, not a guarantee of perceived quality. Standards-track drafts and actual browser instrumentation must be distinguished.
|
|
36
|
+
|
|
37
|
+
### State-To-Presentation Contract
|
|
38
|
+
|
|
39
|
+
| State | Required truth | Local presentation proposal |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| Initial pending | No accepted content exists for this request. | Explain what is loading; use stationary structure if useful. |
|
|
42
|
+
| Refreshing | Previously accepted content remains visible while a new request runs. | Identify its freshness/query boundary and avoid implying it is the new result. |
|
|
43
|
+
| Partial result | Some units are accepted and others remain pending or failed. | Distinguish completed units from missing units and provide a bounded retry. |
|
|
44
|
+
| Determinate progress | A meaningful completed/total measure exists. | Expose that measure and its scope; distinguish upload from server processing. |
|
|
45
|
+
| Indeterminate progress | The operation runs but no honest completion ratio exists. | Explain the current stage without a fabricated percentage. |
|
|
46
|
+
| Success | The relevant authoritative result was accepted. | Make the result durable and expose the next action. |
|
|
47
|
+
| Failure or unknown outcome | Failure is confirmed, or acknowledgement is missing. | Preserve recoverable input; distinguish safe retry from possible duplicate work. |
|
|
48
|
+
| Cancel requested | A request to stop was issued. | Avoid claiming cancellation is complete until the contract supports that fact. |
|
|
49
|
+
|
|
50
|
+
These treatments are local proposals. A skeleton, toast, or spinner is neither mandatory nor sufficient for any row.
|
|
51
|
+
|
|
52
|
+
### Worked Scenario: Search While Keeping Results
|
|
53
|
+
|
|
54
|
+
The user has query A results and submits B. Keep A visible under an explicit refreshing state. Accept B only if its request identity remains current. If A's late failure arrives while B is pending, it cannot clear B's busy state. If B fails, label the retained content as A and provide a retry tied to B.
|
|
55
|
+
|
|
56
|
+
The result summary, busy state, empty state, and visible records must describe the same accepted request. “No results” is a completed result, not a synonym for “nothing rendered yet.” A late finally handler can violate this even when success callbacks are guarded; use the [latest-request contract](state-management/patterns/latest-request-wins.md).
|
|
57
|
+
|
|
58
|
+
### Worked Scenario: Save With An Unknown Outcome
|
|
59
|
+
|
|
60
|
+
The editor submits a snapshot. Connectivity drops after the server may have received it. The consumer must decide how to reconcile that uncertainty: a supported operation identity, refetch, or a documented recovery flow. Merely showing a retry button cannot prove that retrying is safe.
|
|
61
|
+
|
|
62
|
+
Keep the submitted snapshot distinct from edits made while saving. A successful acknowledgement for the earlier snapshot cannot mark the newer draft saved. Compose [submitted snapshot](state-management/patterns/submitted-snapshot.md) with [draft and baseline](state-management/patterns/draft-and-baseline.md).
|
|
63
|
+
|
|
64
|
+
## Opinionated Guidance
|
|
65
|
+
|
|
66
|
+
Prefer feedback that explains the actual stage and preserves a useful next action. Evaluate delays before showing indicators against measured task frequency and latency distribution; do not turn a borrowed delay into a universal rule. Avoid artificially holding completed content merely to finish a decorative loading cycle.
|
|
67
|
+
|
|
68
|
+
Keep repeated announcements bounded. When several regions update, establish which summary owns the user-facing completion message instead of making every region assertive.
|
|
69
|
+
|
|
70
|
+
## Platform-Specific Guidance
|
|
71
|
+
|
|
72
|
+
Native progress controls and web progress semantics differ in APIs and announcement behavior. Real screen-reader tests are needed for the selected combination. For reduced-motion loading treatment, use [Accessible Motion](../motion/accessible-motion.md); for app suspension and navigation lifetime, preserve the state owner's contract.
|
|
73
|
+
|
|
74
|
+
## Unsupported Absolutes
|
|
75
|
+
|
|
76
|
+
A spinner cannot prove ongoing backend work. A good INP cannot prove a successful save. A zero CLS measurement cannot prove usable loading feedback. `aria-busy` alone does not guarantee that a specific message is spoken.
|
|
77
|
+
|
|
78
|
+
## Verification Contract
|
|
79
|
+
|
|
80
|
+
The unexecuted scenario set includes immediate completion, slow completion, stale success, stale error, partial response, cancelled request, lost acknowledgement, retry, unmount, and reduced motion. Observe focus and announcements as well as the displayed status.
|
|
81
|
+
|
|
82
|
+
For latency claims, collect a timestamp for input, first useful presentation, authoritative result, and final presentation where each is observable. Name the clock boundary; client and server timestamps cannot be subtracted without a supported synchronization method. Separate local repeatable scenarios from field distributions. Re-review after request policy, feedback ownership, or instrumentation changes.
|
|
83
|
+
|
|
84
|
+
## Source, License, And Attribution
|
|
85
|
+
|
|
86
|
+
Locally authored synthesis. The linked specifications and first-party performance guidance were inspected 2026-09-21. No source samples are reproduced. `consumer_reference: not_applicable` because no consumer request or evidence record is selected.
|
|
87
|
+
|
|
88
|
+
## IA Navigation
|
|
89
|
+
|
|
90
|
+
Parent: [Design Engineering](index.md).
|
|
91
|
+
Next: [State Verification Matrix](state-management/verification.md).
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Domain Guide
|
|
3
|
+
title: Native Interaction Contracts
|
|
4
|
+
description: Choose disclosure, dialog, popover, menu, and combobox behavior by semantics, focus, dismissal, and input ownership.
|
|
5
|
+
domain: design-engineering
|
|
6
|
+
lifecycle: experimental
|
|
7
|
+
provenance_kind: local
|
|
8
|
+
reviewed_on: 2026-09-21
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Native Interaction Contracts
|
|
12
|
+
|
|
13
|
+
Primary role: product component selection and behavior guide.
|
|
14
|
+
|
|
15
|
+
## Repository Boundary
|
|
16
|
+
|
|
17
|
+
This guide extends the [Component Contract](component-contract.md) with source-backed decisions for native HTML and custom composites. It owns product behavior, not reusable Layout CSS. The [shared accessibility evidence contract](../quality/evidence/accessibility.md) remains the authority for evidence claims.
|
|
18
|
+
|
|
19
|
+
## Reusable Method
|
|
20
|
+
|
|
21
|
+
Write the user's task, the information being exposed, whether background interaction remains available, and what closes the surface. Choose semantics before appearance. Then assign keyboard, focus, pointer, and state ownership. A floating rectangle is insufficient information to choose a component.
|
|
22
|
+
|
|
23
|
+
### Mechanisms And Obligations
|
|
24
|
+
|
|
25
|
+
| Source | Bounded finding | Consumer responsibility |
|
|
26
|
+
| --- | --- | --- |
|
|
27
|
+
| [HTML interactive elements](https://html.spec.whatwg.org/multipage/interactive-elements.html) | `details` is a disclosure; `dialog` supports distinct modal and nonmodal presentation. `showModal()` participates in the modal/inert model. | Choose the right behavior, accessible name, initial focus, and close policy. |
|
|
28
|
+
| [HTML popover](https://html.spec.whatwg.org/multipage/popover.html) | The attribute adds presentation behavior to elements with their own semantics; custom menu keyboard behavior still needs implementation. | Select a semantic element or role and implement its interaction contract. |
|
|
29
|
+
| [APG modal dialog](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/) | The pattern describes contained keyboard navigation, focus placement, and return. Initial focus depends on content and task. | Test focus with long content and a missing invocation control. |
|
|
30
|
+
| [APG menu button](https://www.w3.org/WAI/ARIA/apg/patterns/menu-button/) | A menu button opens a menu of actions or functions with the menu keyboard model. | Do not assign menu roles solely because links appear in a dropdown. |
|
|
31
|
+
| [APG combobox](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) | A combobox has a value and a popup with defined keyboard/state relationships. | Specify text editing, suggestion navigation, selection, and escape separately. |
|
|
32
|
+
| [APG disclosure](https://www.w3.org/WAI/ARIA/apg/patterns/disclosure/) | The disclosure control exposes expanded/collapsed state and toggles associated content. | Keep the control name, state, and controlled content consistent. |
|
|
33
|
+
| [WAI-ARIA 1.2](https://www.w3.org/TR/wai-aria-1.2/#aria-disabled) | `aria-disabled` communicates disabled semantics. It does not implement event suppression. | Prevent disallowed activation in the application's actual event paths. |
|
|
34
|
+
|
|
35
|
+
HTML is a Living Standard; WAI-ARIA 1.2 is a Recommendation; APG is informative implementation guidance. Sources were inspected 2026-09-21. Pattern examples do not establish support for an unspecified browser and assistive-technology combination.
|
|
36
|
+
|
|
37
|
+
### Selection Questions
|
|
38
|
+
|
|
39
|
+
| User need | Starting point | Question that can change the choice |
|
|
40
|
+
| --- | --- | --- |
|
|
41
|
+
| Reveal optional explanatory content | Native disclosure | Does this actually switch mutually exclusive views or choose a value? |
|
|
42
|
+
| Complete a bounded task while background interaction is unavailable | Modal dialog | Must the user compare or interact with the background during this task? |
|
|
43
|
+
| Temporarily expose nonmodal related content | Semantically appropriate element with popover behavior | Is the content a menu, a list of links, a form, or plain information? |
|
|
44
|
+
| Invoke commands from a compact control | Menu button and menu behavior | Are these ordinary navigation links better served by ordinary link navigation? |
|
|
45
|
+
| Edit a value with selectable suggestions | Combobox | Is an ordinary input, select, or separate search-result list sufficient? |
|
|
46
|
+
|
|
47
|
+
These are local selection heuristics. Similar visuals can correctly produce different DOM, focus, and keyboard behavior.
|
|
48
|
+
|
|
49
|
+
### Worked Contract: Edit A Record
|
|
50
|
+
|
|
51
|
+
The user opens an editor from a list row. The consumer chooses a modal because this task intentionally suspends interaction with the list. Save commits a submitted snapshot; Close requests dismissal; an unsaved-change decision belongs to the state owner.
|
|
52
|
+
|
|
53
|
+
| Stage | Decision to record | Adversarial case |
|
|
54
|
+
| --- | --- | --- |
|
|
55
|
+
| Open | Accessible name and initial focus target | Long introduction would be scrolled out of view by focusing the first input. |
|
|
56
|
+
| Edit | Draft lifetime and field-error relationship | Background data refresh replaces the edited row. |
|
|
57
|
+
| Save | Request identity and pending activation rule | Enter and a pointer click arrive before the request settles. |
|
|
58
|
+
| Dismiss | Which paths request close and which discard changes | Escape, an outside interaction, and an explicit Cancel have different intended meanings. |
|
|
59
|
+
| Return | Valid focus destination after closing | The original row was deleted or filtered out. |
|
|
60
|
+
|
|
61
|
+
Compose [submitted snapshot](state-management/patterns/submitted-snapshot.md), [single flight](state-management/patterns/single-flight.md), and [unsaved navigation](state-management/patterns/unsaved-navigation.md) as needed. Animation completion cannot authorize a write or decide whether a draft is disposable.
|
|
62
|
+
|
|
63
|
+
### Preserve Editing Inside Composites
|
|
64
|
+
|
|
65
|
+
An editable combobox has at least two responsibilities: editing text and navigating candidate options. Specify when Arrow keys move a candidate, when Enter accepts it, and when Escape dismisses suggestions while retaining the typed text. During IME composition, those keys may belong to the input method; follow [Text Input And Internationalization](text-input-and-internationalization.md).
|
|
66
|
+
|
|
67
|
+
A disabled-looking control needs a deliberate discoverability policy. Native `disabled` and `aria-disabled` have different behavior; choose which focus and activation behavior the task requires, and explain why an action is unavailable without relying only on color.
|
|
68
|
+
|
|
69
|
+
## Opinionated Guidance
|
|
70
|
+
|
|
71
|
+
Prefer native semantics when they fit the task, and build the smallest custom behavior that remains necessary. Name the semantic reason for every role override. Treat multiple open surfaces as an ownership question: which surface receives Escape, where focus stays, and which state survives dismissal.
|
|
72
|
+
|
|
73
|
+
## Platform-Specific Guidance
|
|
74
|
+
|
|
75
|
+
Native HTML behavior, browser support, and accessibility mappings are separate from framework component names. Record the browser, framework adapter, and assistive technology used in verification. A native platform's “popover” does not settle the web contract; compare [Interaction Semantics](../design-terminology/interaction-semantics.md) and [Platform Adaptation](../platform-guides/adaptation-workflow.md).
|
|
76
|
+
|
|
77
|
+
## Unsupported Absolutes
|
|
78
|
+
|
|
79
|
+
Top-layer presentation does not imply modality. A role does not supply keyboard handlers. Native HTML does not remove the need for an accessible name or target verification. Escape does not intrinsically mean “discard all work.”
|
|
80
|
+
|
|
81
|
+
## Verification Contract
|
|
82
|
+
|
|
83
|
+
The proposed matrix includes keyboard-only opening and closing, forward/backward Tab, active popup navigation, IME input, a removed opener, nested surface dismissal, long content, zoom, and reduced motion. Check visible behavior, DOM state, accessibility semantics, and the actual announcement path separately.
|
|
84
|
+
|
|
85
|
+
Record the selected widget model and expected key behavior before testing. Passing a self-written handler test establishes that handler's behavior, not conformance with APG or the platform. Compare observed behavior with the cited contract. No browser or screen-reader execution is claimed by this guide. Re-review when the widget model, browser, or focus owner changes.
|
|
86
|
+
|
|
87
|
+
## Source, License, And Attribution
|
|
88
|
+
|
|
89
|
+
Locally authored synthesis of the official sources linked above, inspected 2026-09-21. No upstream examples or implementation are reproduced. `consumer_reference: not_applicable` because this guide selects no consumer component record.
|
|
90
|
+
|
|
91
|
+
## IA Navigation
|
|
92
|
+
|
|
93
|
+
Parent: [Design Engineering](index.md).
|
|
94
|
+
Next: [Text Input And Internationalization](text-input-and-internationalization.md).
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Domain Guide
|
|
3
|
+
title: State Management Decision Tree
|
|
4
|
+
description: Route UI state problems to the smallest ownership or transition contract.
|
|
5
|
+
domain: design-engineering
|
|
6
|
+
lifecycle: experimental
|
|
7
|
+
provenance_kind: local
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# State Management Decision Tree
|
|
11
|
+
|
|
12
|
+
## Repository Boundary
|
|
13
|
+
|
|
14
|
+
This route selects consumer behavior within Design Engineering. It does not choose a global store or redefine Layout patterns.
|
|
15
|
+
|
|
16
|
+
## Reusable Method
|
|
17
|
+
|
|
18
|
+
| Question | Route | Decision to record |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| Can the value be calculated from current inputs? | [Derived state](patterns/derived-state.md) | Source inputs and equality/invalidation |
|
|
21
|
+
| Do several controls write one accepted value? | [Single owner](patterns/single-owner.md) | Nearest surviving owner and intent API |
|
|
22
|
+
| Does selection change when rows reorder? | [ID selection](patterns/id-selection.md) | Stable identity and missing-item policy |
|
|
23
|
+
| Must edits survive Cancel or a failed save? | [Draft and baseline](patterns/draft-and-baseline.md) | Draft owner and baseline meaning |
|
|
24
|
+
| Can editing continue during saving? | [Submitted snapshot](patterns/submitted-snapshot.md) | Captured data and acknowledgement identity |
|
|
25
|
+
| Can leaving discard work? | [Unsaved navigation](patterns/unsaved-navigation.md) | Cancel, discard, and save-and-leave policy |
|
|
26
|
+
| Can replaceable reads finish out of order? | [Latest request wins](patterns/latest-request-wins.md) | Result acceptance identity |
|
|
27
|
+
| Can an operation be activated repeatedly? | [Single flight](patterns/single-flight.md) | Share, ignore, queue, or replace |
|
|
28
|
+
| Should a change appear before acknowledgement? | [Optimistic overlay](patterns/optimistic-overlay.md) | Rollback scope and uncertain outcome recovery |
|
|
29
|
+
| Should Back, reload, and links restore the view? | [URL state](patterns/url-state.md) | Committed route versus input buffer |
|
|
30
|
+
| Is the screen reused for another identity? | [Identity reset](patterns/identity-reset.md) | Generation and cleanup scope |
|
|
31
|
+
| Must state survive a new session? | [Versioned restore](patterns/versioned-restore.md) | Schema, account scope, migration and retention |
|
|
32
|
+
|
|
33
|
+
These questions can select several patterns. For search, first separate the input buffer from the committed URL, then attach a latest-wins request owner and selected ID. The [search recipe](recipes/search-detail.md) defines the joint contract.
|
|
34
|
+
|
|
35
|
+
Before adding another pattern, name a failure the existing set cannot express. Put a new combination in a recipe; add a primitive only when its owner or invariant is independently reusable.
|
|
36
|
+
|
|
37
|
+
## Opinionated Guidance
|
|
38
|
+
|
|
39
|
+
Choose the failure and lifetime before the library. A cache, URL, form buffer, and session preference may share a screen without sharing an owner.
|
|
40
|
+
|
|
41
|
+
## Platform-Specific Guidance
|
|
42
|
+
|
|
43
|
+
Transport cancellation, router guards, and storage hooks vary by framework and runtime. Record those adapter choices in the brief instead of assuming the abstract model implements them.
|
|
44
|
+
|
|
45
|
+
## Unsupported Absolutes
|
|
46
|
+
|
|
47
|
+
A decision tree is not an exhaustive treatment of offline replication, collaboration, or server transactions. Escalate those requirements to a separately specified consistency protocol.
|
|
48
|
+
|
|
49
|
+
## Verification Contract
|
|
50
|
+
|
|
51
|
+
Try routing a stale search result, lost edit, and wrong-account restore. Each must reach a named pattern and concrete failure trace. Revisit when two routes prescribe conflicting owners.
|
|
52
|
+
|
|
53
|
+
## Source, License, And Attribution
|
|
54
|
+
|
|
55
|
+
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.
|
|
56
|
+
|
|
57
|
+
## IA Navigation
|
|
58
|
+
|
|
59
|
+
Parent: [State Management](index.md).
|
|
60
|
+
Next: [Continue the state management route](state-brief.md).
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# State Management
|
|
2
|
+
|
|
3
|
+
Domain classification: design-engineering. Lifecycle: `experimental`.
|
|
4
|
+
|
|
5
|
+
## Repository Boundary
|
|
6
|
+
|
|
7
|
+
State management is a Design Engineering topic, not a seventh domain. It owns consumer UI decisions about authoritative values, events, effects, reconciliation, and lifetime. Layout continues to own spatial composition; Motion owns optional presentation timing. Server transaction protocols, universal library rankings, and shared component implementations are outside this collection.
|
|
8
|
+
|
|
9
|
+
## Reusable Method
|
|
10
|
+
|
|
11
|
+
Start with [the decision tree](decision-tree.md), fill in the [state brief](state-brief.md), select the smallest relevant patterns, then compose a [screen recipe](recipes/index.md). The [verification matrix](verification.md) separates expected behavior from observed evidence.
|
|
12
|
+
|
|
13
|
+
한국어 검색 안내: 상태 관리, 상태 소유권, 파생 상태, 초안과 저장본, 비동기 요청 경합, URL 동기화, 상태 복원은 아래 패턴에서 찾을 수 있습니다.
|
|
14
|
+
|
|
15
|
+
### Pattern Catalog
|
|
16
|
+
|
|
17
|
+
| Category | Pattern | Failure prevented |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| Ownership and derivation | [Single Owner And Controlled Inputs](patterns/single-owner.md) | Keep one authoritative value when several controls edit the same setting. |
|
|
20
|
+
| Ownership and derivation | [Derived State From Authoritative Inputs](patterns/derived-state.md) | Prevent totals, filtered lists, and dirty flags from drifting away from their inputs. |
|
|
21
|
+
| Ownership and derivation | [Selection By Stable Identity](patterns/id-selection.md) | Keep selection attached to an entity while a collection reorders or refreshes. |
|
|
22
|
+
| Editing and persistence | [Draft And Persisted Baseline](patterns/draft-and-baseline.md) | Preserve editable work while distinguishing it from the last acknowledged saved value. |
|
|
23
|
+
| Editing and persistence | [Submitted Snapshot And Save Acknowledgement](patterns/submitted-snapshot.md) | Keep later edits dirty when an earlier submitted snapshot finishes saving. |
|
|
24
|
+
| Editing and persistence | [Unsaved Changes And Navigation](patterns/unsaved-navigation.md) | Make leaving an edited screen an explicit decision without losing the current draft. |
|
|
25
|
+
| Asynchronous consistency | [Latest Request Wins](patterns/latest-request-wins.md) | Prevent an older read response from replacing the result of a newer user intent. |
|
|
26
|
+
| Asynchronous consistency | [Single Flight And Duplicate Submission](patterns/single-flight.md) | Apply an explicit policy to repeated activation of one pending operation. |
|
|
27
|
+
| Asynchronous consistency | [Optimistic Overlay And Recovery](patterns/optimistic-overlay.md) | Show a speculative change while preserving an authoritative base for recovery. |
|
|
28
|
+
| Navigation and lifetime | [URL State And History](patterns/url-state.md) | Keep shareable screen state consistent across links, refresh, and browser history. |
|
|
29
|
+
| Navigation and lifetime | [Identity Boundary And Reset](patterns/identity-reset.md) | Prevent temporary state and pending outcomes from leaking across entity or account changes. |
|
|
30
|
+
| Navigation and lifetime | [Versioned And Scoped State Restore](patterns/versioned-restore.md) | Restore persisted preferences only when their schema and ownership scope are valid. |
|
|
31
|
+
|
|
32
|
+
### Relationship To Existing Contracts
|
|
33
|
+
|
|
34
|
+
The [Component Contract](../component-contract.md) remains the public handoff for semantics, events, focus, and asynchronous ownership. Its save example remains in place. [Worked Examples](../worked-examples.md) supplies existing product scenarios; these patterns make their mechanisms individually selectable.
|
|
35
|
+
|
|
36
|
+
This collection contains 12 patterns in four categories and four [recipes](recipes/index.md). The [composition matrix](recipes/index.md#composition-matrix) records essential and replaceable choices. Plain JavaScript examples are the local executable reference; framework adapters must preserve their declared invariants.
|
|
37
|
+
|
|
38
|
+
## Opinionated Guidance
|
|
39
|
+
|
|
40
|
+
Start by locating the authoritative value and its lifetime. Introduce a shared store only when shared ownership or subscriptions require it. Keep remote data authority distinct from local cache ownership, and model request status separately from draft validity and persisted revision.
|
|
41
|
+
|
|
42
|
+
## Platform-Specific Guidance
|
|
43
|
+
|
|
44
|
+
Choose native controls and platform navigation before adapters. URL parsing, storage access, focus recovery, and framework disposal each need target-runtime checks beyond the Node examples.
|
|
45
|
+
|
|
46
|
+
## Unsupported Absolutes
|
|
47
|
+
|
|
48
|
+
Neither a reducer nor a state machine guarantees race freedom. No library is the default for this collection. Local executable examples do not establish backend, accessibility, or browser conformance.
|
|
49
|
+
|
|
50
|
+
## Verification Contract
|
|
51
|
+
|
|
52
|
+
A reader should find a pattern from a failure symptom, identify its owner and minimal implementation, compose it into a screen, and locate a repeatable acceptance sequence. Run `npm run test:state-management` for the 12 local examples; record browser and backend checks separately.
|
|
53
|
+
|
|
54
|
+
## Source, License, And Attribution
|
|
55
|
+
|
|
56
|
+
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.
|
|
57
|
+
|
|
58
|
+
## IA Navigation
|
|
59
|
+
|
|
60
|
+
Parent: [Design Engineering](../index.md).
|
|
61
|
+
Next: [Continue the state management route](decision-tree.md).
|