@thanhnguyxn/pixelcraft 0.1.0 → 0.2.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.
Files changed (376) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.antigravity-plugin/plugin.json +32 -0
  3. package/.claude-plugin/marketplace.json +1 -1
  4. package/.claude-plugin/plugin.json +15 -4
  5. package/.codex-plugin/plugin.json +45 -0
  6. package/.cursor-plugin/marketplace.json +17 -0
  7. package/.cursor-plugin/plugin.json +27 -0
  8. package/.devin-plugin/plugin.json +21 -0
  9. package/.github/plugin/marketplace.json +34 -0
  10. package/CHANGELOG.md +159 -0
  11. package/GEMINI.md +1 -0
  12. package/README.md +185 -328
  13. package/SECURITY.md +28 -0
  14. package/assets/pixelcraft-logo-128.png +0 -0
  15. package/assets/pixelcraft-logo-256.png +0 -0
  16. package/bin/pixelcraft.mjs +431 -23
  17. package/docs/ARCHITECTURE.md +40 -37
  18. package/docs/DESIGN-RATIONALE.md +51 -3
  19. package/docs/INSTALL.md +221 -0
  20. package/evals/README.md +16 -6
  21. package/evals/fixtures/3d-web-engineering.json +69 -0
  22. package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
  23. package/evals/fixtures/ai-ui-libraries.json +53 -0
  24. package/evals/fixtures/audio-visual-accessibility.json +69 -0
  25. package/evals/fixtures/auth-and-checkout-ui.json +53 -0
  26. package/evals/fixtures/brandkit-identity-governance.json +48 -0
  27. package/evals/fixtures/build-and-architecture.json +53 -0
  28. package/evals/fixtures/canvas-and-node-editors.json +53 -0
  29. package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
  30. package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
  31. package/evals/fixtures/component-systems.json +53 -0
  32. package/evals/fixtures/component-testing.json +53 -0
  33. package/evals/fixtures/constrained-voice-and-tv.json +43 -0
  34. package/evals/fixtures/creative-code-rendering.json +69 -0
  35. package/evals/fixtures/creative-reference-evidence.json +67 -0
  36. package/evals/fixtures/data-app-python-marimo.json +49 -0
  37. package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
  38. package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
  39. package/evals/fixtures/desktop-native-workspace.json +48 -0
  40. package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
  41. package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
  42. package/evals/fixtures/document-rust-typst-invoice.json +49 -0
  43. package/evals/fixtures/document-typst-and-print-css.json +43 -0
  44. package/evals/fixtures/email-mjml-dark-mode.json +49 -0
  45. package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
  46. package/evals/fixtures/enterprise-data-ui.json +53 -0
  47. package/evals/fixtures/extended-tui-toolkits.json +53 -0
  48. package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
  49. package/evals/fixtures/file-upload-media-ui.json +53 -0
  50. package/evals/fixtures/forms-validation.json +53 -0
  51. package/evals/fixtures/game-go-ebitengine.json +49 -0
  52. package/evals/fixtures/game-godot-gdscript.json +49 -0
  53. package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
  54. package/evals/fixtures/i18n-engineering.json +53 -0
  55. package/evals/fixtures/local-first-sync.json +53 -0
  56. package/evals/fixtures/lynxjs.json +53 -0
  57. package/evals/fixtures/maizzle-email.json +53 -0
  58. package/evals/fixtures/maps-geospatial.json +53 -0
  59. package/evals/fixtures/media-og-and-video-export.json +43 -0
  60. package/evals/fixtures/media-players.json +53 -0
  61. package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
  62. package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
  63. package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
  64. package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
  65. package/evals/fixtures/mobile-jetpack-compose.json +49 -0
  66. package/evals/fixtures/mobile-swiftui-ios.json +49 -0
  67. package/evals/fixtures/motion-engineering.json +69 -0
  68. package/evals/fixtures/pdfjs-and-pptx.json +53 -0
  69. package/evals/fixtures/plan-discovery-interview.json +31 -0
  70. package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
  71. package/evals/fixtures/reactive-data-apps.json +53 -0
  72. package/evals/fixtures/review-evidence-audit.json +43 -0
  73. package/evals/fixtures/rich-text-and-code-editors.json +53 -0
  74. package/evals/fixtures/scrollytelling-resilience.json +70 -0
  75. package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
  76. package/evals/fixtures/state-architecture.json +53 -0
  77. package/evals/fixtures/styling-ecosystem.json +53 -0
  78. package/evals/fixtures/token-tooling.json +53 -0
  79. package/evals/fixtures/tui-go-bubbletea.json +49 -0
  80. package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
  81. package/evals/fixtures/tui-rust-ratatui.json +49 -0
  82. package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
  83. package/evals/fixtures/web-3d-engines.json +53 -0
  84. package/evals/fixtures/web-php-laravel-filament.json +49 -0
  85. package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
  86. package/evals/pixelcraft-accessibility.md +17 -0
  87. package/evals/pixelcraft-craft.md +16 -0
  88. package/evals/pixelcraft-dataviz.md +3 -3
  89. package/evals/pixelcraft-direction.md +17 -0
  90. package/evals/pixelcraft-game-ui.md +3 -3
  91. package/evals/pixelcraft-mobile.md +3 -3
  92. package/evals/pixelcraft-patterns.md +16 -0
  93. package/evals/pixelcraft-plan.md +65 -3
  94. package/evals/pixelcraft-review.md +3 -3
  95. package/evals/pixelcraft-visual-qa.md +11 -5
  96. package/evals/pixelcraft-web.md +21 -3
  97. package/evals/pixelcraft.md +4 -4
  98. package/gemini-extension.json +3 -2
  99. package/install.ps1 +57 -11
  100. package/install.sh +82 -7
  101. package/package.json +32 -4
  102. package/plugin.json +6 -1
  103. package/scripts/build-adapters.mjs +11 -13
  104. package/scripts/run-evals.mjs +397 -0
  105. package/scripts/sync-docs.mjs +381 -0
  106. package/scripts/test-build-adapters.mjs +14 -1
  107. package/scripts/test-cross-platform-qa.mjs +359 -0
  108. package/scripts/test-distribution.mjs +86 -7
  109. package/scripts/test-export-tokens.mjs +259 -3
  110. package/scripts/test-finish-gate.mjs +133 -10
  111. package/scripts/test-installers.mjs +155 -6
  112. package/scripts/test-shoot.mjs +23 -1
  113. package/scripts/test-slop-scan.mjs +390 -3
  114. package/scripts/test-style-inventory.mjs +23 -0
  115. package/scripts/test-sync-docs.mjs +140 -0
  116. package/scripts/test-validate-skills.mjs +82 -4
  117. package/scripts/validate-skills.mjs +149 -3
  118. package/skills/pixelcraft/SKILL.md +67 -47
  119. package/skills/pixelcraft/references/design-brief.md +2 -2
  120. package/skills/pixelcraft/references/floor.md +36 -19
  121. package/skills/pixelcraft/references/report-template.md +25 -11
  122. package/skills/pixelcraft/references/stack-detection.md +138 -67
  123. package/skills/pixelcraft/references/surface-acceptance.md +33 -21
  124. package/skills/pixelcraft/references/workflow-checkpoints.md +49 -7
  125. package/skills/pixelcraft-accessibility/SKILL.md +34 -13
  126. package/skills/pixelcraft-accessibility/references/apg-patterns.md +13 -0
  127. package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
  128. package/skills/pixelcraft-accessibility/references/platforms.md +34 -6
  129. package/skills/pixelcraft-accessibility/references/verification.md +15 -10
  130. package/skills/pixelcraft-accessibility/references/wcag22-checks.md +38 -5
  131. package/skills/pixelcraft-brandkit/SKILL.md +42 -30
  132. package/skills/pixelcraft-brandkit/references/asset-pipeline.md +90 -50
  133. package/skills/pixelcraft-brandkit/references/brand-governance.md +29 -27
  134. package/skills/pixelcraft-brandkit/references/logo-methods.md +33 -34
  135. package/skills/pixelcraft-brandkit/references/prompt-template.md +53 -51
  136. package/skills/pixelcraft-brandkit/references/qa-checklist.md +7 -2
  137. package/skills/pixelcraft-brandkit/references/visual-modes.md +16 -16
  138. package/skills/pixelcraft-chat-ui/SKILL.md +31 -27
  139. package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
  140. package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
  141. package/skills/pixelcraft-chat-ui/references/conversation-design.md +12 -6
  142. package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +58 -68
  143. package/skills/pixelcraft-chat-ui/references/slack-discord.md +60 -76
  144. package/skills/pixelcraft-constrained/SKILL.md +21 -20
  145. package/skills/pixelcraft-constrained/references/specialized-hardware.md +69 -45
  146. package/skills/pixelcraft-constrained/references/tv-wearables.md +123 -73
  147. package/skills/pixelcraft-constrained/references/voice-ui.md +86 -45
  148. package/skills/pixelcraft-craft/SKILL.md +29 -15
  149. package/skills/pixelcraft-craft/references/color.md +62 -6
  150. package/skills/pixelcraft-craft/references/layout.md +32 -0
  151. package/skills/pixelcraft-craft/references/motion.md +99 -12
  152. package/skills/pixelcraft-craft/references/typography.md +48 -9
  153. package/skills/pixelcraft-data-apps/SKILL.md +50 -31
  154. package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
  155. package/skills/pixelcraft-data-apps/references/dash.md +87 -31
  156. package/skills/pixelcraft-data-apps/references/evidence.md +41 -26
  157. package/skills/pixelcraft-data-apps/references/gradio.md +65 -27
  158. package/skills/pixelcraft-data-apps/references/julia-genie.md +64 -29
  159. package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +65 -27
  160. package/skills/pixelcraft-data-apps/references/nicegui.md +73 -34
  161. package/skills/pixelcraft-data-apps/references/observable-framework.md +65 -27
  162. package/skills/pixelcraft-data-apps/references/panel.md +69 -23
  163. package/skills/pixelcraft-data-apps/references/r-shiny.md +104 -34
  164. package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
  165. package/skills/pixelcraft-data-apps/references/reflex.md +85 -31
  166. package/skills/pixelcraft-data-apps/references/shiny.md +84 -27
  167. package/skills/pixelcraft-data-apps/references/streamlit.md +73 -25
  168. package/skills/pixelcraft-dataviz/SKILL.md +21 -24
  169. package/skills/pixelcraft-dataviz/references/color-accessibility.md +2 -2
  170. package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +35 -25
  171. package/skills/pixelcraft-dataviz/references/libraries.md +165 -46
  172. package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
  173. package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +58 -65
  174. package/skills/pixelcraft-desktop/SKILL.md +61 -39
  175. package/skills/pixelcraft-desktop/references/appkit.md +60 -26
  176. package/skills/pixelcraft-desktop/references/avalonia.md +65 -29
  177. package/skills/pixelcraft-desktop/references/cpp-gui.md +104 -27
  178. package/skills/pixelcraft-desktop/references/electron.md +68 -26
  179. package/skills/pixelcraft-desktop/references/go-gui.md +59 -30
  180. package/skills/pixelcraft-desktop/references/gtk.md +74 -31
  181. package/skills/pixelcraft-desktop/references/javafx-swing.md +54 -25
  182. package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +57 -30
  183. package/skills/pixelcraft-desktop/references/rust-gui.md +59 -41
  184. package/skills/pixelcraft-desktop/references/tauri.md +80 -24
  185. package/skills/pixelcraft-desktop/references/uno-platform.md +42 -23
  186. package/skills/pixelcraft-desktop/references/winui-wpf.md +66 -26
  187. package/skills/pixelcraft-desktop/references/working-context.md +82 -3
  188. package/skills/pixelcraft-direction/SKILL.md +48 -82
  189. package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
  190. package/skills/pixelcraft-direction/references/direction-card.md +11 -1
  191. package/skills/pixelcraft-direction/references/direction-scoring.md +5 -1
  192. package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
  193. package/skills/pixelcraft-direction/references/movements.md +3 -0
  194. package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
  195. package/skills/pixelcraft-direction/references/slop-fingerprints.md +32 -7
  196. package/skills/pixelcraft-document/SKILL.md +27 -23
  197. package/skills/pixelcraft-document/references/archetypes.md +27 -4
  198. package/skills/pixelcraft-document/references/pdf-tools.md +241 -81
  199. package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
  200. package/skills/pixelcraft-document/references/print-css.md +96 -43
  201. package/skills/pixelcraft-document/references/slides.md +123 -27
  202. package/skills/pixelcraft-email/SKILL.md +42 -20
  203. package/skills/pixelcraft-email/references/client-quirks.md +101 -33
  204. package/skills/pixelcraft-email/references/html-tables.md +83 -22
  205. package/skills/pixelcraft-email/references/maizzle.md +54 -0
  206. package/skills/pixelcraft-email/references/mjml.md +13 -11
  207. package/skills/pixelcraft-email/references/react-email.md +76 -34
  208. package/skills/pixelcraft-extensions/SKILL.md +32 -27
  209. package/skills/pixelcraft-extensions/references/browser-extensions.md +91 -17
  210. package/skills/pixelcraft-extensions/references/figma-office.md +97 -14
  211. package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
  212. package/skills/pixelcraft-extensions/references/raycast.md +90 -11
  213. package/skills/pixelcraft-extensions/references/vscode-webviews.md +91 -17
  214. package/skills/pixelcraft-game-ui/SKILL.md +45 -26
  215. package/skills/pixelcraft-game-ui/references/bevy.md +69 -31
  216. package/skills/pixelcraft-game-ui/references/godot.md +100 -27
  217. package/skills/pixelcraft-game-ui/references/hud-principles.md +50 -21
  218. package/skills/pixelcraft-game-ui/references/love2d.md +53 -27
  219. package/skills/pixelcraft-game-ui/references/monogame.md +45 -29
  220. package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
  221. package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +69 -27
  222. package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -26
  223. package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
  224. package/skills/pixelcraft-handoff/SKILL.md +14 -13
  225. package/skills/pixelcraft-handoff/references/design-translation.md +40 -10
  226. package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
  227. package/skills/pixelcraft-media/SKILL.md +20 -23
  228. package/skills/pixelcraft-media/references/banners-video.md +83 -65
  229. package/skills/pixelcraft-media/references/og-generation.md +110 -63
  230. package/skills/pixelcraft-media/references/social-cards.md +57 -58
  231. package/skills/pixelcraft-mobile/SKILL.md +53 -36
  232. package/skills/pixelcraft-mobile/references/dotnet-maui.md +62 -34
  233. package/skills/pixelcraft-mobile/references/flet.md +53 -26
  234. package/skills/pixelcraft-mobile/references/flutter.md +76 -32
  235. package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
  236. package/skills/pixelcraft-mobile/references/ionic-capacitor.md +48 -26
  237. package/skills/pixelcraft-mobile/references/jetpack-compose.md +92 -24
  238. package/skills/pixelcraft-mobile/references/kivy.md +54 -31
  239. package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +53 -27
  240. package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
  241. package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
  242. package/skills/pixelcraft-mobile/references/react-native-expo.md +66 -31
  243. package/skills/pixelcraft-mobile/references/swiftui.md +158 -28
  244. package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
  245. package/skills/pixelcraft-mobile/references/task-state-composition.md +82 -2
  246. package/skills/pixelcraft-mobile/references/uikit.md +57 -23
  247. package/skills/pixelcraft-patterns/SKILL.md +30 -13
  248. package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
  249. package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
  250. package/skills/pixelcraft-patterns/references/auth-onboarding.md +32 -13
  251. package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
  252. package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
  253. package/skills/pixelcraft-patterns/references/commerce.md +35 -16
  254. package/skills/pixelcraft-patterns/references/communication.md +34 -15
  255. package/skills/pixelcraft-patterns/references/creative-tools.md +30 -17
  256. package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
  257. package/skills/pixelcraft-patterns/references/dashboard-admin.md +22 -18
  258. package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
  259. package/skills/pixelcraft-patterns/references/marketing.md +31 -19
  260. package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
  261. package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
  262. package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
  263. package/skills/pixelcraft-patterns/references/pattern-selection.md +8 -2
  264. package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
  265. package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
  266. package/skills/pixelcraft-patterns/references/settings.md +40 -12
  267. package/skills/pixelcraft-plan/SKILL.md +54 -18
  268. package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
  269. package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
  270. package/skills/pixelcraft-plan/references/plan-template.md +44 -9
  271. package/skills/pixelcraft-plan/references/repo-discovery.md +16 -9
  272. package/skills/pixelcraft-plan/references/stack-freshness.md +22 -5
  273. package/skills/pixelcraft-plan/references/stack-selection.md +65 -9
  274. package/skills/pixelcraft-review/SKILL.md +41 -19
  275. package/skills/pixelcraft-review/references/audit-report.md +20 -1
  276. package/skills/pixelcraft-review/references/heuristics.md +63 -18
  277. package/skills/pixelcraft-review/references/personas.md +41 -14
  278. package/skills/pixelcraft-review/references/polish.md +66 -26
  279. package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
  280. package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
  281. package/skills/pixelcraft-review/scripts/slop-scan.mjs +679 -32
  282. package/skills/pixelcraft-spatial/SKILL.md +16 -17
  283. package/skills/pixelcraft-spatial/references/comfort-accessibility.md +25 -84
  284. package/skills/pixelcraft-spatial/references/platforms.md +123 -53
  285. package/skills/pixelcraft-tokens/SKILL.md +18 -14
  286. package/skills/pixelcraft-tokens/assets/tokens.example.json +1 -1
  287. package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +1 -1
  288. package/skills/pixelcraft-tokens/references/format.md +39 -9
  289. package/skills/pixelcraft-tokens/references/governance.md +1 -1
  290. package/skills/pixelcraft-tokens/references/theme-presets.md +36 -8
  291. package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
  292. package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +637 -75
  293. package/skills/pixelcraft-tui/SKILL.md +41 -25
  294. package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +49 -30
  295. package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
  296. package/skills/pixelcraft-tui/references/ink.md +77 -28
  297. package/skills/pixelcraft-tui/references/ratatui.md +70 -30
  298. package/skills/pixelcraft-tui/references/rich.md +53 -33
  299. package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
  300. package/skills/pixelcraft-tui/references/textual.md +75 -34
  301. package/skills/pixelcraft-ux/SKILL.md +22 -12
  302. package/skills/pixelcraft-ux/references/feedback-performance.md +39 -19
  303. package/skills/pixelcraft-ux/references/forms.md +57 -3
  304. package/skills/pixelcraft-ux/references/i18n.md +50 -12
  305. package/skills/pixelcraft-ux/references/laws.md +35 -14
  306. package/skills/pixelcraft-ux/references/state-matrix.md +15 -1
  307. package/skills/pixelcraft-ux/references/ux-writing.md +1 -0
  308. package/skills/pixelcraft-visual-qa/SKILL.md +21 -7
  309. package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +28 -7
  310. package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
  311. package/skills/pixelcraft-visual-qa/references/capture-email.md +13 -9
  312. package/skills/pixelcraft-visual-qa/references/capture-mobile.md +20 -5
  313. package/skills/pixelcraft-visual-qa/references/capture-terminal.md +6 -2
  314. package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
  315. package/skills/pixelcraft-visual-qa/references/performance-budgets.md +25 -12
  316. package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
  317. package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
  318. package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
  319. package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
  320. package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
  321. package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +50 -11
  322. package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +214 -59
  323. package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +121 -49
  324. package/skills/pixelcraft-web/SKILL.md +105 -49
  325. package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
  326. package/skills/pixelcraft-web/references/adaptive-layout.md +52 -8
  327. package/skills/pixelcraft-web/references/angular.md +63 -16
  328. package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
  329. package/skills/pixelcraft-web/references/astro.md +64 -13
  330. package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
  331. package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
  332. package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
  333. package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
  334. package/skills/pixelcraft-web/references/clojurescript.md +52 -17
  335. package/skills/pixelcraft-web/references/component-systems.md +102 -0
  336. package/skills/pixelcraft-web/references/component-testing.md +170 -0
  337. package/skills/pixelcraft-web/references/creative-effects.md +59 -0
  338. package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
  339. package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
  340. package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
  341. package/skills/pixelcraft-web/references/forms-validation.md +123 -0
  342. package/skills/pixelcraft-web/references/fsharp-fable.md +3 -2
  343. package/skills/pixelcraft-web/references/gsap.md +102 -0
  344. package/skills/pixelcraft-web/references/html-css.md +144 -12
  345. package/skills/pixelcraft-web/references/htmx-alpine.md +68 -18
  346. package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
  347. package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
  348. package/skills/pixelcraft-web/references/java-web.md +27 -18
  349. package/skills/pixelcraft-web/references/kotlin-web.md +6 -2
  350. package/skills/pixelcraft-web/references/leptos-yew.md +62 -19
  351. package/skills/pixelcraft-web/references/lit-web-components.md +4 -2
  352. package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
  353. package/skills/pixelcraft-web/references/media-players.md +104 -0
  354. package/skills/pixelcraft-web/references/motion-react.md +96 -0
  355. package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
  356. package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
  357. package/skills/pixelcraft-web/references/pwa.md +6 -1
  358. package/skills/pixelcraft-web/references/qwik.md +51 -11
  359. package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
  360. package/skills/pixelcraft-web/references/react-next.md +112 -13
  361. package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
  362. package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
  363. package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
  364. package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
  365. package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
  366. package/skills/pixelcraft-web/references/server-rendered.md +106 -63
  367. package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
  368. package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
  369. package/skills/pixelcraft-web/references/solid.md +67 -16
  370. package/skills/pixelcraft-web/references/state-architecture.md +107 -0
  371. package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
  372. package/skills/pixelcraft-web/references/svelte.md +61 -11
  373. package/skills/pixelcraft-web/references/tailwind.md +40 -14
  374. package/skills/pixelcraft-web/references/video-media.md +69 -0
  375. package/skills/pixelcraft-web/references/vue-nuxt.md +37 -13
  376. package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
