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
|
@@ -9,7 +9,7 @@ source_path: skills/apple-design/SKILL.md
|
|
|
9
9
|
source_revision: 220e8607c90b17337d210125777b7b695f26c221
|
|
10
10
|
platform: Apple platforms
|
|
11
11
|
platform_version: verify-current
|
|
12
|
-
reviewed_on: 2026-
|
|
12
|
+
reviewed_on: 2026-09-08
|
|
13
13
|
---
|
|
14
14
|
|
|
15
15
|
# Apple Interaction As A Comparative Reference
|
|
@@ -33,6 +33,14 @@ For each proposed comparison:
|
|
|
33
33
|
5. Define the web adaptation, including unavailable or materially different capabilities.
|
|
34
34
|
6. Verify the adapted behavior on its real surface and record what remains unproven.
|
|
35
35
|
|
|
36
|
+
## Official Source Review And Worked Adaptation
|
|
37
|
+
|
|
38
|
+
Official [HIG Motion](https://developer.apple.com/design/human-interface-guidelines/motion) and [HIG Accessibility](https://developer.apple.com/design/human-interface-guidelines/accessibility) were rechecked on 2026-09-08 through Apple's documentation data for [Motion](https://developer.apple.com/tutorials/data/design/human-interface-guidelines/motion.json) and [Accessibility](https://developer.apple.com/tutorials/data/design/human-interface-guidelines/accessibility.json). This is a dated living-document review, not a pin of shipped OS behavior. The motion guidance supports purposeful, optional motion and cancellation; it does not supply universal web animation parameters.
|
|
39
|
+
|
|
40
|
+
Worked proposal: a web settings disclosure opens immediately and keeps its trigger operable. Optional movement communicates the revealed region. Under reduced motion, the same content and controls remain available without unnecessary movement. Use [Motion Disclosure](../motion/interaction-recipes.md#disclosure) for the behavior contract and the [Adaptation Workflow](adaptation-workflow.md) for the source/target record.
|
|
41
|
+
|
|
42
|
+
Expected cases: open and close by keyboard, reverse while opening, enlarge the text, hide content while focus is inside, and change the motion preference. Actual result: `not_run`; this proposal is not a tested Apple or browser implementation. `consumer_reference: not_applicable` because the worked proposal selects no consumer-owned record.
|
|
43
|
+
|
|
36
44
|
## Comparative Questions
|
|
37
45
|
|
|
38
46
|
| Theme | Question to investigate | Required evidence | Boundary |
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Domain Guide
|
|
3
|
+
title: Platform Compatibility Matrix
|
|
4
|
+
description: Separate transferable interaction intent from platform capabilities, target fallbacks, and required evidence.
|
|
5
|
+
domain: platform-guides
|
|
6
|
+
lifecycle: experimental
|
|
7
|
+
provenance_kind: local
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Platform Compatibility Matrix
|
|
11
|
+
|
|
12
|
+
Primary role: adaptation comparison and verification checklist.
|
|
13
|
+
|
|
14
|
+
## Repository Boundary
|
|
15
|
+
|
|
16
|
+
This matrix compares responsibilities, not API support versions. It is not a browser compatibility database. A row's target behavior is a proposed adaptation until verified on the consumer's named runtime.
|
|
17
|
+
|
|
18
|
+
## Reusable Method
|
|
19
|
+
|
|
20
|
+
Choose the relevant concern, read its platform source guide, record native facts and target decisions separately, and execute both the preferred and fallback paths. Use the [Adaptation Workflow](adaptation-workflow.md) for the handoff.
|
|
21
|
+
|
|
22
|
+
## Comparison Matrix
|
|
23
|
+
|
|
24
|
+
| Concern | Source route | Transferable intent | Target boundary and fallback | Required observation |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
| Motion preference | [Apple](apple-interaction.md) | Essential information remains available with less motion | Web preference handling belongs to [Motion recipes](../motion/interaction-recipes.md); retain static status | Change preference and interrupt an active transition |
|
|
27
|
+
| Return navigation | [Android](android-interaction.md) | Understand destination and preserve recoverable state | Browser history, parent links, and host Back are distinct; direct entry needs a known parent route | Normal return, direct entry, cancellation, missing prior item |
|
|
28
|
+
| Adaptive presentation | [Android](android-interaction.md) | Preserve the task as available space changes | Native units/class cutoffs do not define Layout breakpoints; use the target's content constraints | Resize without losing query, selection, or focus |
|
|
29
|
+
| Keyboard traversal | [Windows](windows-interaction.md) | Reach actions and move predictably within controls | Follow the chosen web semantic pattern; visible controls remain operable | Tab/reverse traversal, inner navigation, editing, dismissal |
|
|
30
|
+
| Shortcuts | [Windows](windows-interaction.md) | Efficient access to a named command | OS/browser-reserved keys may be unavailable; retain a visible command | Reserved key path, disabled command, active text editor |
|
|
31
|
+
| Multimodal feedback | [Apple](apple-interaction.md) | Communicate cause and result through available channels | Haptics/audio may be unavailable or inappropriate; retain essential visual/text feedback | Muted/unavailable channels and the actual target device |
|
|
32
|
+
| Translucent treatment | [Apple](apple-interaction.md) | Keep foreground hierarchy understandable | Native materials do not translate to CSS equivalence; an opaque treatment is a candidate fallback | Actual contrast/readability across backgrounds and preferences |
|
|
33
|
+
|
|
34
|
+
## Target Evidence Matrix
|
|
35
|
+
|
|
36
|
+
| Axis | Record | What a missing check means |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| Runtime | Exact browser/app engine, OS, relevant library/SDK versions | No claim beyond the exercised runtime |
|
|
39
|
+
| Input | Keyboard, pointer, touch, controller, assistive technology as claimed | An untested mode is `not_run`, not a pass |
|
|
40
|
+
| Preferences | Motion, contrast, text sizing, other relevant settings | Source support does not prove local handling |
|
|
41
|
+
| Navigation | Direct entry, return, cancellation, nested overlays | A successful happy path leaves recovery unproven |
|
|
42
|
+
| Capability | Available, unavailable, denied, interrupted where relevant | Fallback behavior must be exercised independently |
|
|
43
|
+
| State | Normal, pending, failed, empty, stale or removed data | A screenshot of default state is insufficient |
|
|
44
|
+
|
|
45
|
+
## Scroll Story Target Cases
|
|
46
|
+
|
|
47
|
+
Use [Motion's scroll-story contract](../motion/interaction-recipes.md#scroll-driven-story) when the target is a browser scene controlled by scrolling. Record CSS timeline support at the tested version, feature-unavailable fallback, wheel/trackpad/keyboard/touch input actually used, browser history restoration, and resize/orientation changes. Viewport emulation is evidence of layout at that size, not of mobile hardware or touch physics.
|
|
48
|
+
|
|
49
|
+
Require readable static chapters when the stage cannot fit. Test reduced-motion changes during an active scene, not just the startup preference. The [Scroll Story Lab](../examples/scroll-story/README.md) supplies a target implementation and separates its observed results from untested runtime/device cases.
|
|
50
|
+
|
|
51
|
+
## Fixed-Viewport Scene Target Cases
|
|
52
|
+
|
|
53
|
+
The [scene-navigation contract](../motion/interaction-recipes.md#full-viewport-scene-navigation) adds input arbitration to scene rendering. Test wheel bursts and momentum tails, reverse gestures, horizontal input, modifier zoom, native copy scrolling at both edges, keyboard editing, visible navigation, direct hashes, and browser Back/Forward. Touch testing includes swipe start outside the owned art surface, cancellation, a second pointer, pinch zoom, and orientation changes.
|
|
54
|
+
|
|
55
|
+
The [worked example](../examples/scene-navigation/README.md) has desktop-emulated input evidence and an explicit reading escape. Physical trackpad behavior, browser chrome resizing on a phone, iOS Safari, Android, and assistive technology need separate actual-device runs. Never relabel CDP touch injection or a 375-pixel viewport as physical-device verification.
|
|
56
|
+
|
|
57
|
+
## Example Record
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
concern: keyboard-traversal
|
|
61
|
+
source_guide: platform-guides/windows-interaction.md
|
|
62
|
+
target: # actual browser, OS, widget semantics and versions
|
|
63
|
+
decision: # the target interaction contract
|
|
64
|
+
fallback: # complete visible operation path
|
|
65
|
+
source_rechecked: # date and exact official locator
|
|
66
|
+
actual_result: not_run
|
|
67
|
+
limitations: # untested inputs, runtimes, and capabilities
|
|
68
|
+
consumer_reference: not_applicable
|
|
69
|
+
consumer_reference_reason: This blank comparison selects no consumer record.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Opinionated Guidance
|
|
73
|
+
|
|
74
|
+
Test fallback paths deliberately rather than waiting for accidental unsupported hardware. A successful fallback should preserve the task, though its presentation may differ.
|
|
75
|
+
|
|
76
|
+
## Platform-Specific Guidance
|
|
77
|
+
|
|
78
|
+
Apple, Android, and Windows guide pages own their dated official-source sets. Recheck them for native claims and separately verify the target runtime. Game-engine adaptation routes to [Game UI](../game-ui/index.md).
|
|
79
|
+
|
|
80
|
+
## Unsupported Absolutes
|
|
81
|
+
|
|
82
|
+
No row claims visual, semantic, accessibility, or performance equivalence between platforms. No generic “mobile” or “desktop” label replaces the actual runtime/input matrix.
|
|
83
|
+
|
|
84
|
+
## Verification Contract
|
|
85
|
+
|
|
86
|
+
An adaptation is reviewable when each selected row has a target decision, fallback, observed result, and limitation. Missing capability or runtime evidence stays explicit. Review when a linked source, target capability, or failed user task changes the mapping.
|
|
87
|
+
|
|
88
|
+
The [Interaction Lab verification](../examples/domain-interactions/verification.md) records a macOS browser target for keyboard traversal, modal cancellation, history, content resizing, and reduced-motion preference changes. Small browser viewports are not mobile-device evidence; Android, iOS/iPadOS, Windows-native APIs, haptics, controllers, and assistive technology remain outside that run.
|
|
89
|
+
|
|
90
|
+
## Source, License, And Attribution
|
|
91
|
+
|
|
92
|
+
Locally authored comparison matrix derived from this domain's linked source reviews. Platform owners retain authority over their own conventions; no upstream table is reproduced.
|
|
93
|
+
|
|
94
|
+
## IA Navigation
|
|
95
|
+
|
|
96
|
+
Parent: [Platform Guides](index.md).
|
|
97
|
+
Next: [Platform Adaptation Workflow](adaptation-workflow.md).
|
package/platform-guides/index.md
CHANGED
|
@@ -8,6 +8,17 @@ In scope: comparative vocabulary, interaction questions, current official-source
|
|
|
8
8
|
|
|
9
9
|
Out of scope: affiliation, brand imitation, unsupported platform equivalence, and authority over web standards, accessibility, or Layout contracts.
|
|
10
10
|
|
|
11
|
+
## Start Here
|
|
12
|
+
|
|
13
|
+
| Task | Route |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| Record native facts, target decisions, and fallbacks. | [Platform Adaptation Workflow](adaptation-workflow.md) |
|
|
16
|
+
| Compare Back and adaptive window behavior. | [Android Interaction As A Comparative Reference](android-interaction.md) |
|
|
17
|
+
| Compare keyboard, focus, and commands. | [Windows Interaction As A Comparative Reference](windows-interaction.md) |
|
|
18
|
+
| Select target and fallback verification cases. | [Platform Compatibility Matrix](compatibility-matrix.md) |
|
|
19
|
+
|
|
20
|
+
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.
|
|
21
|
+
|
|
11
22
|
## Available Guides
|
|
12
23
|
|
|
13
24
|
- [Apple Interaction As A Comparative Reference](apple-interaction.md) turns selected interaction themes into questions for web adaptation without claiming platform equivalence.
|
|
@@ -16,11 +27,17 @@ Out of scope: affiliation, brand imitation, unsupported platform equivalence, an
|
|
|
16
27
|
|
|
17
28
|
A platform guide names the platform, source authority, version or review date, web-adaptation boundary, and local verification protocol. Similar appearance or behavior does not establish affiliation or correctness.
|
|
18
29
|
|
|
30
|
+
## Source-Backed Deep Dives
|
|
31
|
+
|
|
32
|
+
- [Adaptive Navigation Across Platforms](adaptive-navigation.md). Preserve task state across window and navigation transformations.
|
|
33
|
+
- [Preferences And Accessibility Across Platforms](preferences-and-accessibility.md). Compare text scaling, contrast, motion, and transparency independently.
|
|
34
|
+
- [Input And Focus Across Platforms](input-and-focus.md). Compare keyboard, pointer, drag alternatives, and focus contracts.
|
|
35
|
+
|
|
19
36
|
## Domain Contract
|
|
20
37
|
|
|
21
|
-
See [StyleGallery Domains](../DOMAINS.md) for lifecycle, provenance, page membership, and
|
|
38
|
+
See [StyleGallery Domains](../DOMAINS.md) for lifecycle, provenance, page membership, and staleness rules.
|
|
22
39
|
|
|
23
40
|
## IA Navigation
|
|
24
41
|
|
|
25
42
|
Parent: [StyleGallery](../index.md).
|
|
26
|
-
Next: [
|
|
43
|
+
Next: [Platform Adaptation Workflow](adaptation-workflow.md).
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Domain Guide
|
|
3
|
+
title: Input And Focus Across Platforms
|
|
4
|
+
description: Compare keyboard, pointing, dragging, focus, and target conventions using named native and web contracts.
|
|
5
|
+
domain: platform-guides
|
|
6
|
+
lifecycle: experimental
|
|
7
|
+
provenance_kind: local
|
|
8
|
+
platform: Apple applications, Android Compose, Windows applications, and web adaptations
|
|
9
|
+
platform_version: dated official documentation; consumer OS, input device, and browser versions required
|
|
10
|
+
reviewed_on: 2026-09-21
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Input And Focus Across Platforms
|
|
14
|
+
|
|
15
|
+
Primary role: comparative input and focus guide.
|
|
16
|
+
|
|
17
|
+
## Repository Boundary
|
|
18
|
+
|
|
19
|
+
This page compares platform interaction contracts. It does not make one platform's shortcuts, target dimensions, or focus model universal. Layout owns logical spatial order; Design Engineering owns the [component behavior](../design-engineering/native-interaction-contracts.md); shared quality owns accessibility evidence.
|
|
20
|
+
|
|
21
|
+
## Reusable Method
|
|
22
|
+
|
|
23
|
+
For each task, identify the action, focused or selected object, available input paths, and owner of cancellation. Distinguish moving focus, moving selection, changing a value, and invoking a command. Then compare the target platform's expected behavior with the proposed adaptation.
|
|
24
|
+
|
|
25
|
+
### Platform And Web Sources
|
|
26
|
+
|
|
27
|
+
| Source | Bounded finding | Adaptation question |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| [Apple HIG keyboards](https://developer.apple.com/design/human-interface-guidelines/keyboards) | Keyboard guidance includes text entry and discoverable, platform-appropriate shortcuts. | Which commands remain discoverable without knowing a shortcut? |
|
|
30
|
+
| [Apple HIG pointing devices](https://developer.apple.com/design/human-interface-guidelines/pointing-devices) | Pointer interaction is a named platform concern alongside other input. | Does pointer feedback preserve the same task as touch or keyboard input? |
|
|
31
|
+
| [Android Compose keyboard actions](https://developer.android.com/develop/ui/compose/touch-input/keyboard-input/commands) | Editing components have default key behavior; key handlers can consume or propagate events. | Does a parent handler steal a key from an editor or child control? |
|
|
32
|
+
| [Windows keyboard interactions](https://learn.microsoft.com/en-us/windows/apps/develop/input/keyboard-interactions) | The guidance distinguishes navigation, commands, and visible focus for keyboard use. | Are command invocation and focus navigation separate and predictable? |
|
|
33
|
+
| [APG keyboard interface](https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/) | Composite widgets have internal navigation conventions; focus and selection are distinct. | Is the chosen widget model actually implemented, including entry and exit? |
|
|
34
|
+
| [Pointer Events Level 3](https://www.w3.org/TR/pointerevents3/) | Pointer events model multiple pointing inputs, capture, and cancellation. | Does cancellation leave a coherent drag state and release ownership? |
|
|
35
|
+
|
|
36
|
+
Read on 2026-09-21. Apple source bodies were inspected through the official documentation JSON. APG is informative guidance; Pointer Events is a standards-track source. Actual input behavior requires a named OS/browser/device combination.
|
|
37
|
+
|
|
38
|
+
### Web Accessibility Conditions To Keep Separate
|
|
39
|
+
|
|
40
|
+
| Source | Bounded condition | Local probe |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| [Keyboard, SC 2.1.1](https://www.w3.org/WAI/WCAG22/Understanding/keyboard.html) | Functionality needs keyboard operability, with the criterion's scoped exception. | Complete the task without a pointing device. |
|
|
43
|
+
| [Dragging Movements, SC 2.5.7](https://www.w3.org/WAI/WCAG22/Understanding/dragging-movements.html) | Dragging functionality needs a single-pointer alternative without dragging, subject to exceptions. | Try a click/tap alternative as well as keyboard operation. |
|
|
44
|
+
| [Target Size Minimum, SC 2.5.8](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html) | The AA criterion specifies 24 by 24 CSS pixels or its stated exceptions, including a defined spacing alternative. | Evaluate the actual hit region and nearby targets, not only the icon. |
|
|
45
|
+
| [Hover Or Focus Content, SC 1.4.13](https://www.w3.org/WAI/WCAG22/Understanding/content-on-hover-or-focus.html) | Additional content has dismissibility, hoverability, and persistence conditions with scoped exceptions. | Move onto the revealed content and dismiss it without losing the task. |
|
|
46
|
+
| [Focus Order, SC 2.4.3](https://www.w3.org/WAI/WCAG22/Understanding/focus-order.html) | Sequential focus order must preserve meaning and operation where order matters. | Follow focus through the actual rendered structure. |
|
|
47
|
+
| [Focus Not Obscured Minimum, SC 2.4.11](https://www.w3.org/WAI/WCAG22/Understanding/focus-not-obscured-minimum.html) | At AA, an author-created surface must not entirely hide the focused component. | Open sticky and overlay surfaces while moving focus. |
|
|
48
|
+
|
|
49
|
+
These Understanding documents explain normative WCAG requirements. The minimum target criterion is not a universal product target size; native units and platform recommendations need their own rationale. Keyboard access and a no-drag single-pointer alternative answer different conditions.
|
|
50
|
+
|
|
51
|
+
### Worked Adaptation: Reorder An Item
|
|
52
|
+
|
|
53
|
+
The product offers a drag handle and chooses a Move action with explicit destinations as its alternative. All paths call the same reorder operation with stable item identity. Focus stays on the moved item or on a documented successor, and the result is exposed without relying solely on movement.
|
|
54
|
+
|
|
55
|
+
| Path | Ownership decision | Failure to catch |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| Pointer drag | Capture, drop eligibility, and cancelled-drag outcome | A cancelled pointer stream leaves the item detached. |
|
|
58
|
+
| Click/tap Move | Destination choice and confirmation | The alternative still requires a hidden drag gesture. |
|
|
59
|
+
| Keyboard | Widget navigation and command activation | Arrow keys move the page and item simultaneously. |
|
|
60
|
+
| Assistive technology | Name, action, current position, and resulting state | The visual reorder is absent from the semantic order. |
|
|
61
|
+
|
|
62
|
+
This is a local proposal. It does not prescribe one keyboard shortcut or say that every list must be a composite ARIA widget.
|
|
63
|
+
|
|
64
|
+
## Opinionated Guidance
|
|
65
|
+
|
|
66
|
+
Use shortcuts to accelerate visible actions. Scope listeners to the intended surface, and let text editing and composition retain their own keys. Give each cancellation action one clearly documented owner before allowing it to propagate outward.
|
|
67
|
+
|
|
68
|
+
## Platform-Specific Guidance
|
|
69
|
+
|
|
70
|
+
Primary pointer and hover media features describe capabilities, not an exclusive device category; hybrid input requires an actual interaction matrix. System/browser shortcuts and assistive-technology commands may already own a key combination. Record the platform conflict check instead of translating Control to Command mechanically.
|
|
71
|
+
|
|
72
|
+
For IME-sensitive keys, follow [Text Input And Internationalization](../design-engineering/text-input-and-internationalization.md). For drag presentation after cancellation, follow [Interruption And Retargeting](../motion/interruption-and-retargeting.md).
|
|
73
|
+
|
|
74
|
+
## Unsupported Absolutes
|
|
75
|
+
|
|
76
|
+
Keyboard support alone does not satisfy the no-drag pointer condition. Visible focus does not prove focus order. A large icon does not prove a large hit region. A touch-capable device does not imply that hover or keyboard input is absent.
|
|
77
|
+
|
|
78
|
+
## Verification Contract
|
|
79
|
+
|
|
80
|
+
Use actual task sequences with keyboard, pointer, touch where supported, and relevant assistive technology. Record input mode changes mid-task, cancelled drag, focus after item removal, nested Escape, hover-to-content movement, and overlays covering the focus target.
|
|
81
|
+
|
|
82
|
+
These cases are unexecuted. Synthetic events can validate handlers but do not establish physical input or assistive-technology integration. Re-review when command scope, component roles, or target input support changes.
|
|
83
|
+
|
|
84
|
+
## Source, License, And Attribution
|
|
85
|
+
|
|
86
|
+
Locally authored synthesis of the linked first-party sources, inspected 2026-09-21. No native interaction artwork, source examples, or code are copied. `consumer_reference: not_applicable` because no consumer input record is selected.
|
|
87
|
+
|
|
88
|
+
## IA Navigation
|
|
89
|
+
|
|
90
|
+
Parent: [Platform Guides](index.md).
|
|
91
|
+
Next: [Platform Compatibility Matrix](compatibility-matrix.md).
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Domain Guide
|
|
3
|
+
title: Preferences And Accessibility Across Platforms
|
|
4
|
+
description: Compare text scaling, motion, contrast, transparency, and accessibility semantics without collapsing distinct user preferences.
|
|
5
|
+
domain: platform-guides
|
|
6
|
+
lifecycle: experimental
|
|
7
|
+
provenance_kind: local
|
|
8
|
+
platform: Apple applications, Android Compose, Windows applications, and web adaptations
|
|
9
|
+
platform_version: dated official documentation; consumer OS, framework, and browser versions required
|
|
10
|
+
reviewed_on: 2026-09-21
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Preferences And Accessibility Across Platforms
|
|
14
|
+
|
|
15
|
+
Primary role: comparative preference and accessibility adaptation guide.
|
|
16
|
+
|
|
17
|
+
## Repository Boundary
|
|
18
|
+
|
|
19
|
+
This guide compares what named platforms expose and the questions a consumer must answer. Shared [accessibility evidence](../quality/evidence/accessibility.md) governs conformance. Product color, typography, transparency, and motion remain consumer-owned; this page supplies no visual defaults to Layout.
|
|
20
|
+
|
|
21
|
+
## Reusable Method
|
|
22
|
+
|
|
23
|
+
Inventory each preference as a separate input. Name its source, application override policy, affected components, and update behavior. Specify a usable base presentation for targets that do not expose a particular signal. Then test meaningful combinations rather than treating “accessibility mode” as one boolean.
|
|
24
|
+
|
|
25
|
+
### Source Findings
|
|
26
|
+
|
|
27
|
+
| Source | Bounded finding | Transfer boundary |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| [Apple HIG accessibility](https://developer.apple.com/design/human-interface-guidelines/accessibility) | The guidance addresses larger text, VoiceOver descriptions, multiple information channels, and response to Reduce Motion. | Native support depends on the implementation; a web font choice does not implement Dynamic Type. |
|
|
30
|
+
| [Apple HIG materials](https://developer.apple.com/design/human-interface-guidelines/materials) | Material behavior can respond to appearance and accessibility settings, including transparency and contrast. | A CSS blur copied from a screenshot does not inherit native material behavior. |
|
|
31
|
+
| [Android Compose accessibility](https://developer.android.com/develop/ui/compose/accessibility) | Compose exposes semantics and accessibility support that custom components must preserve. | A drawn label is not by itself an accessibility semantic node. |
|
|
32
|
+
| [Windows contrast themes](https://learn.microsoft.com/en-us/windows/apps/design/accessibility/high-contrast-themes) | Contrast themes use system color roles and can change while an app runs. | A single hard-coded dark palette is not the Windows contrast-theme contract. |
|
|
33
|
+
| [Media Queries Level 5](https://www.w3.org/TR/mediaqueries-5/#mf-user-preferences) | Color scheme, reduced motion, contrast, and reduced transparency are separate preference features. | Support must be checked per feature and target; one query does not imply another. |
|
|
34
|
+
| [CSS Color Adjustment](https://www.w3.org/TR/css-color-adjust-1/#forced-colors-mode) | Forced colors can replace author colors with a user-selected palette and adjust effects. | Preserve meaningful distinctions when author decoration changes or disappears. |
|
|
35
|
+
|
|
36
|
+
Read on 2026-09-21. Apple documentation bodies were inspected through the official documentation JSON. These living platform pages and standards-track publications are dated readings, not proof that all named features exist in a selected OS/browser release.
|
|
37
|
+
|
|
38
|
+
### Preference Resolution
|
|
39
|
+
|
|
40
|
+
Record “follow system” separately from an explicit in-product selection. Define which setting currently determines the presentation and how users return to system behavior. Do not use one persisted theme name to infer motion, contrast, or text-size preferences.
|
|
41
|
+
|
|
42
|
+
For web forced colors, verify semantic system-color pairings and visible boundaries rather than preserving brand appearance at any cost. Any local exception to automatic color adjustment needs a stated reason and target evidence. For reduced transparency without a supported media feature, the base surface still needs to make its content legible.
|
|
43
|
+
|
|
44
|
+
### Text Scaling Is A Behavior Change
|
|
45
|
+
|
|
46
|
+
[Reflow](https://www.w3.org/WAI/WCAG22/Understanding/reflow.html) concerns preserving information and function when content is presented in a narrow equivalent viewport, with scoped exceptions. [Text Spacing](https://www.w3.org/WAI/WCAG22/Understanding/text-spacing.html) concerns loss of content or function when users override specified spacing. Neither criterion means that every interface must have the same default type scale.
|
|
47
|
+
|
|
48
|
+
Local proposal: treat text scaling as a reason to reconsider composition, not merely multiply font sizes. A toolbar can need wrapping or a different command presentation; a dialog may need a scrollable reading area; a short title can become several lines. Those spatial choices go to Layout, while label priorities and command availability stay in the product.
|
|
49
|
+
|
|
50
|
+
### Combination Matrix
|
|
51
|
+
|
|
52
|
+
| Combination | Failure to probe | Observable result to retain |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| Dark appearance with forced colors | The app assumes its dark palette remains authoritative. | Text, selection, links, and focus remain distinguishable. |
|
|
55
|
+
| Larger text with compact window | Fixed control bounds clip names or actions. | Full task remains possible without losing required information. |
|
|
56
|
+
| Reduced motion during pending work | The indicator disappears without an equivalent waiting state. | Pending and completed states remain understandable. |
|
|
57
|
+
| Reduced transparency over rich content | A custom surface depends on blur alone for separation. | Foreground content remains legible with the chosen fallback. |
|
|
58
|
+
| Screen reader with changing result set | Decorative text changes lack meaningful semantics. | The selected task and concise result status are exposed correctly. |
|
|
59
|
+
| Runtime preference change | Only newly mounted components update. | Existing dialogs, portals, and embedded surfaces follow their declared policy. |
|
|
60
|
+
|
|
61
|
+
These are proposed probes, not a statement that all combinations are exposed by every OS. Record unavailable combinations as not applicable with a reason.
|
|
62
|
+
|
|
63
|
+
## Opinionated Guidance
|
|
64
|
+
|
|
65
|
+
Make preference ownership explicit and keep the base experience usable. Avoid adding a single “accessible theme” that quietly overrides unrelated preferences. Use product settings to provide clear user control where platform signals are absent or insufficient.
|
|
66
|
+
|
|
67
|
+
## Platform-Specific Guidance
|
|
68
|
+
|
|
69
|
+
Native text scaling, browser zoom, author font settings, and OS display scaling can affect different layers. Name which mechanism was changed in a test. Likewise, simulated CSS media features establish a code path, while an actual OS setting additionally exercises host integration.
|
|
70
|
+
|
|
71
|
+
Use [Accessible Motion](../motion/accessible-motion.md) for motion replacement and [Typography Semantics](../design-terminology/typography-semantics.md) for source-specific type-style meanings.
|
|
72
|
+
|
|
73
|
+
## Unsupported Absolutes
|
|
74
|
+
|
|
75
|
+
Dark mode is not forced colors. A contrast preference is not a contrast measurement. Removing blur does not guarantee legibility. Passing one text-size case does not prove all localization and scaling combinations.
|
|
76
|
+
|
|
77
|
+
## Verification Contract
|
|
78
|
+
|
|
79
|
+
Record the actual system setting, application override, media/API observation, and effective component state. Test before load and while a dialog or asynchronous operation is active. Compare semantic and visual evidence for the same state; do not substitute an accessibility-tree snapshot for an announcement test.
|
|
80
|
+
|
|
81
|
+
This documentation defines unexecuted cases. It makes no native accessibility or browser conformance claim. Re-review when a source, preference-resolution rule, or target platform changes.
|
|
82
|
+
|
|
83
|
+
## Source, License, And Attribution
|
|
84
|
+
|
|
85
|
+
Locally authored synthesis of the linked first-party sources, inspected 2026-09-21. No platform values or assets are imported. `consumer_reference: not_applicable` because no consumer preference or profile record is selected.
|
|
86
|
+
|
|
87
|
+
## IA Navigation
|
|
88
|
+
|
|
89
|
+
Parent: [Platform Guides](index.md).
|
|
90
|
+
Next: [Input And Focus](input-and-focus.md).
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Domain Guide
|
|
3
|
+
title: Windows Interaction As A Comparative Reference
|
|
4
|
+
description: Source-bounded Windows keyboard, focus, and command guidance with web adaptation cases.
|
|
5
|
+
domain: platform-guides
|
|
6
|
+
lifecycle: experimental
|
|
7
|
+
provenance_kind: local
|
|
8
|
+
platform: Windows applications and WinUI
|
|
9
|
+
platform_version: dated Microsoft Learn documentation; target Windows App SDK version required
|
|
10
|
+
reviewed_on: 2026-09-08
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Windows Interaction As A Comparative Reference
|
|
14
|
+
|
|
15
|
+
Primary role: Windows platform comparison guide.
|
|
16
|
+
|
|
17
|
+
## Repository Boundary
|
|
18
|
+
|
|
19
|
+
This guide compares keyboard and command behavior in Windows application guidance. It supplies no Fluent visual defaults and does not imply that WinUI focus APIs exist in the browser. The consumer records its actual Windows, SDK, browser, and control-library versions.
|
|
20
|
+
|
|
21
|
+
## Reusable Method
|
|
22
|
+
|
|
23
|
+
Start with the [Adaptation Workflow](adaptation-workflow.md). Identify the command, navigation group, and focus scope before choosing a shortcut or implementation API.
|
|
24
|
+
|
|
25
|
+
## Source-Bounded Conventions
|
|
26
|
+
|
|
27
|
+
| Concern | Official source and bounded fact | Transferable question |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| Sequential and inner navigation | [Keyboard interactions](https://learn.microsoft.com/en-us/windows/apps/design/input/keyboard-interactions) distinguishes moving between controls from moving within some composite controls | Is the key moving between tasks, among items, or editing a value? |
|
|
30
|
+
| Initial focus | The same source discusses logical starting focus and avoiding an initially focused destructive action | Does the entry target help the intended task without accidental destructive activation? |
|
|
31
|
+
| Focus movement | [Focus navigation](https://learn.microsoft.com/en-us/windows/apps/develop/input/focus-navigation) documents native focus navigation and control behavior | Can focus reach every required action, and where does it return after dismissal? |
|
|
32
|
+
| Commands | [Keyboard accelerators](https://learn.microsoft.com/en-us/windows/apps/develop/input/keyboard-accelerators) describes command invocation and scoping in Windows applications | Does a shortcut invoke the same command and availability rules as its visible control? |
|
|
33
|
+
|
|
34
|
+
Source set reviewed 2026-09-08. These are platform guidance and API documentation, not evidence that a consumer implements them.
|
|
35
|
+
|
|
36
|
+
## Worked Adaptation: Searchable Command Surface
|
|
37
|
+
|
|
38
|
+
Task: find and invoke commands without a pointer. Begin with the [Command Surface recipe](../recipes/command-surface.md) for spatial composition. Use the correct web widget semantics for the chosen design; a native control's tab-stop policy should not be copied onto unrelated HTML elements.
|
|
39
|
+
|
|
40
|
+
Define the opening control, query input, result navigation, selected command, disabled-command explanation, and dismissal target. Command buttons and shortcuts share one operation owner. Editing text must not accidentally invoke a global command. A shortcut is supplemental: the visible action remains available when that key combination is reserved by the browser or OS.
|
|
41
|
+
|
|
42
|
+
| Test | Expected target behavior |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| Open with keyboard | Focus reaches the declared entry target |
|
|
45
|
+
| Search to zero results | Query remains editable and dismissal remains available |
|
|
46
|
+
| Attempt an unavailable command | No operation; availability is explained consistently |
|
|
47
|
+
| Dismiss after invoker removal | Focus reaches a documented surviving target |
|
|
48
|
+
| Use a reserved/unavailable shortcut | The visible control still performs the task |
|
|
49
|
+
|
|
50
|
+
Actual result: `not_run`. This is a fictional web adaptation contract.
|
|
51
|
+
|
|
52
|
+
## Opinionated Guidance
|
|
53
|
+
|
|
54
|
+
Centralize command availability so menu, button, and shortcut do not disagree. Do not add shortcuts before checking focus, text editing, and the complete visible operation path.
|
|
55
|
+
|
|
56
|
+
## Platform-Specific Guidance
|
|
57
|
+
|
|
58
|
+
WinUI accelerators and focus APIs have native routing rules. Web controls use HTML, the selected ARIA pattern where necessary, browser defaults, and the application's focus scope. See the [shared accessibility evidence gate](../quality/gates/accessibility-evidence.md) for the required evidence boundary.
|
|
59
|
+
|
|
60
|
+
## Unsupported Absolutes
|
|
61
|
+
|
|
62
|
+
Arrow keys are not a replacement for Tab in every UI. A Windows shortcut is not safe to intercept globally in every browser. A working pointer flow does not prove keyboard operation.
|
|
63
|
+
|
|
64
|
+
## Verification Contract
|
|
65
|
+
|
|
66
|
+
Verify entry, traversal, command invocation, text editing, cancellation, disabled state, and focus restoration on every claimed runtime/input. Include a missing invoker and nested surface. Review on Windows SDK, browser, source guidance, or command-routing changes.
|
|
67
|
+
|
|
68
|
+
## Source, License, And Attribution
|
|
69
|
+
|
|
70
|
+
Locally authored synthesis of the official Microsoft sources linked above, rechecked 2026-09-08. No upstream examples, control code, or visual assets are copied. `consumer_reference: not_applicable` because no consumer implementation record is selected.
|
|
71
|
+
|
|
72
|
+
## IA Navigation
|
|
73
|
+
|
|
74
|
+
Parent: [Platform Guides](index.md).
|
|
75
|
+
Next: [Platform Compatibility Matrix](compatibility-matrix.md).
|
package/recipes/homepage.md
CHANGED
|
@@ -37,8 +37,16 @@ Reject this recipe when the page is primarily a document, dashboard, form, comma
|
|
|
37
37
|
|
|
38
38
|
Order sections by the visitor's decision path, not by visual symmetry. Put the primary heading, explanation, proof, and action in semantic order before layout classes. Repeated proof should be a list when each item has the same role.
|
|
39
39
|
|
|
40
|
+
## Scroll Story Composition
|
|
41
|
+
|
|
42
|
+
When a section explains a product through changing visual chapters, compose existing containment, stacking, overlay, and sticky responsibilities before proposing a new spatial pattern. Name the sticky containing block, stage height, document scroll track, offset, release boundary, and long-content fallback. Prevent clipping when copy is taller than the stage.
|
|
43
|
+
|
|
44
|
+
Motion owns continuous progress and scene changes through the [Scroll-driven Story recipe](../motion/interaction-recipes.md#scroll-driven-story). The [Scroll Story Lab](../examples/scroll-story/README.md) demonstrates this composition with two products. Photography, device mockups, transforms, opacity, and timing remain in those consuming examples.
|
|
45
|
+
|
|
40
46
|
## Scroll Ownership
|
|
41
47
|
|
|
48
|
+
A short full-page showcase can compose a viewport shell and [overlay-stack](../patterns/overlay-exception/overlay-stack.md) responsibilities with the [Full-viewport Scene Navigation contract](../motion/interaction-recipes.md#full-viewport-scene-navigation). Declare the document as fixed in scene mode, the chapter copy as the native overflow owner, and the document as the scroll owner in reading mode. The failure to prevent is a clipped or unreachable chapter when the viewport or text size changes. The [worked example](../examples/scene-navigation/README.md) uses a shrinkable stage between header and footer; it introduces no new reusable Layout pattern.
|
|
49
|
+
|
|
42
50
|
Prefer normal document scrolling. Avoid nested scroll regions unless a section has an explicit independent task, such as a horizontally scrolling media reel with named keyboard and overflow behavior.
|
|
43
51
|
|
|
44
52
|
## Accessibility Expectations
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Interface Guide
|
|
3
|
+
title: SG Website Compilation
|
|
4
|
+
description: Run a separately installed website compiler through the SG CLI and MCP server.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SG Website Compilation
|
|
8
|
+
|
|
9
|
+
Primary role: compiler setup and execution reference.
|
|
10
|
+
|
|
11
|
+
Use `sg compile`, `sg timeline`, and the other commands below directly. The `stylegallery-mcp` server exposes the same names alongside `discover`, `resolve`, `claims`, `context`, `ops`, and `retrieve`. Compiler operations can write files, open websites, and invoke a model; each tool declares those effects. The original [v1 knowledge interface](../../consumer-reference/agent-native/README.md) remains available separately.
|
|
12
|
+
|
|
13
|
+
## Setup
|
|
14
|
+
|
|
15
|
+
Install StyleGallery with Node.js 22 or newer using `npm install --global stylegallery`. For an unreleased StyleGallery checkout, run commands from that checkout as `npm run sg -- <command>` instead. If another program already owns the `sg` command, use the equivalent `stylegallery` executable or the npm script. The compiler is a [separate private repository](https://github.com/changeroa/site-compiler); an account with access must install it once:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
gh repo clone changeroa/site-compiler /absolute/path/to/site-compiler
|
|
19
|
+
cd /absolute/path/to/site-compiler
|
|
20
|
+
npm ci --ignore-scripts --no-audit --no-fund
|
|
21
|
+
npx playwright install chromium
|
|
22
|
+
export SG_COMPILER_ROOT=/absolute/path/to/site-compiler
|
|
23
|
+
sg discover --format json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Set `SG_COMPILER_ROOT` in your shell profile for CLI use and in your MCP server environment for MCP use. A CLI invocation can override it with `--compiler-root /absolute/path/to/site-compiler`. `discover` preserves the knowledge response and adds a top-level `compiler` object containing installation status, the actual Git revision, tracked changes, and available operations. Missing compiler setup leaves knowledge queries usable.
|
|
27
|
+
|
|
28
|
+
The verified upstream revision is declared in [scripts/compiler/operations.mjs](operations.mjs). `matches_verified_revision` is true only for that revision without tracked modifications; a mismatch is reported but does not block execution. Use that revision when reproducing the verified workflow. To use a newer upstream version, update your compiler checkout with `git pull --ff-only` and `npm ci`, then inspect `sg discover` and `sg workflow`; SG does not fetch or upgrade code during a tool call. The compiler source, browser binaries, captured frames, and private pack data are not included in the StyleGallery npm package.
|
|
29
|
+
|
|
30
|
+
## CLI
|
|
31
|
+
|
|
32
|
+
Run these from the consumer project's working directory:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
sg workflow
|
|
36
|
+
sg workflow --document readme
|
|
37
|
+
sg compile --url https://example.com --out ./captures/example
|
|
38
|
+
sg timeline --url https://example.com --out ./captures/example --step 500 --grow
|
|
39
|
+
sg transcribe --in ./captures --only example
|
|
40
|
+
sg sale --in ./captures/example --out ./captures/example/sale
|
|
41
|
+
sg gate --in ./captures/example --sale ./captures/example/sale --json ./captures/example/qa-report.json
|
|
42
|
+
sg build --packs ./captures --out ./builds --only example
|
|
43
|
+
sg shots --builds ./builds --slug example
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`compile` captures scenes and frames; it does not produce a SceneBook by itself. A SceneBook describes scene geometry and content; its Timeline companion describes observed scroll behavior. `transcribe` produces these documents. Transcription and the optional sale-preview builder require an installed, authenticated `claude` CLI and can incur model usage. Their input roots contain one subdirectory per pack. Supply `--stylegallery` only when a different SG corpus should be used; the installed StyleGallery package is the default.
|
|
47
|
+
|
|
48
|
+
Read `sg workflow` before selecting stages. Its installed compiler document owns the task policy: faithful reconstruction, adaptation for a new design, or sale-package production. These are task purposes, not CLI flags. Reconstruction uses available source media and direct observation to fill document gaps; the current implementation agent remains the builder. A media record carries source URLs, responsive variants, reuse or replacement decisions, and playback checks separately from the observation document.
|
|
49
|
+
|
|
50
|
+
`sale` replaces observed copy with structural descriptors. `build` consumes only those sale editions and intentionally restricts original-page and external-media access. It is a package preview, not the faithful-reconstruction route. Use sale, build, and release operations when that package purpose is requested. A document-only evaluation is an explicit experiment, not the default website workflow. The SG skill only retrieves this workflow; it does not duplicate these policies.
|
|
51
|
+
|
|
52
|
+
By default, `sale` writes its private audit to `copy-audit.private.json` in the parent of `--out`. Override this with `--audit`; it must remain outside the sale directory. The resolved destination is returned in `result.paths.audit`.
|
|
53
|
+
|
|
54
|
+
| Command | Input and output |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| `compile` | `--url`, `--out`; writes `scenes.json` and `frames/` |
|
|
57
|
+
| `timeline` | `--url`, `--out`; writes `timeline-curve.json` and `dense/` |
|
|
58
|
+
| `transcribe` | `--in` pack root; writes documents and `transcribe.json` |
|
|
59
|
+
| `sale` | `--in`, `--out`; writes sale documents and a private audit outside `out` |
|
|
60
|
+
| `gate` | `--in`; optionally `--sale`, `--json`; returns failure when the upstream gate fails |
|
|
61
|
+
| `build` | `--packs`, `--out`; writes sale-edition previews and `build.json` |
|
|
62
|
+
| `shots` | `--builds`, `--slug`; writes screenshots and a report under each build |
|
|
63
|
+
| `probe` | `--url`; logs scroll geometry; optional `--chrome` |
|
|
64
|
+
| `batch-triage` | `--candidates`, `--out`; captures candidate curves and writes `runs.json` |
|
|
65
|
+
| `triage` | `--in`; writes heuristic rankings |
|
|
66
|
+
| `batch-capture` | `--candidates`, `--out`; captures scenes/timelines and writes `capture.json` |
|
|
67
|
+
| `pack-status` | `--candidates`, `--in`; generates sale editions, runs gates, and updates status |
|
|
68
|
+
| `pack-release` | `--products`; uses the compiler checkout's `out/packs` and `out/builds`, replacing matching files in `out/release` |
|
|
69
|
+
| `workflow` | Reads the installed `SKILL.md`, or `README.md` with `--document readme` |
|
|
70
|
+
|
|
71
|
+
All CLI results are one JSON envelope on stdout, including failures. Child logs are returned in `result.stdout` and `result.stderr`, with a 64 KiB tail per stream and truncation flags. Relative path options resolve from the caller's working directory; upstream scripts execute from the compiler checkout. `pack-release` is the upstream exception with fixed checkout-relative directories, and produces local archives without publishing them.
|
|
72
|
+
|
|
73
|
+
Use `sg discover` or `sg ops` for the full input schemas. CLI options use hyphens (`--max-height`); MCP inputs use underscores (`max_height`). Unknown options, repeated CLI options, missing required paths, and invalid numeric values fail before execution. `--format json` is optional. `--runner-timeout-ms` bounds the entire process tree, defaults to 30 minutes, and accepts up to six hours; `--timeout-ms` on model operations instead controls upstream per-job timeouts. Interrupting the CLI or cancelling an MCP request terminates its running process tree.
|
|
74
|
+
|
|
75
|
+
`ok` reports process success. Batch scripts can exit zero with failed individual jobs: use the returned ledger path to inspect each pack. A gate pass is an upstream consistency check, not SG conformance, accessibility proof, or rights clearance. Each result records the compiler revision, tracked-change status, executed script hash, and normalized arguments. Captures and generated documents remain consumer-owned outputs and are not admitted to the governed material registry.
|
|
76
|
+
|
|
77
|
+
## MCP
|
|
78
|
+
|
|
79
|
+
```json
|
|
80
|
+
{
|
|
81
|
+
"mcpServers": {
|
|
82
|
+
"stylegallery": {
|
|
83
|
+
"command": "npx",
|
|
84
|
+
"args": ["--yes", "--package", "stylegallery", "stylegallery-mcp"],
|
|
85
|
+
"env": { "SG_COMPILER_ROOT": "/absolute/path/to/site-compiler" }
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Call `compile` with `{"url":"https://example.com","out":"/absolute/path/to/captures/example"}` or `gate` with `{"in":"/absolute/path/to/captures/example"}`. Prefer absolute paths because the MCP client's launch directory may differ from your terminal. Long captures require a client request timeout longer than the capture; the runner's timeout does not change client settings. `workflow` and the knowledge tools are read-only; execution tools are marked as potentially destructive and non-idempotent because existing artifacts may be replaced.
|
|
92
|
+
|
|
93
|
+
From the StyleGallery checkout, use `npm run sg -- compile ...` and `npm run sg:mcp` for local development. To connect an MCP client to that unreleased checkout, use `"command": "node"` and `"args": ["/absolute/path/to/StyleGallery/scripts/sg-server.mjs"]` with the same environment settings. The frozen six-tool v1 server is `npm run sg:mcp:v1`, and its CLI is `npm run sg:v1 -- ...`.
|
|
94
|
+
|
|
95
|
+
## Contracts And Verification
|
|
96
|
+
|
|
97
|
+
The adapter follows the handoff fields in [Component Contract](../../design-engineering/component-contract.md): explicit inputs, outputs, process ownership, cancellation, and observable failure. Motion transcription remains governed by [Observed Choreography](../../motion/observed-choreography.md). These are routes into the existing domains; the transport creates no new domain or reusable Layout styling.
|
|
98
|
+
|
|
99
|
+
From the StyleGallery checkout, run `npm run test:compiler` for subprocess, argument, cancellation, JSON, and MCP transport checks. With a compiler installation and Chromium available, run `SG_COMPILER_INTEGRATION_ROOT=/absolute/path/to/site-compiler npm run test:compiler` to also capture a local fixture with the real upstream scripts. Model transcription, model builds, and product release packaging are separate upstream operations and are not exercised by that smoke test.
|
|
100
|
+
|
|
101
|
+
Implementation handoff:
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
Consumer reference: declared
|
|
105
|
+
Consumer reference record: consumer-reference/agent-native/registry.json
|
|
106
|
+
consumer_reference: consumer-reference/agent-native/registry.json
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Navigation
|
|
110
|
+
|
|
111
|
+
Parent: [StyleGallery](../../README.md).
|
|
112
|
+
Next: [Component Contract](../../design-engineering/component-contract.md).
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { runCli } from "../agent-native/cli-adapter.mjs";
|
|
2
|
+
import { compilerOperations, compilerToolDefinitions } from "./operations.mjs";
|
|
3
|
+
import { compilerDiscovery, executeCompiler, failure } from "./runtime.mjs";
|
|
4
|
+
|
|
5
|
+
export function withCompilerDiscovery(report, config = {}) {
|
|
6
|
+
if (!report.ok || !["discover", "ops"].includes(report.operation)) return report;
|
|
7
|
+
return { ...report, compiler: compilerDiscovery(config) };
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export async function runSgCli(argv, config = {}) {
|
|
11
|
+
const args = [...argv];
|
|
12
|
+
const options = { ...config };
|
|
13
|
+
let report;
|
|
14
|
+
const rootIndex = args.indexOf("--compiler-root");
|
|
15
|
+
if (rootIndex >= 0) {
|
|
16
|
+
const root = args[rootIndex + 1];
|
|
17
|
+
if (!root || root.startsWith("--") || args.lastIndexOf("--compiler-root") !== rootIndex) {
|
|
18
|
+
report = failure(null, "argument_invalid", "--compiler-root requires one checkout path.");
|
|
19
|
+
} else { options.compilerRoot = root; args.splice(rootIndex, 2); }
|
|
20
|
+
}
|
|
21
|
+
const command = args[0];
|
|
22
|
+
if (!report && !Object.hasOwn(compilerOperations, command) && command !== "workflow") {
|
|
23
|
+
report = withCompilerDiscovery(runCli(args).report, options);
|
|
24
|
+
} else if (!report) {
|
|
25
|
+
const definition = compilerToolDefinitions().find(({ name }) => name === command);
|
|
26
|
+
const properties = definition.inputSchema.properties;
|
|
27
|
+
const input = {};
|
|
28
|
+
const seen = new Set();
|
|
29
|
+
for (let i = 1; i < args.length; i += 1) {
|
|
30
|
+
const flag = args[i];
|
|
31
|
+
const key = flag.startsWith("--") ? flag.slice(2).replaceAll("-", "_") : "";
|
|
32
|
+
if ((!Object.hasOwn(properties, key) && key !== "format") || seen.has(key)) {
|
|
33
|
+
report = failure(command, "argument_invalid", `Unknown or repeated argument: ${flag}`);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
seen.add(key);
|
|
37
|
+
const type = key === "format" ? "string" : properties[key].type;
|
|
38
|
+
if (type === "boolean") { input[key] = true; continue; }
|
|
39
|
+
const value = args[++i];
|
|
40
|
+
if (value === undefined || value.startsWith("--")) {
|
|
41
|
+
report = failure(command, "argument_value_required", `${flag} requires a value.`);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
if (key === "format") {
|
|
45
|
+
if (value !== "json") { report = failure(command, "format_unsupported", "Only --format json is supported."); break; }
|
|
46
|
+
} else input[key] = ["number", "integer"].includes(type) ? Number(value) : value;
|
|
47
|
+
}
|
|
48
|
+
report ??= await executeCompiler(command, input, options);
|
|
49
|
+
}
|
|
50
|
+
return { report, exitCode: report.ok ? 0 : 1, output: `${JSON.stringify(report, null, 2)}\n` };
|
|
51
|
+
}
|