@punks/cli 3.2.2 → 3.3.0
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/AGENTS.md +1 -1
- package/dist/BASELINE_CHANGELOG.md +43 -0
- package/dist/CHANGELOG.md +24 -0
- package/dist/baseline/scaffold-baseline/baseline.json +5 -5
- package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +4 -1
- package/dist/baseline/scaffold-baseline/data/catalog/packs.json +5 -2
- package/dist/baseline/scaffold-baseline/data/catalog/skills.json +24 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +6 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/LICENSE +21 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/RECIPES.md +333 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/SKILL.md +203 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/animate/UPSTREAM.md +9 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/LICENSE +21 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/SKILL.md +112 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/STANDARDS.md +229 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/frontend/review-animations/UPSTREAM.md +9 -0
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/REFERENCE.md +5 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +8 -6
- package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +12 -7
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +6 -4
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +36 -3
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +18 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/EXAMPLES.md +1 -1
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/REFERENCE.md +4 -3
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/SKILL.md +2 -2
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +6 -6
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +7 -7
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +12 -12
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +9 -9
- package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +10 -10
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/LICENSE +21 -0
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/RECIPES.md +435 -0
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/SKILL.md +255 -0
- package/dist/baseline/scaffold-baseline/skills/frameworks/expo/animate-expo/UPSTREAM.md +9 -0
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +34 -9
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +18 -11
- package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +19 -1
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/AUTHORING-HANDOFF.md +14 -11
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/retain-report.md +9 -2
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +6 -8
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +8 -5
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +29 -14
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +45 -32
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/targets.md +2 -1
- package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +86 -12
- package/dist/baseline/scaffold-baseline.json +5 -5
- package/dist/baseline/scaffold-baseline.tgz +0 -0
- package/dist/data/AGENTS.md +1 -1
- package/dist/index.js +10 -10
- package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +6 -1
- package/dist/skills/agnostic/frontend/animate/LICENSE +21 -0
- package/dist/skills/agnostic/frontend/animate/RECIPES.md +324 -0
- package/dist/skills/agnostic/frontend/animate/SKILL.md +199 -0
- package/dist/skills/agnostic/frontend/animate/UPSTREAM.md +9 -0
- package/dist/skills/agnostic/frontend/review-animations/LICENSE +21 -0
- package/dist/skills/agnostic/frontend/review-animations/SKILL.md +112 -0
- package/dist/skills/agnostic/frontend/review-animations/STANDARDS.md +187 -0
- package/dist/skills/agnostic/frontend/review-animations/UPSTREAM.md +9 -0
- package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +5 -1
- package/dist/skills/agnostic/planning/create-plan/SKILL.md +8 -6
- package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +12 -7
- package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +6 -4
- package/dist/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +33 -3
- package/dist/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +18 -1
- package/dist/skills/agnostic/requirements/write-backlog/EXAMPLES.md +1 -1
- package/dist/skills/agnostic/requirements/write-backlog/REFERENCE.md +4 -3
- package/dist/skills/agnostic/requirements/write-backlog/SKILL.md +2 -2
- package/dist/skills/agnostic/requirements/write-backlog/assets/concepts/backlog-model.md +6 -6
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/azure-devops-create-payload.md +7 -7
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/github-projects-create-payload.md +12 -12
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md +9 -9
- package/dist/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md +10 -10
- package/dist/skills/frameworks/expo/animate-expo/LICENSE +21 -0
- package/dist/skills/frameworks/expo/animate-expo/RECIPES.md +385 -0
- package/dist/skills/frameworks/expo/animate-expo/SKILL.md +255 -0
- package/dist/skills/frameworks/expo/animate-expo/UPSTREAM.md +9 -0
- package/dist/skills/phases/delivery-phase/phases/review.md +34 -9
- package/dist/skills/phases/delivery-phase/phases/router.md +16 -9
- package/dist/skills/phases/delivery-phase/references/phase-handoff.md +19 -1
- package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +14 -11
- package/dist/skills/phases/review-phase/phases/retain-report.md +9 -2
- package/dist/skills/phases/review-phase/phases/return-route.md +6 -8
- package/dist/skills/phases/review-phase/phases/run-review.md +8 -5
- package/dist/skills/phases/review-phase/references/durable-report.md +29 -14
- package/dist/skills/phases/review-phase/references/state-graph.md +18 -5
- package/dist/skills/phases/review-phase/references/targets.md +2 -1
- package/dist/skills/phases/review-phase/scripts/review-contract.mjs +91 -11
- package/package.json +52 -9
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/claude.test.ts +0 -130
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/codex.test.ts +0 -135
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/cursor.test.ts +0 -138
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/adapters/opencode.test.ts +0 -135
- package/dist/baseline/scaffold-baseline/data/scripts/harness-projection/contract.test.ts +0 -875
- package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.lifecycle.test.ts +0 -205
- package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.native.test.ts +0 -2765
- package/dist/baseline/scaffold-baseline/data/scripts/sync-subagents.test.ts +0 -2108
- package/dist/baseline/scaffold-baseline/data/subagents/manifest.test.ts +0 -116
- package/dist/skills/frameworks/nestjs/nestjs-best-practices/.gitignore +0 -29
|
@@ -15,7 +15,7 @@ Official source:
|
|
|
15
15
|
|
|
16
16
|
## Preflight before creation
|
|
17
17
|
|
|
18
|
-
Before creating any item, build the complete in-memory projection. Resolve every dependency target, reject missing targets, self-edges, and cycles, derive and verify
|
|
18
|
+
Before creating any item, build the complete in-memory projection. Resolve every dependency target, reject missing targets, self-edges, and cycles, derive and verify overview milestones only, and prove the configured hierarchy, classification, and dependency representation is representable in Azure DevOps. A failed preflight writes nothing.
|
|
19
19
|
|
|
20
20
|
## Raw request body
|
|
21
21
|
|
|
@@ -126,7 +126,7 @@ Render these sections in `System.Description`; do not substitute a mutable local
|
|
|
126
126
|
|
|
127
127
|
- fog -> root-level work item with `Custom.DevpunksKind = fog`
|
|
128
128
|
- capability module -> `System.AreaPath`
|
|
129
|
-
- execution milestone -> chronological `System.IterationPath`
|
|
129
|
+
- execution milestone -> chronological `System.IterationPath` for overview-level items (`fog` through `epic`), inherited by containing stories when supported
|
|
130
130
|
- grilling -> capability-module-scoped work item with `Custom.DevpunksKind = grilling`
|
|
131
131
|
- research -> capability-module-scoped work item with `Custom.DevpunksKind = research`
|
|
132
132
|
- prototype -> capability-module-scoped work item with `Custom.DevpunksKind = prototype`
|
|
@@ -141,15 +141,15 @@ Do not encode execution waves in Area Path. One area can span multiple iteration
|
|
|
141
141
|
|
|
142
142
|
## Chronological execution milestones
|
|
143
143
|
|
|
144
|
-
Use `/fields/System.IterationPath` for chronological `M1`, `M2`, and later
|
|
144
|
+
Use `/fields/System.IterationPath` for chronological `M1`, `M2`, and later project-overview waves only when the project has matching iteration nodes. Apply it to `fog`, `grilling`, `research`, `prototype`, and `epic` items, and let containing stories inherit the same path when supported. Never derive distinct story iterations; native Predecessor links explain story ordering:
|
|
145
145
|
|
|
146
146
|
1. In memory, resolve the complete selected graph and reject missing targets, self-edges, or cycles.
|
|
147
|
-
2.
|
|
148
|
-
3. Verify every predecessor is
|
|
147
|
+
2. Keep one containing overview Iteration Path across each projected story set when supported; use native Predecessor links for story ordering.
|
|
148
|
+
3. Verify every predecessor target is present and that Azure DevOps can represent the complete hierarchy and graph.
|
|
149
149
|
4. Only after preflight passes, create work items, map planned keys to provider ids, and add each blocker with `System.LinkTypes.Dependency-Reverse`.
|
|
150
|
-
5. Create or resolve the verified iteration nodes and patch `/fields/System.IterationPath` on
|
|
150
|
+
5. Create or resolve the verified overview iteration nodes and patch `/fields/System.IterationPath` on selected overview-level items, propagating the same path to containing stories when supported.
|
|
151
151
|
|
|
152
|
-
Capability Area Path, parent/child hierarchy, and current Iteration Path never create dependency edges.
|
|
152
|
+
Capability Area Path, parent/child hierarchy, and current Iteration Path never create dependency edges. Keep story ordering in Predecessor relations; do not use Iteration Path to encode it.
|
|
153
153
|
|
|
154
154
|
Apply the derived iteration with a follow-up JSON Patch operation:
|
|
155
155
|
|
|
@@ -11,7 +11,7 @@ Official sources:
|
|
|
11
11
|
|
|
12
12
|
## Preflight before creation
|
|
13
13
|
|
|
14
|
-
Before creating any item, build the complete in-memory projection. Resolve every dependency target, reject missing targets, self-edges, and cycles, derive and verify
|
|
14
|
+
Before creating any item, build the complete in-memory projection. Resolve every dependency target, reject missing targets, self-edges, and cycles, derive and verify overview milestones only, and prove the configured hierarchy, classification, and dependency representation is representable in GitHub. A failed preflight writes nothing.
|
|
15
15
|
|
|
16
16
|
## Intent
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ Use GitHub Projects V2 and GitHub Issues together.
|
|
|
20
20
|
Canonical mapping:
|
|
21
21
|
|
|
22
22
|
- capability module -> Project V2 custom single-select field
|
|
23
|
-
- execution milestone -> chronological repository milestone
|
|
23
|
+
- execution milestone -> chronological repository milestone for overview-level items (`fog` through `epic`), inherited by containing stories when supported
|
|
24
24
|
- epic/capability -> parent GitHub issue in the Project
|
|
25
25
|
- story -> child issue/sub-issue in the Project
|
|
26
26
|
- story ordering -> native issue dependency
|
|
@@ -96,23 +96,23 @@ If repository policy permits none of these, fail preflight. Do not create classi
|
|
|
96
96
|
|
|
97
97
|
Store durable capability membership in a Project V2 custom single-select field named `Capability module`. This field answers which product capability owns the item. It is independent from repository milestones, parent/sub-issue hierarchy, and dependency order.
|
|
98
98
|
|
|
99
|
-
Fog leaves `Capability module` empty until sharpening selects a module. Every selected concrete non-fog issue receives exactly one capability-module value. A module can contain
|
|
99
|
+
Fog leaves `Capability module` empty until sharpening selects a module. Every selected concrete non-fog issue receives exactly one capability-module value. A module can contain overview items from multiple execution milestones; containing stories may share their epic's milestone.
|
|
100
100
|
|
|
101
101
|
## Chronological execution milestones
|
|
102
102
|
|
|
103
|
-
Use repository milestones named `M1`, `M2`, and so on only for
|
|
103
|
+
Use repository milestones named `M1`, `M2`, and so on only for overview-level `fog`, `grilling`, `research`, `prototype`, and `epic` items. Stories may inherit their containing epic's milestone when supported, but never receive distinct story milestones; do not create one repository milestone per capability module.
|
|
104
104
|
|
|
105
105
|
1. In memory, resolve the complete selected graph and reject missing targets, self-edges, or cycles.
|
|
106
|
-
2.
|
|
107
|
-
3. Verify every blocker
|
|
106
|
+
2. Keep one containing overview milestone across each projected story set when supported; use native issue dependencies for story ordering.
|
|
107
|
+
3. Verify every blocker target is present and that GitHub can represent the complete hierarchy and graph.
|
|
108
108
|
4. Only after preflight passes, create issues, map planned keys to provider ids, add every native blocker with `addBlockedBy`, and create or reuse milestones.
|
|
109
|
-
5. Assign
|
|
109
|
+
5. Assign at most one verified milestone to each selected overview-level item and propagate that same membership to its stories when supported; never derive story-specific milestones.
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
Overview items from different capability modules can share one milestone. Containing stories may share that milestone, but parent/sub-issue hierarchy and milestone assignment never determine story chronology; update native dependencies when story relations change.
|
|
112
112
|
|
|
113
113
|
## Create missing execution milestones
|
|
114
114
|
|
|
115
|
-
Create only the chronological repository milestones derived above.
|
|
115
|
+
Create only the chronological repository milestones derived above for overview-level items; propagate membership to containing stories when supported without deriving story-specific milestones.
|
|
116
116
|
|
|
117
117
|
Endpoint:
|
|
118
118
|
|
|
@@ -139,8 +139,8 @@ Required field:
|
|
|
139
139
|
|
|
140
140
|
- `title`
|
|
141
141
|
|
|
142
|
-
For GraphQL milestone assignment
|
|
143
|
-
For REST milestone assignment
|
|
142
|
+
For GraphQL overview-item milestone assignment, use the returned milestone node ID as `milestoneId`.
|
|
143
|
+
For REST overview-item milestone assignment, use the returned milestone number as `milestone`.
|
|
144
144
|
|
|
145
145
|
## Create a fog issue
|
|
146
146
|
|
|
@@ -299,4 +299,4 @@ mutation AddBlockedBy($issueId: ID!, $blockingIssueId: ID!) {
|
|
|
299
299
|
|
|
300
300
|
- GitHub REST issue creation is still acceptable for plain issue creation, but GraphQL is preferred for backlog sync because it can attach Project V2 IDs, parent issues, and dependency relations.
|
|
301
301
|
- Project fields store capability grouping metadata. Issue hierarchy remains the source for epic -> story.
|
|
302
|
-
- Repository milestones store
|
|
302
|
+
- Repository milestones store project-overview chronology only; native issue dependencies store story relations.
|
package/dist/skills/agnostic/requirements/write-backlog/assets/providers/linear-create-payload.md
CHANGED
|
@@ -14,7 +14,7 @@ Official sources:
|
|
|
14
14
|
|
|
15
15
|
## Preflight before creation
|
|
16
16
|
|
|
17
|
-
Before creating any item, build the complete in-memory projection. Resolve every dependency target, reject missing targets, self-edges, and cycles, derive and verify
|
|
17
|
+
Before creating any item, build the complete in-memory projection. Resolve every dependency target, reject missing targets, self-edges, and cycles, derive and verify overview milestones only, and prove the configured hierarchy, classification, and dependency representation is representable in Linear. A failed preflight writes nothing.
|
|
18
18
|
|
|
19
19
|
## Minimum documented mutation
|
|
20
20
|
|
|
@@ -101,7 +101,7 @@ If workspace policy permits none of these, fail preflight. Do not create labels
|
|
|
101
101
|
|
|
102
102
|
- fog -> root-level issue with `Kind/fog`; no parent or capability module required until sharpened
|
|
103
103
|
- capability module -> non-milestone capability metadata, such as a dedicated module label
|
|
104
|
-
- execution milestone -> chronological Linear project milestone
|
|
104
|
+
- execution milestone -> chronological Linear project milestone for overview-level items (`fog` through `epic`), inherited by containing stories when supported
|
|
105
105
|
- grilling -> capability-module-scoped issue with `Kind/grilling`
|
|
106
106
|
- research -> capability-module-scoped issue with `Kind/research`
|
|
107
107
|
- prototype -> capability-module-scoped issue with `Kind/prototype`
|
|
@@ -134,17 +134,17 @@ Use these headings in `description`; do not substitute a mutable local spec path
|
|
|
134
134
|
|
|
135
135
|
## Chronological execution milestones
|
|
136
136
|
|
|
137
|
-
Linear project milestones answer first/next/later. Name them chronologically, such as `M1`, `M2`, and `M3`, and derive
|
|
137
|
+
Linear project milestones answer first/next/later at the project overview level. Name them chronologically, such as `M1`, `M2`, and `M3`, and derive them only for `fog`, `grilling`, `research`, `prototype`, and `epic` issues. When supported, stories inherit their containing overview milestone as one shared membership value; native `blockedBy` / `blocks` relations explain story order.
|
|
138
138
|
|
|
139
|
-
|
|
139
|
+
The overview-level taxonomy from `fog` through `epic` is milestone-eligible: `fog`, `grilling`, `research`, `prototype`, and `epic`. Stories never receive distinct derived milestones; when supported, they share the containing overview milestone. Capability-module metadata remains grouping and is not an execution relation.
|
|
140
140
|
|
|
141
141
|
1. In memory, resolve the complete selected graph and reject missing targets, self-edges, or cycles.
|
|
142
|
-
2.
|
|
143
|
-
3. Verify every blocker is
|
|
144
|
-
4. Only after preflight passes, create issues, map planned keys to provider ids, create native blocker relations, and create or reuse the derived milestones.
|
|
145
|
-
5. Assign
|
|
142
|
+
2. Keep one containing overview milestone across each projected story set when supported; use native blocker relations for story ordering.
|
|
143
|
+
3. Verify every blocker target is present and that the configured Linear representation supports the full graph.
|
|
144
|
+
4. Only after preflight passes, create issues, map planned keys to provider ids, create native blocker relations, and create or reuse the derived overview milestones.
|
|
145
|
+
5. Assign at most one verified milestone to each selected overview-level item and propagate that same membership to its stories when supported; never derive story-specific milestones.
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
Overview items in the same wave share a milestone. Containing stories may share that milestone, but capability grouping, parent/child hierarchy, and milestone assignment never determine story chronology. Native blocker relations remain authoritative for stories; recompute blockers when story relations change.
|
|
148
148
|
|
|
149
149
|
## Notes
|
|
150
150
|
|
package/dist/skills/agnostic/requirements/write-backlog/assets/providers/monday-create-payload.md
CHANGED
|
@@ -7,7 +7,7 @@ Connector source:
|
|
|
7
7
|
|
|
8
8
|
## Preflight before creation
|
|
9
9
|
|
|
10
|
-
Before creating any item, build the complete in-memory projection. Resolve every dependency target, reject missing targets, self-edges, and cycles, derive and verify
|
|
10
|
+
Before creating any item, build the complete in-memory projection. Resolve every dependency target, reject missing targets, self-edges, and cycles, derive and verify overview milestones only, and prove the configured hierarchy, classification, and dependency representation is representable in monday.com. A failed preflight writes nothing.
|
|
11
11
|
|
|
12
12
|
## Intent
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ Canonical mapping:
|
|
|
17
17
|
|
|
18
18
|
- fog -> first-class root/backlog item
|
|
19
19
|
- capability module -> board group
|
|
20
|
-
- execution milestone -> dedicated Status or Dropdown column
|
|
20
|
+
- execution milestone -> dedicated Status or Dropdown column for overview-level items (`fog` through `epic`), inherited by containing stories when supported
|
|
21
21
|
- grilling/research/prototype -> parent item in a capability group
|
|
22
22
|
- epic/capability -> parent item
|
|
23
23
|
- story -> subitem under the epic item
|
|
@@ -41,7 +41,7 @@ Expected board shape, subject to explicit board configuration:
|
|
|
41
41
|
- one board group per capability module
|
|
42
42
|
- parent items for epics/capabilities
|
|
43
43
|
- subitems for stories
|
|
44
|
-
- dedicated Status or Dropdown column named `Execution milestone` with `M1`, `M2`, and later
|
|
44
|
+
- dedicated Status or Dropdown column named `Execution milestone` with `M1`, `M2`, and later overview values
|
|
45
45
|
- dependency column wherever selected work has blockers
|
|
46
46
|
|
|
47
47
|
If the target group for a capability module is missing, create it before creating concrete items.
|
|
@@ -105,7 +105,7 @@ Closure notes record the answer or verdict, evidence, observations, open decisio
|
|
|
105
105
|
|
|
106
106
|
Use one stable board group per durable capability module. A group answers which product capability owns the item; it does not answer when the item executes.
|
|
107
107
|
|
|
108
|
-
Fog stays in a root/backlog group until sharpening selects a capability module. Do not name capability groups `M1`, `M2`, or other chronological wave names. One capability group can contain items from multiple execution milestones.
|
|
108
|
+
Fog stays in a root/backlog group until sharpening selects a capability module. Do not name capability groups `M1`, `M2`, or other chronological wave names. One capability group can contain overview items from multiple execution milestones; containing stories may share their epic's milestone.
|
|
109
109
|
|
|
110
110
|
## Create a capability-module group
|
|
111
111
|
|
|
@@ -130,16 +130,16 @@ Use stable capability names. Do not create implementation-phase groups such as b
|
|
|
130
130
|
|
|
131
131
|
## Chronological execution milestones
|
|
132
132
|
|
|
133
|
-
Use a separate Status or Dropdown column named `Execution milestone` for `M1`, `M2`, and later
|
|
133
|
+
Use a separate Status or Dropdown column named `Execution milestone` for `M1`, `M2`, and later project-overview waves. Set it on `fog`, `grilling`, `research`, `prototype`, and `epic` items, and propagate the same value to containing stories when supported; never derive story-specific values. The exact column ID comes from board metadata.
|
|
134
134
|
|
|
135
135
|
1. Inspect both parent-item and subitem board metadata.
|
|
136
136
|
2. In memory, resolve the complete selected graph and reject missing targets, self-edges, or cycles.
|
|
137
137
|
3. Prove every edge is representable by monday.com's same-board dependency constraint. If an edge crosses unsupported storage, stop before creation.
|
|
138
|
-
4.
|
|
139
|
-
5. Verify every dependency
|
|
140
|
-
6. Only after preflight passes, create items, map planned keys to provider ids, populate dependencies, and set
|
|
138
|
+
4. Keep one containing overview milestone across each projected story set when supported; use the dependency column for story ordering.
|
|
139
|
+
5. Verify every dependency target is present and that all required configured columns exist.
|
|
140
|
+
6. Only after preflight passes, create items, map planned keys to provider ids, populate dependencies, and set at most one verified milestone value per selected overview-level item, propagating that same value to containing stories when supported.
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
Overview items from different capability groups can share one execution milestone. Containing stories may share that value, but group membership, parent/subitem hierarchy, and current milestone value never create story dependency edges. Update the dependency column when story relations change.
|
|
143
143
|
|
|
144
144
|
## Create an epic item
|
|
145
145
|
|
|
@@ -226,7 +226,7 @@ Tool:
|
|
|
226
226
|
3. Complete the in-memory hierarchy, graph, milestone, and representability preflight.
|
|
227
227
|
4. Only after preflight passes, create required groups, items, and subitems.
|
|
228
228
|
5. Set only explicitly configured classification metadata.
|
|
229
|
-
6. Map planned keys to provider ids, add dependency values, and set already-derived milestones.
|
|
229
|
+
6. Map planned keys to provider ids, add dependency values, and set already-derived overview milestones.
|
|
230
230
|
|
|
231
231
|
## Notes
|
|
232
232
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Emil Kowalski
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
# Expo Animation Recipes
|
|
2
|
+
|
|
3
|
+
Ready-to-build implementations for the cases that come up most in a React Native app. Start from the recipe, then adapt.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Setup the recipes assume
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx expo install react-native-reanimated react-native-worklets react-native-gesture-handler expo-haptics
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
(`react-native-keyboard-controller` only for the keyboard recipe.) `expo install`, not `npm install` — it resolves the versions that match the SDK. The worklets Babel plugin is configured by `babel-preset-expo` automatically.
|
|
14
|
+
|
|
15
|
+
`GestureHandlerRootView` wraps the app once — in Expo Router, the root `_layout`:
|
|
16
|
+
|
|
17
|
+
```jsx
|
|
18
|
+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
19
|
+
|
|
20
|
+
export default function RootLayout() {
|
|
21
|
+
return (
|
|
22
|
+
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
23
|
+
<Stack />
|
|
24
|
+
</GestureHandlerRootView>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Imports and constants every recipe below shares:
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
33
|
+
import Animated, {
|
|
34
|
+
useSharedValue, useAnimatedStyle, useAnimatedScrollHandler, useAnimatedReaction,
|
|
35
|
+
withSpring, withTiming, interpolate, Extrapolation, Easing,
|
|
36
|
+
FadeInDown, FadeOutDown, LinearTransition,
|
|
37
|
+
} from 'react-native-reanimated';
|
|
38
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
39
|
+
import { scheduleOnRN } from 'react-native-worklets';
|
|
40
|
+
import * as Haptics from 'expo-haptics';
|
|
41
|
+
|
|
42
|
+
const EASE_OUT = Easing.bezier(0.23, 1, 0.32, 1); // strong ease-out for UI
|
|
43
|
+
const EASE_IN_OUT = Easing.bezier(0.77, 0, 0.175, 1); // on-screen movement
|
|
44
|
+
const EASE_SHEET = Easing.bezier(0.32, 0.72, 0, 1); // iOS sheet curve
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Three conventions, explained once here instead of in every recipe:
|
|
48
|
+
|
|
49
|
+
- **Shared values are read and written with `.get()` / `.set()`**, the form the Reanimated docs recommend for React Compiler support. `.value` still works, but the compiler can't see through it.
|
|
50
|
+
- **`scheduleOnRN(fn, ...args)` replaces the deprecated `runOnJS(fn)(...args)`** for calling back to the React Native runtime from a worklet.
|
|
51
|
+
- **Gestures are wrapped in `useMemo`.** Rebuilding a gesture on every render can reattach the recognizer and drop a drag that's mid-flight.
|
|
52
|
+
|
|
53
|
+
**Gesture Handler v3:** Expo installs v2, and the recipes use its `Gesture.Pan()` builder. If the project is already on v3, the builder is legacy — each gesture is a hook taking one config object, with `onStart` → `onActivate`, `onEnd` → `onDeactivate`, and the `success` flag replaced by `event.canceled` (inverted). The hook manages its own identity, so drop the `useMemo`:
|
|
54
|
+
|
|
55
|
+
```jsx
|
|
56
|
+
const pan = usePanGesture({
|
|
57
|
+
activeOffsetY: [-10, 10],
|
|
58
|
+
onActivate: () => { context.set(translateY.get()); },
|
|
59
|
+
onUpdate: (e) => { translateY.set(context.get() + e.translationY); },
|
|
60
|
+
onDeactivate: (e) => { /* settle with withSpring as below */ },
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Two worklets you'll need everywhere
|
|
67
|
+
|
|
68
|
+
Momentum projection decides *where a flick was going*, so a fast short swipe commits and a slow long one doesn't. Rubber-banding makes a boundary resist instead of stopping dead.
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
// Where the finger would come to rest if it kept decelerating.
|
|
72
|
+
// Apple's exponential-decay form — not the v²/2a from physics class.
|
|
73
|
+
function project(velocity, decelerationRate = 0.998) {
|
|
74
|
+
'worklet';
|
|
75
|
+
return ((velocity / 1000) * decelerationRate) / (1 - decelerationRate);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// The further past the edge, the less the element follows.
|
|
79
|
+
function rubberband(overshoot, dimension, constant = 0.55) {
|
|
80
|
+
'worklet';
|
|
81
|
+
return (overshoot * dimension * constant) / (dimension + constant * Math.abs(overshoot));
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Press feedback
|
|
88
|
+
|
|
89
|
+
Every pressable in the app. This passes the frequency gate only because it's near-imperceptible: 120ms and a 3% scale is the ceiling for something touched this often — anything longer or larger belongs to rarer moments, per step 1 in SKILL.md. No gesture, no shared value — a CSS transition is the whole implementation.
|
|
90
|
+
|
|
91
|
+
```jsx
|
|
92
|
+
import Animated from 'react-native-reanimated';
|
|
93
|
+
import { Pressable, StyleSheet } from 'react-native';
|
|
94
|
+
|
|
95
|
+
function PressableScale({ onPress, children }) {
|
|
96
|
+
const [pressed, setPressed] = useState(false);
|
|
97
|
+
return (
|
|
98
|
+
<Pressable
|
|
99
|
+
onPress={onPress}
|
|
100
|
+
onPressIn={() => setPressed(true)}
|
|
101
|
+
onPressOut={() => setPressed(false)}
|
|
102
|
+
hitSlop={12}
|
|
103
|
+
pressRetentionOffset={16}
|
|
104
|
+
>
|
|
105
|
+
<Animated.View style={[styles.box, pressed && styles.pressed]}>{children}</Animated.View>
|
|
106
|
+
</Pressable>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const styles = StyleSheet.create({
|
|
111
|
+
box: {
|
|
112
|
+
transform: [{ scale: 1 }],
|
|
113
|
+
transitionProperty: 'transform',
|
|
114
|
+
transitionDuration: '120ms',
|
|
115
|
+
transitionTimingFunction: 'cubic-bezier(0.23, 1, 0.32, 1)',
|
|
116
|
+
},
|
|
117
|
+
pressed: { transform: [{ scale: 0.97 }] },
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`setState` is fine here — it fires twice per press, not per frame. `hitSlop` brings a small icon up to the 44pt target without growing it; `pressRetentionOffset` stops a slight finger drift from cancelling.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Bottom sheet you can drag to dismiss
|
|
126
|
+
|
|
127
|
+
Before writing this: if the sheet is its own destination, use `presentation: 'formSheet'` (see **Screen transitions**) and get the platform's real sheet for free. Build this only when the sheet has to live inside an existing screen.
|
|
128
|
+
|
|
129
|
+
```jsx
|
|
130
|
+
const translateY = useSharedValue(0);
|
|
131
|
+
const context = useSharedValue(0);
|
|
132
|
+
|
|
133
|
+
const pan = useMemo(() => Gesture.Pan()
|
|
134
|
+
.activeOffsetY([-10, 10]) // let a horizontal swipe win; require intent before committing
|
|
135
|
+
.onStart(() => {
|
|
136
|
+
context.set(translateY.get()); // start from the current on-screen value, not from 0
|
|
137
|
+
})
|
|
138
|
+
.onUpdate((e) => {
|
|
139
|
+
const next = context.get() + e.translationY;
|
|
140
|
+
// downward is free; upward past the top resists
|
|
141
|
+
translateY.set(next >= 0 ? next : rubberband(next, HEIGHT));
|
|
142
|
+
})
|
|
143
|
+
.onEnd((e) => {
|
|
144
|
+
const projected = translateY.get() + project(e.velocityY);
|
|
145
|
+
if (projected > HEIGHT * 0.4) {
|
|
146
|
+
translateY.set(withSpring(HEIGHT, {
|
|
147
|
+
duration: 300, dampingRatio: 1, velocity: e.velocityY, overshootClamping: true,
|
|
148
|
+
}, (finished) => { if (finished) scheduleOnRN(onClose); }));
|
|
149
|
+
} else {
|
|
150
|
+
translateY.set(withSpring(0, { duration: 300, dampingRatio: 0.8, velocity: e.velocityY }));
|
|
151
|
+
scheduleOnRN(Haptics.impactAsync, Haptics.ImpactFeedbackStyle.Light); // it snapped home
|
|
152
|
+
}
|
|
153
|
+
}), [onClose]);
|
|
154
|
+
|
|
155
|
+
const sheetStyle = useAnimatedStyle(() => ({ transform: [{ translateY: translateY.get() }] }));
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The four details that separate this from a bad drag:
|
|
159
|
+
|
|
160
|
+
- **`onStart` captures the current value.** Without it, grabbing a sheet mid-animation teleports it — the animation must continue from where the eye last saw it.
|
|
161
|
+
- **Velocity decides, not distance.** `project()` means a quick flick dismisses even a few pixels down. Requiring 40% travel makes the sheet feel heavy.
|
|
162
|
+
- **Velocity is handed to the spring**, so there's no seam between the finger releasing and the animation continuing. This is the single detail that most separates "fluid" from "fine".
|
|
163
|
+
- **`overshootClamping` on dismissal** — otherwise the sheet springs past the bottom of the screen and flashes a gap.
|
|
164
|
+
|
|
165
|
+
The backdrop derives from the same value, so it's always in sync and costs nothing:
|
|
166
|
+
|
|
167
|
+
```jsx
|
|
168
|
+
const backdropStyle = useAnimatedStyle(() => ({
|
|
169
|
+
opacity: interpolate(translateY.get(), [0, HEIGHT], [1, 0], Extrapolation.CLAMP),
|
|
170
|
+
}));
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Swipe to delete a row
|
|
176
|
+
|
|
177
|
+
Before writing this: gesture-handler ships [`ReanimatedSwipeable`](https://docs.swmansion.com/react-native-gesture-handler/docs/components/reanimated_swipeable/), which already does swipe-to-reveal actions — thresholds, overshoot, open/close methods — on the UI thread. Reach for it when the row reveals action buttons. Build the gesture yourself only when the interaction is different in kind: swipe-to-commit with momentum projection, like this one.
|
|
178
|
+
|
|
179
|
+
```jsx
|
|
180
|
+
const x = useSharedValue(0);
|
|
181
|
+
const context = useSharedValue(0);
|
|
182
|
+
|
|
183
|
+
const pan = useMemo(() => Gesture.Pan()
|
|
184
|
+
.activeOffsetX([-10, 10]) // must declare the axis, or it fights the vertical scroll
|
|
185
|
+
.onStart(() => { context.set(x.get()); }) // grab mid-spring continues from where the row is, not from 0
|
|
186
|
+
.onUpdate((e) => { x.set(Math.min(0, context.get() + e.translationX)); })
|
|
187
|
+
.onEnd((e) => {
|
|
188
|
+
const projected = x.get() + project(e.velocityX);
|
|
189
|
+
if (projected < -SWIPE_THRESHOLD) {
|
|
190
|
+
x.set(withTiming(-WIDTH, { duration: 200, easing: EASE_OUT }, (f) => {
|
|
191
|
+
if (f) scheduleOnRN(onDelete, id);
|
|
192
|
+
}));
|
|
193
|
+
} else {
|
|
194
|
+
x.set(withSpring(0, { duration: 300, dampingRatio: 1, velocity: e.velocityX }));
|
|
195
|
+
}
|
|
196
|
+
}), [onDelete, id]);
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Closing the gap the deleted row left is the list's job, not the row's:
|
|
200
|
+
|
|
201
|
+
```jsx
|
|
202
|
+
const ROW_CLOSE = LinearTransition.duration(200); // module scope — builders rebuilt in render cost every re-render
|
|
203
|
+
|
|
204
|
+
<Animated.FlatList data={items} itemLayoutAnimation={ROW_CLOSE} ... />
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`activeOffsetX` is the mobile-specific part. A pan handler inside a scroll view with no axis declared will steal vertical scrolls, and the list will feel broken in a way that looks like a scrolling bug rather than a gesture bug.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Collapsing header on scroll
|
|
212
|
+
|
|
213
|
+
```jsx
|
|
214
|
+
const scrollY = useSharedValue(0);
|
|
215
|
+
const onScroll = useAnimatedScrollHandler((e) => { scrollY.set(e.contentOffset.y); });
|
|
216
|
+
|
|
217
|
+
const titleStyle = useAnimatedStyle(() => ({
|
|
218
|
+
opacity: interpolate(scrollY.get(), [0, 60], [1, 0], Extrapolation.CLAMP),
|
|
219
|
+
transform: [{ translateY: interpolate(scrollY.get(), [0, 60], [0, -12], Extrapolation.CLAMP) }],
|
|
220
|
+
}));
|
|
221
|
+
|
|
222
|
+
<Animated.ScrollView onScroll={onScroll} scrollEventThrottle={16}>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**Never animate the header's `height` to collapse it.** That runs a layout pass on the header and everything below it on every scroll frame — the one animation guaranteed to stutter, because it's competing with the scroll itself. Give the container a fixed height and translate the content inside it, clipping with `overflow: 'hidden'`.
|
|
226
|
+
|
|
227
|
+
`Extrapolation.CLAMP` is not optional: without it, scrolling past 60 keeps driving opacity negative and the header reappears inverted at the bottom of a long list.
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## List entrances
|
|
232
|
+
|
|
233
|
+
```jsx
|
|
234
|
+
// The Reanimated docs recommend building layout animations outside components,
|
|
235
|
+
// or in useMemo — an inline chain in JSX rebuilds the builder on every render.
|
|
236
|
+
// A per-index delay can't live at module scope, so the row memoizes its own:
|
|
237
|
+
function Row({ item, index }) {
|
|
238
|
+
const entering = useMemo(() => FadeInDown.duration(250).delay(index * 40), [index]);
|
|
239
|
+
return <Animated.View entering={entering}>{/* ... */}</Animated.View>;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
{items.map((item, i) => <Row key={item.id} item={item} index={i} />)}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Stagger 30–80ms. Longer feels slow, shorter reads as simultaneous.
|
|
246
|
+
|
|
247
|
+
**Never put `entering` on a row inside `FlatList`, `FlashList`, or any virtualized list.** Rows are recycled, so the animation re-fires every time one scrolls back into view — the list appears to flicker while the user scrolls. Animate the list container once on mount, or use `itemLayoutAnimation` for reflow only.
|
|
248
|
+
|
|
249
|
+
Entrance animations are for content the user asked for and is waiting on. A list they scroll past all day should already be there.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Keyboard-synced UI
|
|
254
|
+
|
|
255
|
+
Needs its own module and a one-time provider ([Expo keyboard guide](https://docs.expo.dev/guides/keyboard-handling/)):
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
npx expo install react-native-keyboard-controller
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
```jsx
|
|
262
|
+
import { KeyboardProvider } from 'react-native-keyboard-controller';
|
|
263
|
+
|
|
264
|
+
// Root _layout, next to GestureHandlerRootView — hooks below do nothing without it.
|
|
265
|
+
<KeyboardProvider>
|
|
266
|
+
<Stack />
|
|
267
|
+
</KeyboardProvider>
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
```jsx
|
|
271
|
+
import { useReanimatedKeyboardAnimation } from 'react-native-keyboard-controller';
|
|
272
|
+
|
|
273
|
+
const { height } = useReanimatedKeyboardAnimation(); // 0 → -keyboardHeight, on the UI thread
|
|
274
|
+
const footerStyle = useAnimatedStyle(() => ({ transform: [{ translateY: height.get() }] }));
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Never build this from `Keyboard.addListener` plus a timing animation. The keyboard rides a private system curve, the event arrives on the JS thread after the keyboard has already started moving, and any duration you pick will visibly lag or lead it. The UI must be driven by the keyboard's actual position, frame by frame.
|
|
278
|
+
|
|
279
|
+
---
|
|
280
|
+
|
|
281
|
+
## Tab / segmented indicator
|
|
282
|
+
|
|
283
|
+
Measure once, then animate transforms.
|
|
284
|
+
|
|
285
|
+
```jsx
|
|
286
|
+
const [layouts, setLayouts] = useState({}); // measured with onLayout, not per frame
|
|
287
|
+
const x = useSharedValue(0);
|
|
288
|
+
const w = useSharedValue(0);
|
|
289
|
+
|
|
290
|
+
useEffect(() => {
|
|
291
|
+
const l = layouts[active];
|
|
292
|
+
if (!l) return;
|
|
293
|
+
x.set(withTiming(l.x, { duration: 250, easing: EASE_IN_OUT }));
|
|
294
|
+
w.set(withTiming(l.width, { duration: 250, easing: EASE_IN_OUT }));
|
|
295
|
+
}, [active, layouts]);
|
|
296
|
+
|
|
297
|
+
const pillStyle = useAnimatedStyle(() => ({
|
|
298
|
+
transform: [{ translateX: x.get() }],
|
|
299
|
+
width: w.get(),
|
|
300
|
+
}));
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
This is the sanctioned `width` animation: the pill is absolutely positioned with no children, so nothing else re-lays-out, and its corner radius survives — `scaleX` would smear the corners into ovals.
|
|
304
|
+
|
|
305
|
+
`ease-in-out`, because the pill is moving across the screen rather than entering or leaving it. Fire `Haptics.selectionAsync()` on the press, not when the pill lands.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Screen transitions (Expo Router)
|
|
310
|
+
|
|
311
|
+
Configure the native stack. Never rebuild a screen transition in JS: the native one runs on the platform side, keeps the interactive back gesture, and matches every other app on the device.
|
|
312
|
+
|
|
313
|
+
```jsx
|
|
314
|
+
<Stack screenOptions={{ animation: reduced ? 'fade' : 'default' }}>
|
|
315
|
+
<Stack.Screen name="settings" options={{ animation: 'slide_from_right', animationMatchesGesture: true }} />
|
|
316
|
+
<Stack.Screen name="compose" options={{ presentation: 'modal' }} />
|
|
317
|
+
<Stack.Screen name="filter" options={{
|
|
318
|
+
presentation: 'formSheet',
|
|
319
|
+
sheetAllowedDetents: 'fitToContents',
|
|
320
|
+
sheetGrabberVisible: true,
|
|
321
|
+
}} />
|
|
322
|
+
</Stack>
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
| Navigation | Option |
|
|
326
|
+
| --- | --- |
|
|
327
|
+
| Deeper into a hierarchy | `animation: 'default'` — the platform push, unmodified |
|
|
328
|
+
| A self-contained task the user can abandon | `presentation: 'modal'` |
|
|
329
|
+
| A short interruption: picker, filter, share | `presentation: 'formSheet'` with detents |
|
|
330
|
+
| Between tabs | `animation: 'none'` |
|
|
331
|
+
| Reduced motion | `animation: 'fade'` |
|
|
332
|
+
|
|
333
|
+
`animationMatchesGesture: true` makes the iOS back swipe run your transition in reverse under the finger, instead of the default push. Set it whenever you set a custom `animation`, or dragging back looks like a different app than pushing forward.
|
|
334
|
+
|
|
335
|
+
`formSheet` is native on both platforms, but not the same on both — the [Expo modal docs](https://docs.expo.dev/router/advanced/modals/#form-sheet-presentation) have the full list:
|
|
336
|
+
|
|
337
|
+
- **Android caps detents at three.** A longer `sheetAllowedDetents` array works on iOS and silently truncates on Android — design for three.
|
|
338
|
+
- **`sheetGrabberVisible` is iOS-only.** Android shows no grabber; don't rely on it as the only "this is draggable" affordance.
|
|
339
|
+
- **Android form sheets can't host native headers or nested stacks.** Keep the sheet's content a single screen; if it needs its own navigation, use `presentation: 'modal'` instead.
|
|
340
|
+
- **`fitToContents` needs explicitly sized content.** A `flex: 1` root has no intrinsic height to fit — size the content, or the detent is wrong.
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Toast
|
|
345
|
+
|
|
346
|
+
```jsx
|
|
347
|
+
// Module scope — layout-animation builders live outside the component.
|
|
348
|
+
const TOAST_ENTER = FadeInDown.duration(300).easing(EASE_OUT);
|
|
349
|
+
const TOAST_EXIT = FadeOutDown.duration(250).easing(EASE_OUT);
|
|
350
|
+
|
|
351
|
+
<Animated.View
|
|
352
|
+
entering={TOAST_ENTER}
|
|
353
|
+
exiting={TOAST_EXIT}
|
|
354
|
+
style={{ position: 'absolute', bottom: insets.bottom + 16, left: 16, right: 16 }}
|
|
355
|
+
/>
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
- **The 300ms cap holds here too.** A toast isn't an exception — it's uninvited, so if anything it should be quicker and quieter than motion the user asked for.
|
|
359
|
+
- **It exits the way it entered.** Entering from the bottom and leaving to the side reads as two unrelated elements.
|
|
360
|
+
- **Exit ~20% faster than entry.** The user has finished reading; the arrival deserves the time, the departure doesn't.
|
|
361
|
+
- **Safe area insets, always.** A toast at `bottom: 16` sits under the home indicator on every modern iPhone.
|
|
362
|
+
|
|
363
|
+
If toasts stack and the list reflows, add `itemLayoutAnimation` and expect to tune the opacity against the reflow by eye — there's no formula for that pair. Look at it again the next day.
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Firing something once at a threshold
|
|
368
|
+
|
|
369
|
+
When a crossing point matters — a detent, a snap, a pull-to-refresh arming — don't poll it from JS and don't `scheduleOnRN` every frame.
|
|
370
|
+
|
|
371
|
+
```jsx
|
|
372
|
+
const armed = useSharedValue(false);
|
|
373
|
+
|
|
374
|
+
useAnimatedReaction(
|
|
375
|
+
() => pullDistance.get() > REFRESH_THRESHOLD,
|
|
376
|
+
(isArmed, wasArmed) => {
|
|
377
|
+
if (isArmed !== wasArmed) {
|
|
378
|
+
armed.set(isArmed);
|
|
379
|
+
scheduleOnRN(Haptics.impactAsync, Haptics.ImpactFeedbackStyle.Light);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
);
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
The comparison runs on the UI thread every frame; the JS call happens twice per pull. That's the pattern for every "do something when the animation reaches X".
|