@@ -1,70 +1,200 @@
1
1
  # SwiftUI
2
2
 
3
- Evidence: Apple environment keys verified in current docs: `@Environment(\.accessibilityReduceMotion)` and `@Environment(\.dynamicTypeSize)`.
4
-
5
3
  ## Token mapping
6
4
 
7
- Map generated Swift colors/values into asset catalogs or a typed semantic theme enum. Prefer asset catalog colors for light/dark/high-contrast variants; use generated constants only where compile-time generation is intentional:
5
+ Map DTCG semantic roles into Asset Catalog color sets (carrying light, dark, and high-contrast variants) and reference them via Xcode-generated **`ColorResource`** symbols rather than raw RGB/hex literals:
8
6
 
9
7
  ```swift
10
8
  enum PC {
11
- static let action = Color("Semantic/Action")
9
+ static let action = Color(.semanticAction) // ColorResource from Assets.xcassets
10
+ static let surface = Color(.semanticSurface)
12
11
  static let controlInline: CGFloat = 12
13
12
  }
13
+
14
+ // Custom environment tokens with @Entry (iOS 18+ / Xcode 16+)
15
+ extension EnvironmentValues {
16
+ @Entry var pcSpacingScale: CGFloat = 1.0
17
+ }
14
18
  ```
15
19
 
