@mmerterden/multi-agent-pipeline 20.37.1 → 20.38.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/CHANGELOG.md +98 -49
- package/README.md +12 -10
- package/README.tr.md +12 -10
- package/docs/adr/0006-skills-core-external-split.md +5 -5
- package/docs/adr/0010-own-code-graph.md +6 -7
- package/docs/adr/0013-lsp-code-intelligence.md +6 -8
- package/docs/adr/0017-change-impact-from-the-graph.md +4 -5
- package/docs/adr/0018-cross-repo-links-not-a-global-graph.md +1 -1
- package/docs/adr/README.md +1 -1
- package/docs/ecosystem.md +53 -41
- package/docs/facts.json +15 -13
- package/docs/features.md +1 -1
- package/install/_dev-only-files.mjs +3 -0
- package/install/_platform-filter.mjs +1 -23
- package/install/catalog-history.json +1 -1
- package/install/claude.mjs +8 -1
- package/install/codex.mjs +0 -2
- package/install/copilot.mjs +0 -2
- package/install/templates/claude-hooks.json +47 -1
- package/manifest.json +429 -311
- package/package.json +5 -2
- package/pipeline/agents/security-auditor.md +58 -6
- package/pipeline/commands/multi-agent/build-optimize/SKILL.md +1 -2
- package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/graph/SKILL.md +12 -3
- package/pipeline/commands/multi-agent/research/SKILL.md +2 -2
- package/pipeline/commands/multi-agent/search/SKILL.md +10 -1
- package/pipeline/commands/multi-agent/security-review/SKILL.md +4 -0
- package/pipeline/commands/multi-agent/setup/SKILL.md +1 -0
- package/pipeline/commands/multi-agent/stack/SKILL.md +8 -0
- package/pipeline/commands/multi-agent/store-ready/SKILL.md +1 -1
- package/pipeline/commands/sim-test.md +34 -1
- package/pipeline/lib/context-budget.mjs +103 -0
- package/pipeline/lib/credential-inventory.sh +2 -3
- package/pipeline/lib/identifier-scan.mjs +145 -0
- package/pipeline/lib/outbound-gate.mjs +28 -1
- package/pipeline/lib/unattended-profile-check.mjs +13 -4
- package/pipeline/multi-agent-refs/analysis/locked.md +1 -1
- package/pipeline/multi-agent-refs/analysis/redesign.md +17 -3
- package/pipeline/multi-agent-refs/analysis-template-corporate.md +8 -4
- package/pipeline/multi-agent-refs/analysis-template.md +7 -5
- package/pipeline/multi-agent-refs/complaint-analysis/phases.md +1 -0
- package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +1 -1
- package/pipeline/multi-agent-refs/features/code-graph.md +25 -0
- package/pipeline/multi-agent-refs/features/design-conformance.md +20 -4
- package/pipeline/multi-agent-refs/features/free-models.md +10 -3
- package/pipeline/multi-agent-refs/features/research.md +4 -3
- package/pipeline/multi-agent-refs/features/security-audit.md +25 -3
- package/pipeline/multi-agent-refs/features/unattended-security.md +20 -0
- package/pipeline/multi-agent-refs/help/en.md +15 -9
- package/pipeline/multi-agent-refs/help/tr.md +15 -9
- package/pipeline/multi-agent-refs/knowledge.md +17 -0
- package/pipeline/multi-agent-refs/outside-the-pipeline.md +9 -0
- package/pipeline/multi-agent-refs/phases/log-format.md +5 -0
- package/pipeline/multi-agent-refs/phases/operations.md +3 -5
- package/pipeline/multi-agent-refs/picker-contract.md +1 -1
- package/pipeline/multi-agent-refs/research/engine.md +2 -1
- package/pipeline/multi-agent-refs/setup/free-models.md +10 -0
- package/pipeline/multi-agent-refs/store-ready/gate-3-policy.md +15 -0
- package/pipeline/multi-agent-refs/web-guide.md +2 -1
- package/pipeline/office/index.html +3 -7
- package/pipeline/office/toolkit.json +1 -1
- package/pipeline/rules/outside-the-pipeline.md +1 -1
- package/pipeline/schemas/learnings-ledger.schema.json +7 -2
- package/pipeline/schemas/prefs.schema.json +16 -3
- package/pipeline/schemas/reviewer-output.schema.json +113 -5
- package/pipeline/schemas/secret-patterns.json +49 -0
- package/pipeline/schemas/security-finding.schema.json +49 -5
- package/pipeline/scripts/_code-graph.mjs +3 -3
- package/pipeline/scripts/_graph-analysis.mjs +51 -0
- package/pipeline/scripts/_memory-policy.mjs +11 -3
- package/pipeline/scripts/_secret-scan.mjs +1 -1
- package/pipeline/scripts/_skill-practices.mjs +178 -0
- package/pipeline/scripts/_stack-routing.mjs +1 -0
- package/pipeline/scripts/autopilot-runner.mjs +8 -3
- package/pipeline/scripts/build-stack-plugins.mjs +8 -44
- package/pipeline/scripts/capture-resume.sh +19 -0
- package/pipeline/scripts/file-context.mjs +306 -70
- package/pipeline/scripts/gen-skills-index.mjs +1 -1
- package/pipeline/scripts/graph-hint.mjs +197 -0
- package/pipeline/scripts/graph-hint.sh +20 -0
- package/pipeline/scripts/graph-query.mjs +306 -11
- package/pipeline/scripts/graph-report.mjs +29 -1
- package/pipeline/scripts/learnings-ledger.mjs +71 -15
- package/pipeline/scripts/note-agent-event.mjs +160 -0
- package/pipeline/scripts/note-agent-event.sh +19 -0
- package/pipeline/scripts/parity-score.mjs +139 -0
- package/pipeline/scripts/pre-commit-check.sh +25 -4
- package/pipeline/scripts/pre-push-check.sh +3 -0
- package/pipeline/scripts/repo-recommend.mjs +321 -0
- package/pipeline/scripts/scan-agent-config.sh +1 -2
- package/pipeline/scripts/security-evidence-gate.mjs +282 -0
- package/pipeline/scripts/unattended_policy.py +3 -2
- package/pipeline/scripts/validate-analysis-doc.mjs +17 -1
- package/pipeline/skills/.skill-manifest.json +72 -68
- package/pipeline/skills/shared/README.md +41 -40
- package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +6 -6
- package/pipeline/skills/shared/core/apple-archive-compliance/references/examples.md +1 -1
- package/pipeline/skills/shared/core/apple-archive-compliance/references/version-history.md +1 -1
- package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +1 -1
- package/pipeline/skills/shared/core/google-play-compliance/references/notes.md +1 -1
- package/pipeline/skills/shared/core/multi-agent/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +0 -1
- package/pipeline/skills/shared/core/multi-agent-complaint-analysis/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +5 -5
- package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +10 -0
- package/pipeline/skills/shared/core/multi-agent-research/SKILL.md +2 -2
- package/pipeline/skills/shared/core/multi-agent-search/SKILL.md +9 -0
- package/pipeline/skills/shared/core/multi-agent-security-review/SKILL.md +3 -2
- package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -0
- package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +8 -0
- package/pipeline/skills/shared/core/multi-agent-store-ready/SKILL.md +4 -3
- package/pipeline/skills/shared/core/multi-agent-test/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-accessibility/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-dark-mode/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-dynamic-type/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-gen/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-screenshots/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-testflight-validation/SKILL.md +2 -2
- package/pipeline/skills/shared/external/accessibility-compliance-accessibility-audit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/agent-introspection-debugging/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/android-architecture/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-architecture/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-build-quality-gates/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-datastore/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-design-tokens-codegen/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/android-jetpack-compose-expert/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/android-mvi-viewmodel/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-performance/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/android-security/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-security/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/api-patterns/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/api-security-best-practices/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/app-store-changelog/SKILL.md +65 -49
- package/pipeline/skills/shared/external/app-store-changelog/evals/evals.json +40 -0
- package/pipeline/skills/shared/external/app-store-changelog/references/release-notes-guidelines.md +64 -34
- package/pipeline/skills/shared/external/app-store-changelog/scripts/collect_release_changes.sh +21 -23
- package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +4 -1
- package/pipeline/skills/shared/external/app-store-review/SKILL.md +6 -0
- package/pipeline/skills/shared/external/architecture/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/backlog/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/ci-cd-pipelines/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/clean-code/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/compose-components/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-components/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/compose-navigation/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-navigation/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/compose-testing/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-testing/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/context-compression/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/core-data/SKILL.md +1 -1
- package/pipeline/skills/shared/external/council/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/css-modern/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/css-modern/references/code-examples.md +5 -0
- package/pipeline/skills/shared/external/database-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/database-patterns/references/orm-examples.md +5 -0
- package/pipeline/skills/shared/external/debugging-strategies/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/docker-expert/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/e2e-testing/SKILL.md +21 -21
- package/pipeline/skills/shared/external/e2e-testing/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/e2e-testing/references/document-fixtures.md +5 -5
- package/pipeline/skills/shared/external/evidence-github/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/evidence-registry/SKILL.md +1 -1
- package/pipeline/skills/shared/external/evidence-registry/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/fastapi-pro/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/firebase/SKILL.md +132 -54
- package/pipeline/skills/shared/external/firebase/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/firebase/references/functions-and-products.md +51 -0
- package/pipeline/skills/shared/external/firebase/references/security-rules.md +59 -0
- package/pipeline/skills/shared/external/fix-review-verdicts/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/free-llm-apis/SKILL.md +70 -0
- package/pipeline/skills/shared/external/free-llm-apis/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/free-llm-apis/references/providers.md +33 -0
- package/pipeline/skills/shared/external/github-actions-templates/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/gradle-kotlin-dsl/SKILL.md +1 -1
- package/pipeline/skills/shared/external/gradle-kotlin-dsl/evals/evals.json +58 -0
- package/pipeline/skills/shared/external/handle-request/SKILL.md +2 -2
- package/pipeline/skills/shared/external/handle-request/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/hig-app-icons/SKILL.md +2 -2
- package/pipeline/skills/shared/external/hig-app-icons/references/icon-workflow.md +1 -1
- package/pipeline/skills/shared/external/hig-components-content/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-components-status/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-components-system/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-inputs/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/hig-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/hig-platforms/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/hig-technologies/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/html-semantic/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/humanizer/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/ios-coding-standard/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/ios-debugger-agent/SKILL.md +91 -52
- package/pipeline/skills/shared/external/ios-debugger-agent/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/ios-design-review/SKILL.md +12 -12
- package/pipeline/skills/shared/external/ios-design-review/references/appearance-matrix.md +16 -16
- package/pipeline/skills/shared/external/ios-design-review/references/checklist.md +1 -1
- package/pipeline/skills/shared/external/ios-iphone-duo/SKILL.md +0 -1
- package/pipeline/skills/shared/external/ios-module-structure/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/ios-security/SKILL.md +1 -1
- package/pipeline/skills/shared/external/ios-security/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/kotlin-coroutines-expert/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/localization-reuse-map/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/macos-menubar-tuist-app/SKILL.md +170 -74
- package/pipeline/skills/shared/external/macos-menubar-tuist-app/evals/evals.json +52 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/SKILL.md +119 -77
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Package.swift +5 -5
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/MyApp.swift +24 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/version.env +2 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/build_icon.sh +46 -39
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/compile_and_run.sh +70 -49
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/launch.sh +24 -17
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/make_appcast.sh +74 -59
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/package_app.sh +201 -170
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +50 -42
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +65 -35
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/version.env +2 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/packaging.md +49 -17
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/release.md +48 -23
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/scaffold.md +74 -44
- package/pipeline/skills/shared/external/monorepo-architect/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +14 -3
- package/pipeline/skills/shared/external/nextjs-app-router/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/nextjs-app-router/references/app-router-examples.md +3 -0
- package/pipeline/skills/shared/external/nodejs-backend-patterns/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/observability-engineer/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/passkit-wallet/SKILL.md +10 -0
- package/pipeline/skills/shared/external/photos-camera-media/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/play-store-review/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/python-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/react-best-practices/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/rest-api-design/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/retrofit-networking/SKILL.md +1 -1
- package/pipeline/skills/shared/external/retrofit-networking/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/room-database/SKILL.md +1 -1
- package/pipeline/skills/shared/external/room-database/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/scenario-gap-analysis/SKILL.md +1 -1
- package/pipeline/skills/shared/external/scenario-gap-analysis/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/search-first/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/security-review/SKILL.md +14 -3
- package/pipeline/skills/shared/external/security-review/evals/evals.json +48 -0
- package/pipeline/skills/shared/external/security-review/references/agentic-systems.md +93 -0
- package/pipeline/skills/shared/external/security-review/references/firebase-rules.md +100 -0
- package/pipeline/skills/shared/external/security-review/references/graphql.md +82 -0
- package/pipeline/skills/shared/external/security-review/references/llm-prompt-injection.md +93 -0
- package/pipeline/skills/shared/external/security-review/references/oauth-oidc.md +100 -0
- package/pipeline/skills/shared/external/security-review/references/owasp-mobile-top10-2024.md +1 -1
- package/pipeline/skills/shared/external/security-review/references/owasp-web-api-top10-2021.md +1 -1
- package/pipeline/skills/shared/external/security-review/references/supabase.md +73 -0
- package/pipeline/skills/shared/external/signal-community/SKILL.md +29 -10
- package/pipeline/skills/shared/external/signal-community/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/skill-creator/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/skill-creator/template.md +1 -3
- package/pipeline/skills/shared/external/spm-build-analysis/SKILL.md +80 -61
- package/pipeline/skills/shared/external/spm-build-analysis/evals/evals.json +56 -0
- package/pipeline/skills/shared/external/spm-build-analysis/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/spm-build-analysis/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/spm-build-analysis/references/spm-analysis-checks.md +89 -87
- package/pipeline/skills/shared/external/spm-build-analysis/scripts/check_spm_pins.py +90 -85
- package/pipeline/skills/shared/external/swift-concurrency-expert/SKILL.md +78 -69
- package/pipeline/skills/shared/external/swift-concurrency-expert/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/approachable-concurrency.md +52 -48
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/swift-6-2-concurrency.md +118 -184
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/swiftui-concurrency-tour-wwdc.md +68 -22
- package/pipeline/skills/shared/external/swift-concurrency-pro/SKILL.md +117 -94
- package/pipeline/skills/shared/external/swift-concurrency-pro/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/actors.md +102 -97
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/async-streams.md +36 -37
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/bridging.md +82 -34
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/bug-patterns.md +90 -52
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/cancellation.md +55 -55
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/diagnostics.md +66 -43
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/hotspots.md +39 -23
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/interop.md +66 -68
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/new-features.md +152 -131
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/structured.md +60 -57
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/testing.md +131 -118
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/unstructured.md +37 -29
- package/pipeline/skills/shared/external/swift-formatstyle/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swift-testing-pro/SKILL.md +77 -58
- package/pipeline/skills/shared/external/swift-testing-pro/evals/evals.json +59 -0
- package/pipeline/skills/shared/external/swift-testing-pro/references/async-tests.md +139 -144
- package/pipeline/skills/shared/external/swift-testing-pro/references/core-rules.md +90 -28
- package/pipeline/skills/shared/external/swift-testing-pro/references/migrating-from-xctest.md +38 -21
- package/pipeline/skills/shared/external/swift-testing-pro/references/new-features.md +139 -156
- package/pipeline/skills/shared/external/swift-testing-pro/references/writing-better-tests.md +173 -147
- package/pipeline/skills/shared/external/swiftdata-pro/SKILL.md +75 -59
- package/pipeline/skills/shared/external/swiftdata-pro/evals/evals.json +50 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/cloudkit.md +34 -7
- package/pipeline/skills/shared/external/swiftdata-pro/references/indexing.md +20 -14
- package/pipeline/skills/shared/external/swiftdata-pro/references/inheritance.md +127 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/model-rules.md +141 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/predicates.md +37 -44
- package/pipeline/skills/shared/external/swiftlint/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-expert-skill/SKILL.md +89 -88
- package/pipeline/skills/shared/external/swiftui-expert-skill/evals/evals.json +55 -0
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/accessibility-patterns.md +104 -122
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-advanced.md +73 -93
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-basics.md +144 -169
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-transitions.md +122 -133
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts-accessibility.md +141 -99
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts.md +273 -333
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/image-optimization.md +105 -128
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/latest-apis.md +199 -312
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/layout-best-practices.md +129 -169
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/liquid-glass.md +17 -30
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/list-patterns.md +198 -258
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-scenes.md +145 -218
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-views.md +150 -249
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-window-styling.md +109 -208
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/performance-patterns.md +225 -271
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/scroll-patterns.md +117 -210
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/sheet-navigation-patterns.md +171 -237
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/state-management.md +196 -260
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/view-structure.md +167 -230
- package/pipeline/skills/shared/external/swiftui-gestures/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-layout-components/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-navigation/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-navigation/references/navigationstack.md +1 -2
- package/pipeline/skills/shared/external/swiftui-patterns/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/SKILL.md +71 -79
- package/pipeline/skills/shared/external/swiftui-performance-audit/evals/evals.json +55 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/audit-layout.md +50 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/capture-checklist.md +51 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/hangs.md +34 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/instruments-guide.md +68 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/smell-catalog.md +191 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/update-model.md +69 -0
- package/pipeline/skills/shared/external/swiftui-pro/SKILL.md +65 -63
- package/pipeline/skills/shared/external/swiftui-pro/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/swiftui-pro/references/accessibility.md +40 -13
- package/pipeline/skills/shared/external/swiftui-pro/references/api.md +74 -29
- package/pipeline/skills/shared/external/swiftui-pro/references/data.md +44 -24
- package/pipeline/skills/shared/external/swiftui-pro/references/design.md +45 -31
- package/pipeline/skills/shared/external/swiftui-pro/references/hygiene.md +17 -8
- package/pipeline/skills/shared/external/swiftui-pro/references/navigation.md +19 -9
- package/pipeline/skills/shared/external/swiftui-pro/references/performance.md +50 -34
- package/pipeline/skills/shared/external/swiftui-pro/references/swift.md +73 -45
- package/pipeline/skills/shared/external/swiftui-pro/references/views.md +48 -23
- package/pipeline/skills/shared/external/swiftui-ui-patterns/SKILL.md +89 -83
- package/pipeline/skills/shared/external/swiftui-ui-patterns/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/app-wiring.md +119 -114
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/async-state.md +76 -61
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/components-index.md +63 -46
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/controls.md +32 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/deeplinks.md +49 -38
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/focus.md +77 -49
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/form.md +61 -44
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/grids.md +40 -42
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/input-toolbar.md +44 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/lightweight-clients.md +90 -64
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/list.md +48 -49
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/loading-placeholders.md +36 -25
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/macos-settings.md +30 -30
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/matched-transitions.md +49 -32
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/media.md +49 -41
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/menu-bar.md +52 -48
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/navigationstack.md +119 -104
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/overlay.md +30 -27
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/performance.md +33 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/previews.md +27 -27
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scroll-reveal.md +79 -86
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scrollview.md +47 -40
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/searchable.md +55 -40
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/sheets.md +113 -84
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/split-views.md +37 -34
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/tabview.md +75 -75
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/theming.md +37 -32
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/title-menus.md +41 -51
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/top-bar.md +46 -30
- package/pipeline/skills/shared/external/swiftui-uikit-interop/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-view-refactor/SKILL.md +152 -121
- package/pipeline/skills/shared/external/swiftui-view-refactor/evals/evals.json +56 -0
- package/pipeline/skills/shared/external/swiftui-view-refactor/references/mv-patterns.md +107 -98
- package/pipeline/skills/shared/external/swiftui-webkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/tailwind-css/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/test-result-triage/SKILL.md +2 -2
- package/pipeline/skills/shared/external/test-result-triage/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/testing-backend/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/tipkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/typescript-patterns/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/valven-rules/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/vision-framework/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/vue-composition/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/weatherkit/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/web-accessibility/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/web-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/web-testing/SKILL.md +2 -2
- package/pipeline/skills/shared/external/web-testing/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/web-testing/references/testing-examples.md +2 -2
- package/pipeline/skills/shared/external/widgetkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/xcode-build-benchmark/SKILL.md +61 -55
- package/pipeline/skills/shared/external/xcode-build-benchmark/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmark-artifacts.md +69 -67
- package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmarking-workflow.md +39 -47
- package/pipeline/skills/shared/external/xcode-build-benchmark/schemas/build-benchmark.schema.json +72 -154
- package/pipeline/skills/shared/external/xcode-build-benchmark/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-fixer/SKILL.md +145 -139
- package/pipeline/skills/shared/external/xcode-build-fixer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-build-fixer/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-build-fixer/references/fix-patterns.md +188 -143
- package/pipeline/skills/shared/external/xcode-build-fixer/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-build-fixer/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-orchestrator/SKILL.md +107 -98
- package/pipeline/skills/shared/external/xcode-build-orchestrator/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/benchmark-artifacts.md +69 -67
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/orchestration-report-template.md +81 -69
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/diagnose_compilation.py +155 -210
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/generate_optimization_report.py +355 -480
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/SKILL.md +70 -69
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/code-compilation-checks.md +85 -73
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/scripts/diagnose_compilation.py +155 -210
- package/pipeline/skills/shared/external/xcode-project-analyzer/SKILL.md +54 -52
- package/pipeline/skills/shared/external/xcode-project-analyzer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/project-audit-checks.md +115 -83
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/recommendation-format.md +41 -40
- package/pipeline/scripts/_notices.mjs +0 -171
- package/pipeline/skills/shared/external/NOTICE-avdlee-swiftui-agent-skill.md +0 -48
- package/pipeline/skills/shared/external/NOTICE-dimillian-skills.md +0 -63
- package/pipeline/skills/shared/external/NOTICE-paul-hudson-skills.md +0 -54
- package/pipeline/skills/shared/external/NOTICE-vibeship-spawner-skills.md +0 -203
- package/pipeline/skills/shared/external/NOTICE-xcode-build-skills.md +0 -60
- package/pipeline/skills/shared/external/ios-iphone-duo/NOTICE.md +0 -53
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/main.swift +0 -11
- package/pipeline/skills/shared/external/swiftdata-pro/references/class-inheritance.md +0 -104
- package/pipeline/skills/shared/external/swiftdata-pro/references/core-rules.md +0 -20
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/code-smells.md +0 -158
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +0 -46
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +0 -29
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/profiling-intake.md +0 -44
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/report-template.md +0 -47
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +0 -33
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +0 -52
|
@@ -1,170 +1,185 @@
|
|
|
1
1
|
# NavigationStack
|
|
2
2
|
|
|
3
3
|
<!-- toc -->
|
|
4
|
-
- [
|
|
5
|
-
- [
|
|
6
|
-
- [
|
|
7
|
-
- [
|
|
8
|
-
- [
|
|
9
|
-
- [
|
|
10
|
-
- [
|
|
11
|
-
- [
|
|
4
|
+
- [Contents](#contents)
|
|
5
|
+
- [Purpose](#purpose)
|
|
6
|
+
- [Building blocks](#building-blocks)
|
|
7
|
+
- [A router owned by one tab](#a-router-owned-by-one-tab)
|
|
8
|
+
- [One place that maps routes to views](#one-place-that-maps-routes-to-views)
|
|
9
|
+
- [Tabs that each keep their own history](#tabs-that-each-keep-their-own-history)
|
|
10
|
+
- [Data-driven tabs with a router registry](#data-driven-tabs-with-a-router-registry)
|
|
11
|
+
- [Keep](#keep)
|
|
12
|
+
- [Avoid](#avoid)
|
|
12
13
|
<!-- /toc -->
|
|
13
14
|
|
|
14
|
-
##
|
|
15
|
+
## Contents
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
- [Purpose](#purpose)
|
|
18
|
+
- [Building blocks](#building-blocks)
|
|
19
|
+
- [A router owned by one tab](#a-router-owned-by-one-tab)
|
|
20
|
+
- [One place that maps routes to views](#one-place-that-maps-routes-to-views)
|
|
21
|
+
- [Tabs that each keep their own history](#tabs-that-each-keep-their-own-history)
|
|
22
|
+
- [Data-driven tabs with a router registry](#data-driven-tabs-with-a-router-registry)
|
|
23
|
+
- [Keep](#keep)
|
|
24
|
+
- [Avoid](#avoid)
|
|
17
25
|
|
|
18
|
-
##
|
|
26
|
+
## Purpose
|
|
19
27
|
|
|
20
|
-
|
|
21
|
-
- Create a lightweight router (or use a library such as `https://github.com/Dimillian/AppRouter`) that owns the `path` and any sheet state.
|
|
22
|
-
- Each tab owns its own router instance and binds `NavigationStack(path:)` to it.
|
|
23
|
-
- Inject the router into the environment so child views can navigate programmatically.
|
|
24
|
-
- Centralize destination mapping with a single `navigationDestination(for:)` block (or a `withAppRouter()` modifier).
|
|
28
|
+
Programmatic navigation and deep links, above all when every tab must remember its own back stack. The core move: each tab gets its own `NavigationStack`, bound to its own path on its own router.
|
|
25
29
|
|
|
26
|
-
##
|
|
30
|
+
## Building blocks
|
|
31
|
+
|
|
32
|
+
- A `Hashable` route enum that names every destination.
|
|
33
|
+
- A small router that owns `path` and, optionally, the sheet currently shown. A third-party router package works too; the shape is the same.
|
|
34
|
+
- One router instance per tab, with `NavigationStack(path:)` bound to it.
|
|
35
|
+
- The router injected into the environment so descendants can push screens.
|
|
36
|
+
- Route-to-view mapping in exactly one `navigationDestination(for:)`, usually wrapped in a modifier such as `withAppRoutes()`.
|
|
37
|
+
|
|
38
|
+
## A router owned by one tab
|
|
27
39
|
|
|
28
40
|
```swift
|
|
41
|
+
enum Route: Hashable {
|
|
42
|
+
case book(id: String)
|
|
43
|
+
case author(id: String)
|
|
44
|
+
}
|
|
45
|
+
|
|
29
46
|
@MainActor
|
|
30
47
|
@Observable
|
|
31
48
|
final class RouterPath {
|
|
32
|
-
var path: [Route] = []
|
|
33
49
|
var presentedSheet: SheetDestination?
|
|
50
|
+
var path: [Route] = []
|
|
34
51
|
|
|
35
|
-
func
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
func reset() {
|
|
40
|
-
path = []
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
enum Route: Hashable {
|
|
45
|
-
case account(id: String)
|
|
46
|
-
case status(id: String)
|
|
52
|
+
func push(_ next: Route) { path.append(next) }
|
|
53
|
+
func popToRoot() { path.removeAll() }
|
|
47
54
|
}
|
|
48
55
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
@State private var routerPath = RouterPath()
|
|
56
|
+
struct LibraryTab: View {
|
|
57
|
+
@State private var router = RouterPath()
|
|
52
58
|
|
|
53
59
|
var body: some View {
|
|
54
|
-
NavigationStack(path: $
|
|
55
|
-
|
|
56
|
-
.navigationDestination(for: Route.self) {
|
|
57
|
-
switch
|
|
58
|
-
case .
|
|
59
|
-
case .
|
|
60
|
+
NavigationStack(path: $router.path) {
|
|
61
|
+
ShelfView()
|
|
62
|
+
.navigationDestination(for: Route.self) { destination in
|
|
63
|
+
switch destination {
|
|
64
|
+
case .book(let id): BookDetail(bookID: id)
|
|
65
|
+
case .author(let id): AuthorPage(authorID: id)
|
|
60
66
|
}
|
|
61
67
|
}
|
|
62
68
|
}
|
|
63
|
-
.environment(
|
|
69
|
+
.environment(router)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
A row deeper in the tree navigates without any binding passed down:
|
|
75
|
+
|
|
76
|
+
```swift
|
|
77
|
+
struct BookRow: View {
|
|
78
|
+
@Environment(RouterPath.self) var navigator
|
|
79
|
+
let book: Book
|
|
80
|
+
|
|
81
|
+
var body: some View {
|
|
82
|
+
Button(book.title) { navigator.push(.book(id: book.id)) }
|
|
64
83
|
}
|
|
65
84
|
}
|
|
66
85
|
```
|
|
67
86
|
|
|
68
|
-
##
|
|
87
|
+
## One place that maps routes to views
|
|
69
88
|
|
|
70
|
-
|
|
89
|
+
Repeating the `switch` in every screen drifts. Put it in a modifier and attach that modifier a single time per stack.
|
|
71
90
|
|
|
72
91
|
```swift
|
|
73
92
|
extension View {
|
|
74
|
-
func
|
|
75
|
-
navigationDestination(for: Route.self) {
|
|
76
|
-
switch
|
|
77
|
-
case .
|
|
78
|
-
|
|
79
|
-
case .status(let id):
|
|
80
|
-
StatusView(id: id)
|
|
93
|
+
func withAppRoutes() -> some View {
|
|
94
|
+
navigationDestination(for: Route.self) { destination in
|
|
95
|
+
switch destination {
|
|
96
|
+
case .book(let id): BookDetail(bookID: id)
|
|
97
|
+
case .author(let id): AuthorPage(authorID: id)
|
|
81
98
|
}
|
|
82
99
|
}
|
|
83
100
|
}
|
|
84
101
|
}
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Then apply it once per stack:
|
|
88
102
|
|
|
89
|
-
|
|
90
|
-
NavigationStack(path: $
|
|
91
|
-
|
|
92
|
-
.withAppRouter()
|
|
103
|
+
// In the stack:
|
|
104
|
+
NavigationStack(path: $router.path) {
|
|
105
|
+
ShelfView().withAppRoutes()
|
|
93
106
|
}
|
|
94
107
|
```
|
|
95
108
|
|
|
96
|
-
##
|
|
109
|
+
## Tabs that each keep their own history
|
|
110
|
+
|
|
111
|
+
With a fixed set of tabs, the container holds one router per tab and hands each one in; the tab views take a `router` parameter instead of creating their own.
|
|
97
112
|
|
|
98
113
|
```swift
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
@State private var
|
|
102
|
-
@State private var notificationsRouter = RouterPath()
|
|
114
|
+
struct FixedTabs: View {
|
|
115
|
+
@State private var libraryRouter = RouterPath()
|
|
116
|
+
@State private var discoverRouter = RouterPath()
|
|
103
117
|
|
|
104
118
|
var body: some View {
|
|
105
119
|
TabView {
|
|
106
|
-
|
|
107
|
-
|
|
120
|
+
LibraryTab(router: libraryRouter)
|
|
121
|
+
DiscoverTab(router: discoverRouter)
|
|
108
122
|
}
|
|
109
123
|
}
|
|
110
124
|
}
|
|
111
125
|
```
|
|
112
126
|
|
|
113
|
-
##
|
|
127
|
+
## Data-driven tabs with a router registry
|
|
114
128
|
|
|
115
|
-
|
|
129
|
+
When tabs come from an enum or from data, a registry hands out one router per tab on demand and builds the path binding for it.
|
|
116
130
|
|
|
117
131
|
```swift
|
|
118
132
|
@MainActor
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
133
|
+
@Observable
|
|
134
|
+
final class TabRouter {
|
|
135
|
+
private var byTab: [AppTab: RouterPath] = [:]
|
|
136
|
+
|
|
137
|
+
func router(of tab: AppTab) -> RouterPath {
|
|
138
|
+
if let existing = byTab[tab] { return existing }
|
|
139
|
+
let created = RouterPath()
|
|
140
|
+
byTab[tab] = created
|
|
141
|
+
return created
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
func pathBinding(of tab: AppTab) -> Binding<[Route]> {
|
|
145
|
+
let router = router(of: tab)
|
|
146
|
+
return Binding { router.path } set: { newPath in router.path = newPath }
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
struct RootTabs: View {
|
|
151
|
+
@State private var selection: AppTab = .library
|
|
152
|
+
@State private var routers = TabRouter()
|
|
122
153
|
|
|
123
154
|
var body: some View {
|
|
124
|
-
TabView(selection: $
|
|
125
|
-
ForEach(AppTab.allCases) {
|
|
126
|
-
NavigationStack(path:
|
|
127
|
-
|
|
155
|
+
TabView(selection: $selection) {
|
|
156
|
+
ForEach(AppTab.allCases) { item in
|
|
157
|
+
NavigationStack(path: routers.pathBinding(of: item)) {
|
|
158
|
+
item.rootView().withAppRoutes()
|
|
128
159
|
}
|
|
129
|
-
.environment(
|
|
130
|
-
.tabItem {
|
|
131
|
-
.tag(
|
|
160
|
+
.environment(routers.router(of: item))
|
|
161
|
+
.tabItem { item.label }
|
|
162
|
+
.tag(item)
|
|
132
163
|
}
|
|
133
164
|
}
|
|
134
165
|
}
|
|
135
166
|
}
|
|
136
167
|
```
|
|
137
168
|
|
|
138
|
-
|
|
139
|
-
@Observable
|
|
140
|
-
final class TabRouter {
|
|
141
|
-
private var routers: [AppTab: RouterPath] = [:]
|
|
142
|
-
|
|
143
|
-
func router(for tab: AppTab) -> RouterPath {
|
|
144
|
-
if let router = routers[tab] { return router }
|
|
145
|
-
let router = RouterPath()
|
|
146
|
-
routers[tab] = router
|
|
147
|
-
return router
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
func binding(for tab: AppTab) -> Binding<[Route]> {
|
|
151
|
-
let router = router(for: tab)
|
|
152
|
-
return Binding(get: { router.path }, set: { router.path = $0 })
|
|
153
|
-
}
|
|
154
|
-
}
|
|
169
|
+
`AppTab` is defined in [app-wiring.md](app-wiring.md).
|
|
155
170
|
|
|
156
|
-
##
|
|
171
|
+
## Keep
|
|
157
172
|
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
-
|
|
163
|
-
-
|
|
173
|
+
- A separate `NavigationStack` per tab so histories stay independent.
|
|
174
|
+
- Navigation state lives in exactly one object, the router (hand-written or a library type).
|
|
175
|
+
- `navigationDestination(for:)` as the only route-to-view mapping.
|
|
176
|
+
- Clearing the path when the app context changes, such as switching accounts or signing out.
|
|
177
|
+
- The router in the environment, so children push screens and present sheets without threading bindings through every layer.
|
|
178
|
+
- Sheet state on the router too, if modals should be managed in the same place.
|
|
164
179
|
|
|
165
|
-
##
|
|
180
|
+
## Avoid
|
|
166
181
|
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
182
|
+
- One path shared by all tabs, unless a single global history is what the product wants.
|
|
183
|
+
- Routes whose identity is unstable or that are not `Hashable`.
|
|
184
|
+
- Putting views into the path. The path holds small route values; views are built from them at destination time.
|
|
185
|
+
- Routers stored inside other `@Observable` objects; nested observation causes surprises, so keep the router on its own.
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Overlays and toasts
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## When to reach for it
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Short-lived UI such as toasts, banners and loading indicators sits in an overlay so it never pushes the layout around.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Building blocks
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- `.overlay(alignment:)` places app-wide UI on top of the content without changing how the content lays out.
|
|
10
|
+
- Overlays stay small and can be dismissed.
|
|
11
|
+
- When several features can raise a toast, route them through one shared owner (a `ToastCenter` or similar) instead of local state in each feature.
|
|
12
12
|
|
|
13
|
-
## Example:
|
|
13
|
+
## Example: banner that hides itself
|
|
14
14
|
|
|
15
15
|
```swift
|
|
16
|
-
struct
|
|
17
|
-
@State private var
|
|
16
|
+
struct ShellView: View {
|
|
17
|
+
@State private var banner: Banner?
|
|
18
18
|
|
|
19
19
|
var body: some View {
|
|
20
|
-
|
|
21
|
-
.overlay(alignment: .
|
|
22
|
-
if let
|
|
23
|
-
|
|
24
|
-
.
|
|
25
|
-
.
|
|
26
|
-
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
|
|
27
|
-
withAnimation { self.toast = nil }
|
|
28
|
-
}
|
|
29
|
-
}
|
|
20
|
+
MainTabs()
|
|
21
|
+
.overlay(alignment: .bottom) {
|
|
22
|
+
if let banner {
|
|
23
|
+
BannerView(banner: banner)
|
|
24
|
+
.padding()
|
|
25
|
+
.transition(.move(edge: .bottom).combined(with: .opacity))
|
|
30
26
|
}
|
|
31
27
|
}
|
|
28
|
+
.task(id: banner?.id) {
|
|
29
|
+
guard banner != nil else { return }
|
|
30
|
+
try? await Task.sleep(for: .seconds(2))
|
|
31
|
+
withAnimation { banner = nil }
|
|
32
|
+
}
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
Keying the dismissal task on the banner ID restarts the timer when a new banner replaces the old one, and the task is cancelled with the view.
|
|
38
|
+
|
|
39
|
+
## Keep in the design
|
|
37
40
|
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
+
- Transient UI goes in an overlay, not in the layout stacks.
|
|
42
|
+
- Pair a transition with a short automatic dismissal.
|
|
43
|
+
- Anchor the overlay to one clear edge, `.top` or `.bottom`.
|
|
41
44
|
|
|
42
|
-
##
|
|
45
|
+
## Watch out for
|
|
43
46
|
|
|
44
|
-
-
|
|
45
|
-
-
|
|
47
|
+
- Overlays that swallow every touch, unless blocking is the intent.
|
|
48
|
+
- Piling overlays on top of each other. Queue them or replace the current one.
|
|
@@ -1,62 +1,64 @@
|
|
|
1
1
|
# Performance guardrails
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## When to reach for it
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Apply these rules to screens that are large, scroll a lot, update often, or risk recomputing more than they need to.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Rules
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
9
|
+
- Content in `ForEach` and lists needs stable identity. If the collection can be reordered or mutated, index-based identity is wrong.
|
|
10
|
+
- Filtering, sorting and formatting that is more than trivial does not belong in `body`. Compute it ahead of time, or move it into a model or helper.
|
|
11
|
+
- Scope observation tightly, so the only views that update are the ones that read the changed state.
|
|
12
|
+
- Large scrolling content goes in lazy containers. When one part of a screen changes often, extract it into its own subview.
|
|
13
|
+
- Small state changes should not swap the whole top-level view tree. Keep the root stable and vary local sections or modifiers.
|
|
14
14
|
|
|
15
|
-
## Example:
|
|
15
|
+
## Example: identity
|
|
16
|
+
|
|
17
|
+
Identity taken from the model survives reordering:
|
|
16
18
|
|
|
17
19
|
```swift
|
|
18
|
-
ForEach(
|
|
19
|
-
|
|
20
|
+
ForEach(tasks) { task in
|
|
21
|
+
TaskRow(task: task)
|
|
20
22
|
}
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
Offset-based identity does not. Avoid this shape when the order can change:
|
|
24
26
|
|
|
25
27
|
```swift
|
|
26
|
-
ForEach(Array(
|
|
27
|
-
|
|
28
|
+
ForEach(Array(tasks.enumerated()), id: \.offset) { _, task in
|
|
29
|
+
TaskRow(task: task)
|
|
28
30
|
}
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
## Example:
|
|
33
|
+
## Example: derived data outside the body
|
|
32
34
|
|
|
33
35
|
```swift
|
|
34
|
-
struct
|
|
35
|
-
let
|
|
36
|
+
struct InboxView: View {
|
|
37
|
+
let messages: [Message]
|
|
36
38
|
|
|
37
|
-
private var
|
|
38
|
-
|
|
39
|
+
private var newestFirst: [Message] {
|
|
40
|
+
messages.sorted(using: KeyPathComparator(\.receivedAt, order: .reverse))
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
var body: some View {
|
|
42
|
-
List(
|
|
43
|
-
|
|
44
|
+
List(newestFirst) { message in
|
|
45
|
+
MessageRow(message: message)
|
|
44
46
|
}
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
|
|
51
|
+
A small computed property like this is fine. Anything heavier belongs in a model, store or helper that recomputes less often than the view renders.
|
|
50
52
|
|
|
51
|
-
##
|
|
53
|
+
## Signs that deserve a closer look
|
|
52
54
|
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
55
|
+
- Stutter while scrolling a long feed or grid.
|
|
56
|
+
- Lag while typing, caused by search or form validation.
|
|
57
|
+
- Wide view updates triggered by one small piece of state.
|
|
58
|
+
- Big screens full of conditionals or repeated formatting.
|
|
57
59
|
|
|
58
|
-
##
|
|
60
|
+
## Watch out for
|
|
59
61
|
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
62
|
+
- Running a heavy transform on every render.
|
|
63
|
+
- Many descendants observing one large object when they each need a single field.
|
|
64
|
+
- Hand-rolled scroll containers where `List`, `LazyVStack` or `LazyHGrid` already does the job.
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
# Previews
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## When to reach for it
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
A preview checks layout, state wiring and injected dependencies with no running app and no live services behind it.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Rules
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- Keep preview setup
|
|
13
|
-
-
|
|
9
|
+
- Write a `#Preview` for the main state and for the secondary states that matter: loading, empty, error.
|
|
10
|
+
- Feed previews deterministic fixtures, mocks and sample data. Live network calls, real databases and global singletons have no place in them.
|
|
11
|
+
- Put every environment dependency the view needs into the preview itself, so the view renders on its own.
|
|
12
|
+
- Keep preview setup next to the view. Once it gets noisy, pull it into small preview helpers or fixtures.
|
|
13
|
+
- A crashing preview is a signal: repair the state initialization or the dependency wiring before building more of the feature.
|
|
14
14
|
|
|
15
|
-
## Example:
|
|
15
|
+
## Example: one preview per state
|
|
16
16
|
|
|
17
17
|
```swift
|
|
18
|
-
#Preview("
|
|
19
|
-
|
|
18
|
+
#Preview("Order shipped") {
|
|
19
|
+
OrderStatusView(order: .sampleShipped)
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
#Preview("
|
|
23
|
-
|
|
22
|
+
#Preview("No orders yet") {
|
|
23
|
+
OrderStatusView(order: nil)
|
|
24
24
|
}
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
## Example:
|
|
27
|
+
## Example: dependencies installed in the preview
|
|
28
28
|
|
|
29
29
|
```swift
|
|
30
|
-
#Preview("
|
|
31
|
-
|
|
32
|
-
.environment(
|
|
33
|
-
.environment(
|
|
30
|
+
#Preview("Cart with two items") {
|
|
31
|
+
CartScreen()
|
|
32
|
+
.environment(CartService.stub(items: [.sampleMug, .sampleTeapot]))
|
|
33
|
+
.environment(BrandTheme.sample)
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Checklist
|
|
38
38
|
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
- Are fixtures stable and
|
|
42
|
-
-
|
|
39
|
+
- Is every required environment dependency installed?
|
|
40
|
+
- Is there at least one happy path and one unhappy path?
|
|
41
|
+
- Are the fixtures stable and short enough to read at a glance?
|
|
42
|
+
- Does it render with no network, no sign-in and no app-wide startup code?
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Watch out for
|
|
45
45
|
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
46
|
+
- Making a dependency optional only so the preview stops crashing, when the real view requires it.
|
|
47
|
+
- Long inline fixtures where a named sample reads better.
|
|
48
|
+
- Tying previews to shared global singletons, unless the project offers no other way.
|