16
- Do not scatter raw RGB/hex initializers through views. Use `ColorAsset` names that express semantic roles.
20
+ Use `ColorResource` names that express semantic roles (`semanticAction`, `semanticDanger`), not palette names (`blue500`). Reserve compile-time constant structs for spacing, radii, and motion durations that Asset Catalogs do not store.
17
21
 
18
- ## Layout and responsive idioms
22
+ ## iOS 26 Liquid Glass & modern materials
19
23
 
20
- Use stacks, grids, safe-area behavior, size classes, dynamic type adaptation, and container resizing rather than fixed device frames. `ViewThatFits`, `Layout`, geometry-aware composition, and scroll behavior are selected by content need—not used reflexively. Respect navigation stack/split view/tab bar idioms and iPad/macOS resizing where targeted.
24
+ On iOS 26+, reserve **Liquid Glass** for floating navigation, toolbars, and controls above scrolling content—never apply glass to primary reading surfaces or stack glass-on-glass:
21
25
 
22
- ## Typography/custom fonts
26
+ ```swift
27
+ GlassEffectContainer(spacing: 12) {
28
+ HStack(spacing: 12) {
29
+ Button("Filter", systemImage: "line.3.horizontal.decrease") { showFilter = true }
30
+ .buttonStyle(.glass)
31
+ Button("Create", systemImage: "plus") { createInvoice() }
32
+ .buttonStyle(.glassProminent)
33
+ }
34
+ }
35
+ .padding()
36
+ .glassEffect(.regular, in: ConcentricRectangle(corners: .concentric(minimum: 16)))
37
+ ```
23
38
 
24
- Prefer system text styles (`.body`, `.headline`, `.title`) because they scale automatically. Register custom fonts correctly in the app target/Info.plist and use scalable relative sizing rather than fixed point-only assumptions. Read `dynamicTypeSize` when layout must switch at accessibility sizes.
39
+ - Group neighboring glass controls inside `GlassEffectContainer` so they share backdrop sampling and morph smoothly during state transitions.
40
+ - Use `.buttonStyle(.glass)` / `.buttonStyle(.glassProminent)`, `ConcentricRectangle` for concentric corner nesting inside sheets/bezels, `.tabBarMinimizeBehavior(.onScrollDown)` for content-first scrolling tabs, and `.scrollEdgeEffectStyle(.soft, for: .top)` (or `.hard`) to preserve legibility where content passes beneath floating chrome.
41
+ - **Mandatory accessibility fallback**: read `@Environment(\.accessibilityReduceTransparency)` and `@Environment(\.colorSchemeContrast)` (`.increased`). When either is active, replace translucent `.glassEffect(...)` surfaces with opaque semantic surfaces and clear borders so text contrast stays ≥ 4.5:1.
25
42
 
26
- ## Motion/reduced motion
43
+ ## Layout, navigation, and iOS 18–26 idioms
27
44
 
28
- Use SwiftUI animation/spring/transition intentionally and read:
45
+ - Use `NavigationStack`, `NavigationSplitView`, `ViewThatFits`, `Layout`, safe-area insets (`.safeAreaInset(edge: .bottom)`), and horizontal/vertical size classes rather than fixed device frames.
46
+ - Use the **`Tab` / `TabSection`** API (iOS 18+, replacing deprecated `.tabItem`) for adaptive iPhone tab bars and iPad floating tab bars / sidebars:
29
47
 
30
48
  ```swift
31
- @Environment(\.accessibilityReduceMotion) private var reduceMotion
49
+ TabView(selection: $selectedTab) {
50
+ Tab("Invoices", systemImage: "doc.text", value: AppTab.invoices) {
51
+ InvoiceListView()
52
+ }
53
+ TabSection("Archive") {
54
+ Tab("Paid", systemImage: "checkmark.circle", value: AppTab.paid) { PaidListView() }
55
+ }
56
+ }
57
+ .tabBarMinimizeBehavior(.onScrollDown)
32
58
  ```
33
59
 
34
- Choose non-motion or opacity/static alternatives when true. Do not add `.animation` globally to state that should update instantly; implicit animation scope matters.
60
+ - Use `.navigationTransition(.zoom(sourceID: invoice.id, in: ns))` paired with `.matchedTransitionSource(id: invoice.id, in: ns)` for continuity transitions when opening detail cards/media (bypassing zoom motion when Reduce Motion is enabled).
61
+ - Use native **`ContentUnavailableView`** (and `ContentUnavailableView.search`) for empty, error, and no-results states.
62
+ - On iOS 26+, prefer native SwiftUI **`WebView`** / `WebPage` (WebKit) over custom `UIViewRepresentable` `WKWebView` wrappers when embedding web content.
63
+ - Extend glanceable and ongoing experiences to the Lock Screen / Home Screen via **`WidgetKit`** interactive widgets (`AppIntent`) and **`ActivityKit`** Live Activities (see `references/task-state-composition.md`).
64
+
65
+ ## Typography & Dynamic Type
66
+
67
+ Prefer system text styles (`.body`, `.headline`, `.title2`) because they scale automatically with Dynamic Type. For custom bundled fonts registered in `Info.plist`, always bind scaling to a semantic text style:
68
+
69
+ ```swift
70
+ Text(invoice.totalFormatted)
71
+ .font(.custom("BrandSans-SemiBold", size: 17, relativeTo: .body))
72
+ ```
73
+
74
+ Read `@Environment(\.dynamicTypeSize) private var typeSize` and switch horizontal label/value rows to `VStack` (or `ViewThatFits`) when `typeSize.isAccessibilitySize` so numbers and actions never clip.
75
+
76
+ ## Motion, haptics, & reduced motion
77
+
78
+ Read `@Environment(\.accessibilityReduceMotion) private var reduceMotion` and switch spatial transitions/zooms to instant or cross-dissolve updates when true. Avoid unbounded implicit `.animation(_:)` modifiers; scope animations to explicit value changes or `withAnimation`.
79
+
80
+ Trigger semantic haptics declaratively with **`.sensoryFeedback`** (iOS 17+) rather than manual UIKit generators:
81
+
82
+ ```swift
83
+ Button("Approve") { approve() }
84
+ .sensoryFeedback(.success, trigger: approvalCount)
85
+ ```
35
86
 
36
87
  ## Accessibility specifics
37
88
 
38
- Use SwiftUI accessibility modifiers: `accessibilityLabel`, `accessibilityValue`, `accessibilityHint` sparingly, `accessibilityTraits`, `accessibilityElement(children:)`, custom actions, adjustable values, sort priority. Verify VoiceOver order rather than assuming visual order. Minimum touch target baseline is 44×44 pt; padding must produce real hit area.
89
+ Use `.accessibilityLabel`, `.accessibilityValue`, `.accessibilityHint` (sparingly), `.accessibilityAddTraits`, `.accessibilityElement(children: .combine)`, `.accessibilityAction(named:)`, `.accessibilityAdjustableAction`, and `.accessibilitySortPriority`. Maintain ≥ `44×44 pt` hit targets with `.contentShape(Rectangle())` so visual padding actually receives touches. Verify VoiceOver focus order on device/simulator rather than assuming visual order.
90
+
91
+ ## States & forms idioms
92
+
93
+ Model view state as an explicit enum (`loading`, `loaded`, `empty`, `error`, `offline`) owned via `@Observable`, `@State`, `@Binding`, or `@Environment`. Preserve navigation path (`Codable` `NavigationPath`) and drafts across OS background termination (`@SceneStorage` / SwiftData / disk) and handle `.task` cancellation cleanly.
94
+
95
+ In forms and scrollable editors, attach **`.scrollDismissesKeyboard(.interactively)`** so users can drag the keyboard down smoothly with their thumb, and use `Form`, `LabeledContent`, `.keyboardType`, `.textContentType`, `.submitLabel`, `.autocorrectionDisabled`, and `.focused($field)` sequencing. Integrate system password autofill, Passkeys, and `SignInWithAppleButton` (`AuthenticationServices`) instead of blocking paste or custom-masking credentials.
39
96
 
40
- ## States idiom
97
+ ## The Composable Architecture (TCA)
41
98
 
42
- Model view state explicitly: loading/loaded/empty/error/permission/offline/optimistic. Keep state ownership clear through `@State`, `@Binding`, `@Observable`, environment ownership. Preserve state across backgrounding/process restoration where required. Pull-to-refresh/progress indicators must reflect actual lifecycle.
99
+ Adopt **TCA** (`ComposableArchitecture` 1.x+) when an Apple-platform app needs strict unidirectional state, cancellable async effect choreography, deep-linkable navigation trees, and deterministic unit test coverage—skip TCA for simple 1–2 screen utilities where SwiftUI `@Observable` suffices:
100
+
101
+ - Annotate features with `@Reducer` and `@ObservableState struct State: Equatable`, and bind directly in views using **`@Bindable var store: StoreOf<Feature>`** (`$store.query`, `store.send(.saveTapped)`).
102
+ - Drive modals and push stacks from state via **`@Presents var destination: Destination.State?`** (`@Reducer enum Destination`) or `StackState` / `NavigationStack(path:)` so deep links and state restoration stay deterministic.
103
+ - Verify async race conditions, debouncing, error paths, and navigation dismissals deterministically with **`TestStore`** and injected `@Dependency(\.continuousClock)` / client dependencies before visual QA.
104
+
105
+ ```swift
106
+ import ComposableArchitecture
107
+ import SwiftUI
108
+
109
+ @Reducer
110
+ struct InvoiceFeature {
111
+ @ObservableState
112
+ struct State: Equatable {
113
+ var filter = ""
114
+ var isSaving = false
115
+ @Presents var destination: Destination.State?
116
+ }
117
+
118
+ enum Action: BindableAction {
119
+ case binding(BindingAction<State>)
120
+ case saveTapped
121
+ case saveCompleted(Result<Void, Error>)
122
+ case destination(PresentationAction<Destination.Action>)
123
+ }
124
+
125
+ @Reducer
126
+ enum Destination {
127
+ case editor(InvoiceEditorFeature)
128
+ }
129
+
130
+ @Dependency(\.invoiceClient) var invoiceClient
131
+
132
+ var body: some ReducerOf<Self> {
133
+ BindingReducer()
134
+ Reduce { state, action in
135
+ switch action {
136
+ case .saveTapped:
137
+ state.isSaving = true
138
+ return .run { [filter = state.filter] send in
139
+ await send(.saveCompleted(Result { try await invoiceClient.save(filter) }))
140
+ }
141
+ case .saveCompleted:
142
+ state.isSaving = false
143
+ return .none
144
+ case .binding, .destination:
145
+ return .none
146
+ }
147
+ }
148
+ .ifLet(\.$destination, action: \.destination)
149
+ }
150
+ }
151
+
152
+ struct InvoiceView: View {
153
+ @Bindable var store: StoreOf<InvoiceFeature>
154
+
155
+ var body: some View {
156
+ Form {
157
+ TextField("Filter", text: $store.filter)
158
+ Button("Save") { store.send(.saveTapped) }
159
+ .disabled(store.isSaving)
160
+ }
161
+ .sheet(item: $store.scope(state: \.destination?.editor, action: \.destination.editor)) { editorStore in
162
+ InvoiceEditorView(store: editorStore)
163
+ }
164
+ }
165
+ }
166
+ ```
43
167
 
44
- ## Forms idiom
168
+ ## 2026 App Store submission, privacy & runtime gates
45
169
 
46
- Use `Form`, `LabeledContent`, keyboard type/text content type/submit labels/autocorrection settings, validation after meaningful completion, and input preservation. Secure fields/password autofill/passkeys should integrate with system behavior rather than custom blocking.
170
+ - **Xcode 26 SDK & `PrivacyInfo.xcprivacy`**: build against the current Xcode 26 iOS/iPadOS SDK and ship an accurate `PrivacyInfo.xcprivacy` declaring every first-party Required Reason API (`UserDefaults`, `FileTimestamp`, `SystemBootTime`, `DiskSpace`), collected data categories, and tracking domains—plus verify every third-party SPM/XCFramework dependency bundles its own signed privacy manifest.
171
+ - **Keychain-only credentials**: store OAuth/JWT access & refresh tokens, API secrets, and biometric keys exclusively in **Keychain** (`SecItemAdd` with `kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly`)—**never** in `UserDefaults`, `@AppStorage`, or unencrypted files.
172
+ - **Sign in with Apple & in-app Account Deletion**: include **`SignInWithAppleButton`** with equal visual prominence whenever any third-party social sign-in (Google, Meta, GitHub, LINE, Zalo) is offered; if users can create an account in-app, provide a discoverable **Delete Account** flow in Settings that confirms consequences and actually deletes/schedules deletion in-app (linking out to a support email or contact form triggers App Review rejection).
173
+ - **Zero-permission pickers & Settings recovery**: use SwiftUI **`PhotosPicker`** (`PhotosUI`) so single/multiple photo selection needs zero photo-library permission prompt; for camera/microphone/location/notifications, trigger the system prompt just-in-time on user intent, support `.limited` photo access gracefully, and render a calm inline `"Open Settings"` button (`UIApplication.openSettingsURLString`) when authorization is `.denied`.
174
+ - **`120fps` ProMotion & dSYM symbolication**: set **`CADisableMinimumFrameDurationOnPhone = true`** in `Info.plist` for `120 Hz` ProMotion animations (`< 8.33 ms`/frame), target `< 800 ms` cold start, and upload archive **dSYMs** automatically in CI to maintain `>= 99.5%` crash-free sessions.
47
175
 
48
176
  ## Do/don't pairs
49
177
 
50
178
  | Do | Don't |
51
179
  |---|---|
52
- | `Button("Save invoice") { save() }` | `Text("Save invoice").onTapGesture { save() }` as fake button |
53
- | `@Environment(\.dynamicTypeSize) private var typeSize` and adaptive layout | fixed-height row clipping accessibility text sizes |
54
- | `if reduceMotion { instantUpdate() } else { withAnimation(...) }` | large animated movement regardless of Reduce Motion |
55
- | `.accessibilityLabel("Delete \(invoice.name)")` | relying on a trash-can glyph as the only meaning |
56
- | `.safeAreaInset(edge: .bottom)` for persistent action | placing CTA underneath home indicator/keyboard |
180
+ | `Color(.semanticAction)` via Asset Catalog `ColorResource` | Scattered `Color(red: 0, green: 0.45, blue: 0.79)` literals |
181
+ | `Tab("Home", systemImage: "house") { ... }` + `TabSection` | Deprecated `.tabItem { Label(...) }` on iOS 18+ targets |
182
+ | `.font(.custom("Brand", size: 17, relativeTo: .body))` | `.font(.custom("Brand", fixedSize: 17))` ignoring Dynamic Type |
183
+ | Check `accessibilityReduceTransparency` & `colorSchemeContrast` around `.glassEffect` | Stack `.glassEffect` on reading cards or ignore Increase Contrast |
184
+ | Store tokens in Keychain, ship `PrivacyInfo.xcprivacy`, and wire real in-app Account Deletion + `SignInWithAppleButton` | Save JWTs in `@AppStorage`/`UserDefaults` or link "Delete Account" to a `mailto:` address |
185
+ | Use `PhotosPicker`, `.scrollDismissesKeyboard(.interactively)`, and `CADisableMinimumFrameDurationOnPhone = true` | Request full photo library access just for an avatar upload or cap animations at `60 Hz` on ProMotion iPhones |
186
+ | `ContentUnavailableView("No Invoices", systemImage: "doc")` + `.safeAreaInset(edge: .bottom)` | Blank white `List` on empty data or hard-coded bottom padding colliding with home indicator |
57
187
 
58
188
  ## Known traps
59
189
 
60
- GeometryReader layout loops, implicit animation explosions, hidden Keyboard avoidance differences, navigation stack state duplication, sheet/full-screen cover focus and dismissal, custom large-title mismatch, preview data mistaken for runtime state, dynamic type truncation, safe-area double padding, task cancellation/lifecycle confusion.
190
+ `GeometryReader` layout loops, implicit animation explosions, stacking glass-on-glass reducing legibility, `NavigationStack` path state duplication, `.task` re-firing on view identity changes, sheet/full-screen cover focus loss on dismiss, custom font fixed-size clipping, safe-area double padding, storing tokens in `UserDefaults`, missing SDK `PrivacyInfo.xcprivacy` manifests, preview fixtures mistaken for runtime persistence.
61
191
 
62
192
  ## Verification commands
63
193
 
64
194
  ```sh
65
- xcodebuild -scheme App -destination 'platform=iOS Simulator,name=iPhone 15' build
66
- xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=iPhone 15'
67
- xcrun simctl boot <device> 2>/dev/null || true
195
+ xcrun simctl list devices available
196
+ xcodebuild -scheme App -destination 'platform=iOS Simulator,name=<SimulatorName>' build
197
+ xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=<SimulatorName>'
68
198
  ```
69
199
 
70
- Use Xcode Previews, snapshot tests, simulator screenshots, Accessibility Inspector, VoiceOver, Dynamic Type sizes, dark mode, orientation/split-view runs for rendered evidence.
200
+ Use Xcode Previews, snapshot tests, and real simulator/physical-device runs (`>= 2` iOS devices including ProMotion) across Dynamic Type (`AX3` / `200%`), Dark Mode, Increase Contrast, Reduce Transparency, Reduce Motion, background termination restoration, and VoiceOver/Accessibility Inspector for `rendered` evidence. Compilation alone is `static` evidence; label untested physical devices or iOS versions `not-checked`.
@@ -0,0 +1,55 @@
1
+ # Mobile tactile interactions, sheets, and gestures
2
+
3
+ Use this reference alongside the target mobile framework guide (`swiftui.md`, `uikit.md`, `jetpack-compose.md`, `flutter.md`, `react-native-expo.md`, `lynxjs.md`) for high-craft touch ergonomics, bottom sheets, gestures, haptics, offline queues, and Dynamic Type/`sp` resilience.
4
+
5
+ ## Bottom sheet detents & cross-framework idioms
6
+
7
+ | Concern | Concrete rule |
8
+ |---|---|
9
+ | **Detents** | Define explicit resting heights (`medium`/`peek`, `large`, or content-fit) rather than arbitrary pixel stops; dismiss smoothly on downward velocity fling, backdrop tap, or Escape/Back. |
10
+ | **Scroll handover** | When a sheet wraps a scrollable list, upward drags scroll content once at the top detent, and downward drags at `scrollOffset == 0` hand control back to the sheet without stutter or double-scrolling. |
11
+ | **Keyboard & safe areas** | Pair scroll-coupled interactive keyboard dismissal with soft-keyboard inset tracking so sheet inputs and primary submit actions stay visible above the IME and home indicator / gesture bar. |
12
+ | **Velocity handover (`panVelocity`)** | Spring animations completing a sheet fling, card swipe, or detent snap **must** inherit the finger's release velocity (`initialVelocity` / `panVelocity`)—never restart from zero velocity on finger lift. |
13
+ | **Accessibility** | Always expose a visible Close/Done button (and screen-reader escape gesture) so users who cannot drag are never trapped inside a modal sheet. |
14
+
15
+ | Framework | Sheet & interactive keyboard primitive | Velocity handover & detent idiom |
16
+ |---|---|---|
17
+ | **SwiftUI** | `.sheet(isPresented:)` + `.scrollDismissesKeyboard(.interactively)` | `.presentationDetents([.medium, .large])`, `.presentationDragIndicator(.visible)`, `Spring(duration: 0.35, bounce: 0.1)` seeded with gesture velocity |
18
+ | **UIKit** | `UISheetPresentationController` + `scrollView.keyboardDismissMode = .interactive` | `detents = [.medium(), .large()]`, `UISpringTimingParameters(dampingRatio: 0.85, initialVelocity: velocityVector)` |
19
+ | **Jetpack Compose** | `ModalBottomSheet` + `WindowInsetsAnimationCompat` / `Modifier.imeNestedScroll()` | `rememberModalBottomSheetState()`, `Animatable.animateTo(target, spring(), initialVelocity = panVelocity)` |
20
+ | **Flutter** | `showModalBottomSheet` / `showCupertinoSheet` + `ScrollViewKeyboardDismissBehavior.onDrag` | `SpringSimulation(springDesc, currentPos, targetPos, panVelocity)` via `AnimationController.animateWith` |
21
+ | **React Native / Expo** | `@gorhom/bottom-sheet` + `keyboardDismissMode="interactive"` + `react-native-keyboard-controller` | Reanimated 4 `withSpring(target, { velocity: event.velocityY, damping: 22, stiffness: 240 })` on UI thread |
22
+ | **LynxJS** | Custom sheet `<view>` driven by MTS | Handle `main-thread:bindtouchmove` / `touchend` spring physics with release velocity on main thread; sync state via `runOnBackground` |
23
+
24
+ ## Performance physics: cold start, `120fps` ProMotion, memory leaks & energy
25
+
26
+ - **Cold start & install-size ceiling**: target **`< 800 ms–1.2 s`** (hard ceiling `< 2.0 s` TTID) on mid-tier hardware via Android **Baseline Profiles** (`androidx.profileinstaller`), lazy TurboModules, and deferred analytics/attribution SDK boot; enforce an agreed **install-size ceiling** (e.g., **`<= 50–80 MB`** store download via App Thinning, Android App Bundles `.aab`, and asset stripping).
27
+ - **`120fps` ProMotion & high-refresh parity**: unlock `120 Hz` animations on iOS by setting `<key>CADisableMinimumFrameDurationOnPhone</key><true/>` in `Info.plist`, and keep all scroll, sheet, shared-element, and keyboard-tracking animations strictly on the native UI/Render/Impeller thread (`< 8.33 ms` frame budget)—never couple scroll or pan frames to JS-bridge round-trips or main-thread JSON parsing.
28
+ - **20–30× flow repetition memory-leak & energy checks**: repeat the primary navigation/creation/sheet/camera flow **20–30× consecutively** under **`LeakCanary`** (Android) and **Xcode `Instruments` Allocations/Leaks** (iOS) verifying flat steady-state heap with zero retained `Activity`/`Fragment`/`UIViewController` leaks; verify **Xcode Energy Impact** and **Android Battery Historian / Studio Energy Profiler** show zero runaway wake locks, GPS polling, or background timer drain.
29
+
30
+ ## Thumb-zone ergonomics, gesture safety & cross-platform split
31
+
32
+ - Place high-frequency navigation and primary commitment actions in the lower reachable third on tall phones, reserving top bars for orientation, back navigation, and secondary overflow actions.
33
+ - Keep touch targets ≥ `44×44 pt` (iOS) / `48×48 dp` (Android) with **`>= 8 pt/dp` minimum spacing** between destructive actions and safe sibling controls, and always provide an **explicit visible `Close` button on bottom sheets**.
34
+ - **Zero custom horizontal swipe gestures inside OS back-gesture edge zones** (iOS left-edge swipe back, Android left+right predictive back edge gutters); inset horizontal carousels/sliders or provide explicit Previous/Next buttons.
35
+ - **Documented shared-vs-platform-native UI split**: on cross-platform stacks (Flutter, React Native/Expo, Kotlin Multiplatform, `.NET MAUI`), explicitly document which surfaces share cross-platform UI and which render platform-native chrome (navigation bars, sheets, pickers, share/auth dialogs, haptics, Live Activities/Widgets) so neither OS feels like a foreign port.
36
+
37
+ ## 4-tier contextual haptics (restraint over noise)
38
+
39
+ Trigger haptics strictly across four semantic tiers—**never** buzz on routine button taps, tab switches, or list scrolling:
40
+
41
+ | Tier & moment | SwiftUI | Jetpack Compose | Flutter | React Native / Expo | LynxJS |
42
+ |---|---|---|---|---|---|
43
+ | **1. Light selection tick** (wheel, scrub, detent snap) | `.sensoryFeedback(.selection, trigger:)` | `performHapticFeedback(HapticFeedbackConstants.SEGMENT_TICK)` | `HapticFeedback.selectionClick()` | `Haptics.selectionAsync()` (`expo-haptics`) | Host native selection tick at threshold |
44
+ | **2. Crisp state toggle** (switch flip, pin/lock, long-press) | `.sensoryFeedback(.impact(weight: .light), trigger:)` | `HapticFeedbackConstants.CLOCK_TICK` / `CONTEXT_CLICK` | `HapticFeedback.lightImpact()` | `Haptics.impactAsync(ImpactFeedbackStyle.Light)` | Host native light impact via MTS |
45
+ | **3. Success confirmation** (payment settled, check-in done) | `.sensoryFeedback(.success, trigger:)` | `HapticFeedbackConstants.CONFIRM` | `HapticFeedback.mediumImpact()` | `Haptics.notificationAsync(NotificationFeedbackType.Success)` | Host native confirm notification |
46
+ | **4. Warning / error double-tap** (invalid code, hard limit, failed scan) | `.sensoryFeedback(.warning / .error, trigger:)` | `HapticFeedbackConstants.REJECT` | `HapticFeedback.vibrate()` / distinct double `heavyImpact()` | `Haptics.notificationAsync(NotificationFeedbackType.Warning / Error)` | Host native reject double-pulse |
47
+
48
+ Honor system haptic and reduced-motion preferences; degrade silently on hardware without a linear resonant actuator, and never use haptics as the sole confirmation without visible/accessible feedback.
49
+
50
+ ## Swipe-to-act, OS process-death, rollout gates & 3-tier device deliverables
51
+
52
+ - Every swipe action on a list row (archive, pin, delete) must also be reachable via row detail, context menu, or accessibility custom actions (SwiftUI `.accessibilityAction(named:)`, Compose `CustomAccessibilityAction`, Flutter `Semantics(customSemanticsActions:)`, RN `accessibilityActions`), paired with an immediate `Undo` snackbar above the home indicator / tab bar.
53
+ - **Survive OS background process death**: mobile OSes routinely evict backgrounded apps under camera/game RAM pressure. Test explicitly with `adb shell am kill <package>` (while backgrounded) and Xcode background termination—restoring route stack, selected entity IDs, scroll context, and dirty form drafts via `SavedStateHandle` + `rememberSaveable`, `@SceneStorage` / SwiftData, `NSUserActivity`, `RestorationMixin`, or persisted router state.
54
+ - **Offline queue, crash-free bar & staged rollout / force-update gate**: persist queued offline writes with visible `Pending sync` + retry/conflict UI; maintain **`>= 99.5%` crash-free sessions** and **`0` ANRs** backed by automated CI uploads of iOS **dSYMs** and Android **R8/ProGuard mappings + NDK symbols**; ship **staged store rollouts** (`1% → 5% → 20% → 100%`) plus a server-driven **force-update / minimum-supported-version gate** so breaking API migrations fail safely with an upgrade prompt rather than crashing older binaries.
55
+ - **3-tier real-device matrix & required deliverables**: verify at default and **`200%` (`AX3+`)** font scales across **(iOS)** `compact 4.7–5.4"` + `standard` + `Pro Max/Plus` and **(Android)** `low-RAM 3–4 GB` + `mid-tier` + `flagship` (spanning Pixel + Samsung One UI + Xiaomi/OPPO OEM skins) across **both oldest and newest supported OS versions**, delivering frame/startup/memory/energy profiler traces, install-size report, crash-free symbolication proof, and **VoiceOver + TalkBack** screen-reader walkthrough recordings (`rendered`).
@@ -1,5 +1,85 @@
1
1
  # Task-state composition on mobile
2
2
 
3
- When the activity itself carries the visual identity, keep one task-bearing object recognizable across setup, active work and completion: a recording preview, a session clock, or the object being earned or built. Change the controls around that object to fit the stage rather than presenting the same ornamental card at each step. Keep remaining time, recording state or progress readable without relying on the illustration or motion.
3
+ When an activity carries the screen's identity (workout timer, audio/video recorder, delivery tracker, transit ride, focus session, voice memo), keep **one persistent task-bearing object** recognizable across **setup → active → complete** rather than swapping disconnected ornamental cards at each step.
4
4
 
5
- Distinguish the next meaningful action from optional extras at completion; do not put the reward, upsell or celebration between a user and their result. For a tool with a live preview, fit the active capture controls and the current state in reach before showing the full editing toolset. Verify the state, stop or resume control, and draft outcome from one-handed use and after an interruption. Store screenshots may suggest this composition; they do not verify focus, interruption, motion or actual task behavior.
5
+ ## Stage progression around one task object
6
+
7
+ | Stage | Persistent object behavior | Controls & hierarchy |
8
+ |---|---|---|
9
+ | **Setup** | Preview the live subject (camera frame, configured duration, selected route, draft waveform) at primary scale. | Limit setup to the 1–3 choices required to start; tuck advanced parameters into a sheet. Put the primary Start control in the lower thumb zone. |
10
+ | **Active** | Keep the same object anchored and legible at a glance; numeric state (elapsed/remaining time, recording indicator, distance, upload progress) must stay readable without relying on animation or illustration. | Swap setup controls for in-flight actions only (Pause/Resume, Lap/Marker, Stop). Guard destructive Discard/Cancel behind a confirmation or hold/slide gesture. |
11
+ | **Complete** | Show the finished artifact or summary in the same visual anchor before secondary rewards. | Put the next meaningful action (Save, Share, Export, Start Next) first. Never trap the user behind a mandatory celebration modal, rating prompt, or upsell before reaching their result. |
12
+
13
+ For live-capture tools (camera, audio, scanner), keep active capture controls and recording status in one-handed reach during capture; reveal the full editing toolset only after capture completes.
14
+
15
+ ## Persistent OS surfaces: Live Activities & Live Updates
16
+
17
+ Long-running tasks leave the foreground constantly. Mirror live state onto OS lock-screen and status surfaces instead of forcing users to unlock and reopen the app:
18
+
19
+ - **iOS Live Activities & Dynamic Island (`ActivityKit`)**: define `ActivityAttributes` (static metadata) and `ContentState` (dynamic state), update via `Activity.update(_:)` with an explicit `staleDate` so expired timers/ETAs visibly mark themselves stale rather than showing frozen lies, and end cleanly with `.immediate` or `.after(Date)` dismissal policy. Provide compact leading/trailing, minimal, expanded, and Lock Screen layouts with text equivalents for VoiceOver.
20
+
21
+ ```swift
22
+ import ActivityKit
23
+
24
+ struct SessionAttributes: ActivityAttributes {
25
+ public struct ContentState: Codable, Hashable {
26
+ var endDate: Date
27
+ var isPaused: Bool
28
+ }
29
+ var label: String
30
+ }
31
+
32
+ let content = ActivityContent(
33
+ state: .init(endDate: targetEnd, isPaused: false),
34
+ staleDate: targetEnd.addingTimeInterval(60)
35
+ )
36
+ let activity = try Activity.request(attributes: .init(label: "Focus"), content: content)
37
+ ```
38
+
39
+ - **Android Foreground Service & Android 16 Live Updates**: run ongoing user-initiated work in a declared `foregroundServiceType` (`microphone`, `location`, `mediaPlayback`, `dataSync`, etc.) with a persistent notification carrying a Pause/Stop `PendingIntent`. On Android 16 (API 36+), use progress-centric **Live Updates** (`Notification.ProgressStyle` + `setRequestPromotedOngoing(true)` with `POST_PROMOTED_NOTIFICATIONS`) for time-bounded user-tracked journeys (rides, deliveries, timers) so progress stays visible on the lock screen and status chip.
40
+
41
+ ```kotlin
42
+ val style = Notification.ProgressStyle()
43
+ .setProgress(elapsedMinutes)
44
+ .setProgressSegments(listOf(Notification.ProgressStyle.Segment(totalMinutes)))
45
+
46
+ val notification = Notification.Builder(context, CHANNEL_ACTIVE_TASK)
47
+ .setSmallIcon(R.drawable.ic_timer)
48
+ .setContentTitle("Focus session")
49
+ .setOngoing(true)
50
+ .setStyle(style)
51
+ .build()
52
+ ```
53
+
54
+ ## Wake-lock & interruption resumption
55
+
56
+ Interruption (phone call, OS memory kill, screen lock, audio route change, switching apps) is normal mobile behavior—not an edge case:
57
+
58
+ - **Persist timestamps, not tick counters**: record monotonic or wall-clock start/pause checkpoints (`SystemClock.elapsedRealtime()` + persisted epoch) and draft media chunks to storage on every state transition. Recompute remaining time on resume so backgrounding or process death never drifts or resets progress.
59
+ - **Scope wake-locks tightly**: acquire `UIApplication.shared.isIdleTimerDisabled = true` (iOS) or `WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON` / timeout-bounded `PowerManager.WakeLock` (Android) only while active foreground monitoring requires it, and always release on pause, completion, or `onStop`.
60
+ - **Idempotent stop & save**: guard Stop/Complete handlers against double-taps, notification action + in-app button races, and background audio interruptions; auto-save partial recordings rather than discarding them on incoming calls.
61
+
62
+ ## One-handed reach & ergonomics
63
+
64
+ - Anchor Start, Pause/Resume, and Stop inside the lower reachable third above the home indicator / gesture bar (`safeAreaInset` / `navigationBarsPadding`).
65
+ - Separate destructive actions (`Discard`) from primary actions (`Pause` / `Done`) by at least `8 pt/dp` or move `Discard` into a confirmation dialog / secondary corner.
66
+ - Keep touch targets ≥ `44×44 pt` (iOS) / `48×48 dp` (Android) even when a timer or waveform shrinks at `200%` text scaling.
67
+
68
+ ## Do/don't pairs
69
+
70
+ | Do | Don't |
71
+ |---|---|
72
+ | Keep one recognizable task object anchored across setup, active, and complete stages | Replace the whole screen with unrelated decorative cards on every state change |
73
+ | Show textual + numeric state (`Recording 02:14`) alongside visual indicators | Rely solely on a pulsing red dot or animated waveform to signal active capture |
74
+ | Persist start checkpoints and draft buffers so process death resumes cleanly | Keep timer/recording state only in view-local `@State` / `remember` |
75
+ | Set `staleDate` on Live Activities and clear foreground notifications on finish | Leave orphaned "2 min left" Lock Screen widgets running hours after completion |
76
+ | Put Save/Share/Next ahead of badges or upsells on completion | Block access to the user's finished recording behind a celebratory paywall modal |
77
+
78
+ ## Verification checks
79
+
80
+ Test on a real device or simulator (`rendered`; mark unavailable hardware checks `not-checked`—App Store/Play Store screenshots never verify interruption, focus, or motion):
81
+
82
+ 1. Complete setup → active → pause → resume → complete **one-handed** on a tall phone at default and `200%` / AX3 text sizes (`rendered`).
83
+ 2. Background the app, trigger a simulated phone call or process death, and return: verify elapsed time, draft file integrity, and Stop/Resume controls match reality (`rendered`).
84
+ 3. Verify Live Activity / Dynamic Island (iOS) or Foreground Service / Live Update notification (Android) updates, responds to Stop/Pause actions, and dismisses cleanly on completion (`rendered`).
85
+ 4. Verify Reduced Motion replaces continuous pulsing/scrolling illustrations with stable numeric/text status (`rendered`).
@@ -2,57 +2,91 @@
2
2
 
3
3
  ## Token mapping
4
4
 
5
- Use asset catalog colors keyed by semantic role plus dynamic provider colors when needed:
5
+ Store light, dark, and high-contrast semantic colors in Asset Catalogs and reference them through generated `ColorResource` symbols (`UIColor(resource: .semanticAction)`) or dynamic trait providers (`UIColor { traits in ... }`). Keep spacing, corner radii, and motion constants in a typed semantic namespace—never duplicate raw RGB values across view controllers or cells.
6
6
 
7
7
  ```swift
8
- let action = UIColor(named: "Semantic/Action")
8
+ enum PCColor {
9
+ static let action = UIColor(resource: .semanticAction)
10
+ static let surface = UIColor(resource: .semanticSurface)
11
+ }
9
12
  ```
10
13
 
11
- Asset catalogs carry light/dark/high-contrast variants. Keep spacing/type constants in a typed semantic namespace; do not copy raw RGB values through view controllers/cells.
14
+ ## Trait changes & Swift 6 `@MainActor` isolation
12
15
 
13
- ## Layout and responsive idioms
16
+ `traitCollectionDidChange(_:)` is **deprecated (iOS 17+)**. Register explicit trait observers with **`registerForTraitChanges`** so updates run only for the traits you care about, and maintain **Swift 6 `@MainActor`** isolation on UIKit subclasses (avoiding `DispatchQueue.main.async` workarounds or `nonisolated` UI mutations):
14
17
 
15
- Use Auto Layout constraints, stack views, safe-area layout guides, trait collections, readable content guides, scroll view content layout guides, and collection/compositional layout intentionally. Avoid fixed frames except tightly controlled custom drawing/layout. Support multitasking/split-screen/orientation where target expects it.
18
+ ```swift
19
+ @MainActor
20
+ final class InvoiceViewController: UIViewController {
21
+ override func viewDidLoad() {
22
+ super.viewDidLoad()
23
+ registerForTraitChanges(
24
+ [UITraitPreferredContentSizeCategory.self, UITraitAccessibilityContrast.self]
25
+ ) { (self: Self, _) in
26
+ self.updateTypographyAndBorders()
27
+ }
28
+ }
29
+ }
30
+ ```
31
+
32
+ ## Layout, sheets, Liquid Glass, & SwiftUI interop
33
+
34
+ - Use Auto Layout constraints against `view.safeAreaLayoutGuide`, `readableContentGuide`, `keyboardLayoutGuide`, `UIStackView`, and `UICollectionViewCompositionalLayout`. Avoid fixed frames except controlled custom drawing.
35
+ - **iOS 26 Liquid Glass (`UIGlassEffect` / `UIGlassContainerEffect`)**: wrap floating controls and bars in `UIVisualEffectView(effect: UIGlassEffect())` (configuring `isInteractive` / `tintColor` where appropriate) and group adjacent glass views inside a `UIGlassContainerEffect` view. Always observe `UIAccessibility.reduceTransparencyStatusDidChangeNotification` and `UIAccessibility.darkerSystemColorsStatusDidChangeNotification` (`UIAccessibility.isReduceTransparencyEnabled` / `isDarkerSystemColorsEnabled`) to fall back to opaque high-contrast surfaces.
36
+ - **Modern modal sheets (`UISheetPresentationController.Detent`)**: declare explicit `.medium()`, `.large()`, or content-fitting `.custom(identifier:) { ctx in ... }` detents, set `prefersGrabberVisible = true`, configure `largestUndimmedDetentIdentifier` when background interaction is intentional, and expose a visible Close/Done button for non-drag accessibility.
37
+ - **Empty & loading states (`UIContentUnavailableConfiguration`)**: assign `contentUnavailableConfiguration` (`.empty()`, `.loading()`, `.search()`, with action button configuration) on `UIViewController` instead of toggling hidden placeholder subviews.
38
+ - **Embedding SwiftUI cells (`UIHostingConfiguration`)**: host complex responsive cell layouts inside `UICollectionViewCell` / `UITableViewCell` via `cell.contentConfiguration = UIHostingConfiguration { ... }` rather than maintaining parallel Auto Layout cell subclasses.
39
+
40
+ ```swift
41
+ var config = UIContentUnavailableConfiguration.empty()
42
+ config.text = "No Pending Invoices"
43
+ config.secondaryText = "New invoices will appear here when synced."
44
+ config.image = UIImage(systemName: "doc.text")
45
+ contentUnavailableConfiguration = config
46
+ ```
16
47
 
17
- ## Typography/custom fonts
48
+ ## Typography & Dynamic Type
18
49
 
19
- Use `UIFontMetrics` to scale custom/system fonts for Dynamic Type. Register custom fonts correctly and set `adjustsFontForContentSizeCategory` where appropriate. Layout must respond to trait collection/content size changes rather than truncating essential copy.
50
+ Scale every custom and system font via `UIFontMetrics(forTextStyle: .body).scaledFont(for: baseFont)` and set `adjustsFontForContentSizeCategory = true`. Configure `numberOfLines = 0` on essential labels and reflow horizontal `UIStackView` axes to `.vertical` at accessibility content-size categories.
20
51
 
21
- ## Motion/reduced motion
52
+ ## Motion & reduced motion
22
53
 
23
- Use UIView/CA animation intentionally. Check `UIAccessibility.isReduceMotionEnabled` and observe relevant notifications when behavior must adapt. Keep animations interruptible and provide non-motion state feedback. Do not rely on animation completion handlers for correctness without cancellation handling.
54
+ Use `UIViewPropertyAnimator` for interruptible animations and check `UIAccessibility.isReduceMotionEnabled` (observing `UIAccessibility.reduceMotionStatusDidChangeNotification`). Never rely on animation completion blocks for correctness without handling cancellation or interrupted transitions.
24
55
 
25
56
  ## Accessibility specifics
26
57
 
27
- Configure `accessibilityLabel`, `accessibilityValue`, `accessibilityHint` sparingly, traits, custom actions, adjustable behavior, accessibility elements ordering (`accessibilityElements`), notifications (`UIAccessibility.post(notification:argument:)`), and focus behavior. Verify hit regions at 44×44 pt or document platform exception.
58
+ Configure `accessibilityLabel`, `accessibilityValue`, `accessibilityHint` (sparingly), `accessibilityTraits`, `accessibilityCustomActions`, `accessibilityElements` order, and `UIAccessibility.post(notification: .announcement / .screenChanged, argument:)`. Verify touch hit areas are at least `44×44 pt` (expanding via `point(inside:with:)` when a visual glyph is smaller).
28
59
 
29
- ## States idiom
60
+ ## States, forms & 2026 App Store gates
30
61
 
31
- Use explicit view-state models rather than hiding/showing ad hoc controls. Diffable data sources need correct identity/reuse semantics. Preserve state across backgrounding/restoration and avoid duplicate operations when views reappear. Loading/empty/error/offline/permission states deserve designed content, not blank table/collection views.
62
+ Drive tables and collections with `UICollectionViewDiffableDataSource` / `UITableViewDiffableDataSource` using stable item identifiers—never rely on `reloadData()` to hide identity bugs. Reset reused cell state explicitly in `prepareForReuse()` or cell configuration handlers. Preserve route and draft state across OS background memory eviction via `NSUserActivity` and `UIWindowSceneDelegate` state restoration (`stateRestorationActivity(for:)`).
32
63
 
33
- ## Forms idiom
64
+ In forms and scrollable editors, set **`scrollView.keyboardDismissMode = .interactive`**, configure `keyboardType`, `textContentType`, `returnKeyType`, password autofill/passkeys, and pin bottom actions to `view.keyboardLayoutGuide.topAnchor`. Manage `becomeFirstResponder()` / `resignFirstResponder()` deliberately and validate after field completion rather than interrupting every keystroke.
34
65
 
35
- Use correct keyboard type, text content type, return key behavior, autocapitalization/autocorrection, password autofill/passkeys, scroll adjustment for keyboard, validation after completion, and input preservation. First responder management is interaction design, not incidental plumbing.
66
+ - **App Store privacy, security & compliance**: compile against the **Xcode 26 SDK**, ship `PrivacyInfo.xcprivacy` covering first-party code and every embedded SDK, store tokens solely in **Keychain** (never `UserDefaults`), include **Sign in with Apple** (`ASAuthorizationAppleIDButton`) alongside any third-party social login, ship real **in-app Account Deletion** (never a `mailto:` support link), use **`PHPickerViewController`** (and support `.limited` photo library authorization + `UIApplication.openSettingsURLString` recovery when camera/mic/location is denied), and enable **`CADisableMinimumFrameDurationOnPhone = true`** in `Info.plist` for `120fps` ProMotion responsiveness with `UISpringTimingParameters(dampingRatio:initialVelocity:)` velocity handover.
36
67
 
37
68
  ## Do/don't pairs
38
69
 
39
70
  | Do | Don't |
40
71
  |---|---|
41
- | `UIButton(configuration:)` or real control with target/action | tapping a plain `UILabel` as a fake control |
42
- | constraints to safe-area layout guide | hard-coded bottom padding copied from one device screenshot |
43
- | `UIFontMetrics.default.scaledFont(for:)` | fixed point font that ignores Dynamic Type |
44
- | prepare/reuse cells resetting state explicitly | stale images/selection/progress leaking through reuse |
45
- | VoiceOver order/name verification | assuming visual constraint order equals accessibility order |
72
+ | `registerForTraitChanges([UITraitUserInterfaceStyle.self])` | Overriding deprecated `traitCollectionDidChange(_:)` on iOS 17+ |
73
+ | `UIButton(configuration: .filled())` / `.glass()` | Adding `UITapGestureRecognizer` to a plain `UILabel` |
74
+ | Pin bottom CTA to `view.keyboardLayoutGuide.topAnchor` + `keyboardDismissMode = .interactive` | Manually parsing keyboard frame notifications with magic offsets |
75
+ | Use `PHPickerViewController`, Keychain storage, `PrivacyInfo.xcprivacy`, and real in-app Account Deletion | Use legacy `UIImagePickerController` for photo picking, save tokens in `UserDefaults`, or link account deletion to email |
76
+ | `contentUnavailableConfiguration = UIContentUnavailableConfiguration.empty()` | Toggling ad-hoc hidden empty-state views over a collection view |
77
+ | `UIFontMetrics.default.scaledFont(for:)` + `adjustsFontForContentSizeCategory` | Fixed point `UIFont(name:size:)` ignoring Dynamic Type |
78
+ | Check `isReduceTransparencyEnabled` around `UIGlassEffect` | Leave translucent glass unreadable under Reduce Transparency / Increase Contrast |
46
79
 
47
80
  ## Known traps
48
81
 
49
- Constraint ambiguity/performance, cell reuse state leakage, retain cycles in handlers, keyboard obstruction, safe-area mismatch, opaque view controller hierarchy state, trait collection changes ignored, modal presentation/navigation back inconsistency, restoration identifier misuse.
82
+ Auto Layout constraint ambiguity, cell reuse state leakage, retain cycles in trait/button closures (`[weak self]`), Swift 6 `@MainActor` sendability warnings silenced with unsafe `@unchecked Sendable`, keyboard obstruction, modal presentation dismissal skipping `viewWillAppear` on page-sheet parents, missing `UIGlassEffect` accessibility fallbacks, tokens leaked into `UserDefaults`, missing `CADisableMinimumFrameDurationOnPhone`.
50
83
 
51
84
  ## Verification commands
52
85
 
53
86
  ```sh
54
- xcodebuild -scheme App -destination 'platform=iOS Simulator,name=iPhone 15' build
55
- xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=iPhone 15'
87
+ xcrun simctl list devices available
88
+ xcodebuild -scheme App -destination 'platform=iOS Simulator,name=<SimulatorName>' build
89
+ xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=<SimulatorName>'
56
90
  ```
57
91
 
58
- Use simulator/device screenshots, View Debugger, Accessibility Inspector, VoiceOver, Dynamic Type, dark/high-contrast modes, rotation/split-screen, and network-link conditioning for evidence.
92
+ Inspect real simulator and physical-device builds (`>= 2` iOS devices) with View Debugger, Accessibility Inspector, VoiceOver, Dynamic Type (`AX3` / `200%`), Dark Mode, Increase Contrast, Reduce Transparency, background termination restoration, and rotation/split-screen for `rendered` evidence; compilation alone is `static`. Label untested hardware `not-checked`.