@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.
- package/.agents/plugins/marketplace.json +1 -1
- package/.antigravity-plugin/plugin.json +32 -0
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +15 -4
- package/.codex-plugin/plugin.json +45 -0
- package/.cursor-plugin/marketplace.json +17 -0
- package/.cursor-plugin/plugin.json +27 -0
- package/.devin-plugin/plugin.json +21 -0
- package/.github/plugin/marketplace.json +34 -0
- package/CHANGELOG.md +159 -0
- package/GEMINI.md +1 -0
- package/README.md +185 -328
- package/SECURITY.md +28 -0
- package/assets/pixelcraft-logo-128.png +0 -0
- package/assets/pixelcraft-logo-256.png +0 -0
- package/bin/pixelcraft.mjs +431 -23
- package/docs/ARCHITECTURE.md +40 -37
- package/docs/DESIGN-RATIONALE.md +51 -3
- package/docs/INSTALL.md +221 -0
- package/evals/README.md +16 -6
- package/evals/fixtures/3d-web-engineering.json +69 -0
- package/evals/fixtures/acceptance-checklist-rule03-gate.json +43 -0
- package/evals/fixtures/ai-ui-libraries.json +53 -0
- package/evals/fixtures/audio-visual-accessibility.json +69 -0
- package/evals/fixtures/auth-and-checkout-ui.json +53 -0
- package/evals/fixtures/brandkit-identity-governance.json +48 -0
- package/evals/fixtures/build-and-architecture.json +53 -0
- package/evals/fixtures/canvas-and-node-editors.json +53 -0
- package/evals/fixtures/chat-ai-exfiltration-ime-hitl-gate.json +43 -0
- package/evals/fixtures/completion-gate-scan-until-clean.json +44 -0
- package/evals/fixtures/component-systems.json +53 -0
- package/evals/fixtures/component-testing.json +53 -0
- package/evals/fixtures/constrained-voice-and-tv.json +43 -0
- package/evals/fixtures/creative-code-rendering.json +69 -0
- package/evals/fixtures/creative-reference-evidence.json +67 -0
- package/evals/fixtures/data-app-python-marimo.json +49 -0
- package/evals/fixtures/desktop-cpp-juce-audio.json +49 -0
- package/evals/fixtures/desktop-csharp-avalonia.json +49 -0
- package/evals/fixtures/desktop-native-workspace.json +48 -0
- package/evals/fixtures/desktop-python-anti-tkinter.json +49 -0
- package/evals/fixtures/document-prepress-pdfx4-tounicode.json +43 -0
- package/evals/fixtures/document-rust-typst-invoice.json +49 -0
- package/evals/fixtures/document-typst-and-print-css.json +43 -0
- package/evals/fixtures/email-mjml-dark-mode.json +49 -0
- package/evals/fixtures/email-outlook-and-plaintext.json +43 -0
- package/evals/fixtures/enterprise-data-ui.json +53 -0
- package/evals/fixtures/extended-tui-toolkits.json +53 -0
- package/evals/fixtures/extensions-mv3-and-vscode.json +43 -0
- package/evals/fixtures/file-upload-media-ui.json +53 -0
- package/evals/fixtures/forms-validation.json +53 -0
- package/evals/fixtures/game-go-ebitengine.json +49 -0
- package/evals/fixtures/game-godot-gdscript.json +49 -0
- package/evals/fixtures/game-ui-hud-and-engines.json +43 -0
- package/evals/fixtures/i18n-engineering.json +53 -0
- package/evals/fixtures/local-first-sync.json +53 -0
- package/evals/fixtures/lynxjs.json +53 -0
- package/evals/fixtures/maizzle-email.json +53 -0
- package/evals/fixtures/maps-geospatial.json +53 -0
- package/evals/fixtures/media-og-and-video-export.json +43 -0
- package/evals/fixtures/media-players.json +53 -0
- package/evals/fixtures/mobile-compose-16kb-foldable-store-gate.json +44 -0
- package/evals/fixtures/mobile-elixir-liveview-native.json +49 -0
- package/evals/fixtures/mobile-flutter-dynamic-type.json +49 -0
- package/evals/fixtures/mobile-harmonyos-arkui.json +49 -0
- package/evals/fixtures/mobile-jetpack-compose.json +49 -0
- package/evals/fixtures/mobile-swiftui-ios.json +49 -0
- package/evals/fixtures/motion-engineering.json +69 -0
- package/evals/fixtures/pdfjs-and-pptx.json +53 -0
- package/evals/fixtures/plan-discovery-interview.json +31 -0
- package/evals/fixtures/plan-grill-me-brainstorm-gate.json +49 -0
- package/evals/fixtures/reactive-data-apps.json +53 -0
- package/evals/fixtures/review-evidence-audit.json +43 -0
- package/evals/fixtures/rich-text-and-code-editors.json +53 -0
- package/evals/fixtures/scrollytelling-resilience.json +70 -0
- package/evals/fixtures/spatial-xr-comfort-and-platforms.json +43 -0
- package/evals/fixtures/state-architecture.json +53 -0
- package/evals/fixtures/styling-ecosystem.json +53 -0
- package/evals/fixtures/token-tooling.json +53 -0
- package/evals/fixtures/tui-go-bubbletea.json +49 -0
- package/evals/fixtures/tui-rust-ratatui-grapheme-paste-teardown.json +44 -0
- package/evals/fixtures/tui-rust-ratatui.json +49 -0
- package/evals/fixtures/ux-state-matrix-and-i18n.json +43 -0
- package/evals/fixtures/web-3d-engines.json +53 -0
- package/evals/fixtures/web-php-laravel-filament.json +49 -0
- package/evals/fixtures/web-ruby-viewcomponent-phlex.json +49 -0
- package/evals/pixelcraft-accessibility.md +17 -0
- package/evals/pixelcraft-craft.md +16 -0
- package/evals/pixelcraft-dataviz.md +3 -3
- package/evals/pixelcraft-direction.md +17 -0
- package/evals/pixelcraft-game-ui.md +3 -3
- package/evals/pixelcraft-mobile.md +3 -3
- package/evals/pixelcraft-patterns.md +16 -0
- package/evals/pixelcraft-plan.md +65 -3
- package/evals/pixelcraft-review.md +3 -3
- package/evals/pixelcraft-visual-qa.md +11 -5
- package/evals/pixelcraft-web.md +21 -3
- package/evals/pixelcraft.md +4 -4
- package/gemini-extension.json +3 -2
- package/install.ps1 +57 -11
- package/install.sh +82 -7
- package/package.json +32 -4
- package/plugin.json +6 -1
- package/scripts/build-adapters.mjs +11 -13
- package/scripts/run-evals.mjs +397 -0
- package/scripts/sync-docs.mjs +381 -0
- package/scripts/test-build-adapters.mjs +14 -1
- package/scripts/test-cross-platform-qa.mjs +359 -0
- package/scripts/test-distribution.mjs +86 -7
- package/scripts/test-export-tokens.mjs +259 -3
- package/scripts/test-finish-gate.mjs +133 -10
- package/scripts/test-installers.mjs +155 -6
- package/scripts/test-shoot.mjs +23 -1
- package/scripts/test-slop-scan.mjs +390 -3
- package/scripts/test-style-inventory.mjs +23 -0
- package/scripts/test-sync-docs.mjs +140 -0
- package/scripts/test-validate-skills.mjs +82 -4
- package/scripts/validate-skills.mjs +149 -3
- package/skills/pixelcraft/SKILL.md +67 -47
- package/skills/pixelcraft/references/design-brief.md +2 -2
- package/skills/pixelcraft/references/floor.md +36 -19
- package/skills/pixelcraft/references/report-template.md +25 -11
- package/skills/pixelcraft/references/stack-detection.md +138 -67
- package/skills/pixelcraft/references/surface-acceptance.md +33 -21
- package/skills/pixelcraft/references/workflow-checkpoints.md +49 -7
- package/skills/pixelcraft-accessibility/SKILL.md +34 -13
- package/skills/pixelcraft-accessibility/references/apg-patterns.md +13 -0
- package/skills/pixelcraft-accessibility/references/motion-canvas.md +57 -0
- package/skills/pixelcraft-accessibility/references/platforms.md +34 -6
- package/skills/pixelcraft-accessibility/references/verification.md +15 -10
- package/skills/pixelcraft-accessibility/references/wcag22-checks.md +38 -5
- package/skills/pixelcraft-brandkit/SKILL.md +42 -30
- package/skills/pixelcraft-brandkit/references/asset-pipeline.md +90 -50
- package/skills/pixelcraft-brandkit/references/brand-governance.md +29 -27
- package/skills/pixelcraft-brandkit/references/logo-methods.md +33 -34
- package/skills/pixelcraft-brandkit/references/prompt-template.md +53 -51
- package/skills/pixelcraft-brandkit/references/qa-checklist.md +7 -2
- package/skills/pixelcraft-brandkit/references/visual-modes.md +16 -16
- package/skills/pixelcraft-chat-ui/SKILL.md +31 -27
- package/skills/pixelcraft-chat-ui/references/agentic-workspace.md +66 -0
- package/skills/pixelcraft-chat-ui/references/ai-ui-libraries.md +259 -0
- package/skills/pixelcraft-chat-ui/references/conversation-design.md +12 -6
- package/skills/pixelcraft-chat-ui/references/mobile-business-platforms.md +58 -68
- package/skills/pixelcraft-chat-ui/references/slack-discord.md +60 -76
- package/skills/pixelcraft-constrained/SKILL.md +21 -20
- package/skills/pixelcraft-constrained/references/specialized-hardware.md +69 -45
- package/skills/pixelcraft-constrained/references/tv-wearables.md +123 -73
- package/skills/pixelcraft-constrained/references/voice-ui.md +86 -45
- package/skills/pixelcraft-craft/SKILL.md +29 -15
- package/skills/pixelcraft-craft/references/color.md +62 -6
- package/skills/pixelcraft-craft/references/layout.md +32 -0
- package/skills/pixelcraft-craft/references/motion.md +99 -12
- package/skills/pixelcraft-craft/references/typography.md +48 -9
- package/skills/pixelcraft-data-apps/SKILL.md +50 -31
- package/skills/pixelcraft-data-apps/references/ai-and-internal-data-apps.md +147 -0
- package/skills/pixelcraft-data-apps/references/dash.md +87 -31
- package/skills/pixelcraft-data-apps/references/evidence.md +41 -26
- package/skills/pixelcraft-data-apps/references/gradio.md +65 -27
- package/skills/pixelcraft-data-apps/references/julia-genie.md +64 -29
- package/skills/pixelcraft-data-apps/references/jupyter-widgets.md +65 -27
- package/skills/pixelcraft-data-apps/references/nicegui.md +73 -34
- package/skills/pixelcraft-data-apps/references/observable-framework.md +65 -27
- package/skills/pixelcraft-data-apps/references/panel.md +69 -23
- package/skills/pixelcraft-data-apps/references/r-shiny.md +104 -34
- package/skills/pixelcraft-data-apps/references/reactive-data-apps.md +186 -0
- package/skills/pixelcraft-data-apps/references/reflex.md +85 -31
- package/skills/pixelcraft-data-apps/references/shiny.md +84 -27
- package/skills/pixelcraft-data-apps/references/streamlit.md +73 -25
- package/skills/pixelcraft-dataviz/SKILL.md +21 -24
- package/skills/pixelcraft-dataviz/references/color-accessibility.md +2 -2
- package/skills/pixelcraft-dataviz/references/encoding-tables-dashboards.md +35 -25
- package/skills/pixelcraft-dataviz/references/libraries.md +165 -46
- package/skills/pixelcraft-dataviz/references/maps-geospatial.md +159 -0
- package/skills/pixelcraft-dataviz/references/realtime-graphs-maps-scale.md +58 -65
- package/skills/pixelcraft-desktop/SKILL.md +61 -39
- package/skills/pixelcraft-desktop/references/appkit.md +60 -26
- package/skills/pixelcraft-desktop/references/avalonia.md +65 -29
- package/skills/pixelcraft-desktop/references/cpp-gui.md +104 -27
- package/skills/pixelcraft-desktop/references/electron.md +68 -26
- package/skills/pixelcraft-desktop/references/go-gui.md +59 -30
- package/skills/pixelcraft-desktop/references/gtk.md +74 -31
- package/skills/pixelcraft-desktop/references/javafx-swing.md +54 -25
- package/skills/pixelcraft-desktop/references/qt-pyside-qml.md +57 -30
- package/skills/pixelcraft-desktop/references/rust-gui.md +59 -41
- package/skills/pixelcraft-desktop/references/tauri.md +80 -24
- package/skills/pixelcraft-desktop/references/uno-platform.md +42 -23
- package/skills/pixelcraft-desktop/references/winui-wpf.md +66 -26
- package/skills/pixelcraft-desktop/references/working-context.md +82 -3
- package/skills/pixelcraft-direction/SKILL.md +48 -82
- package/skills/pixelcraft-direction/references/creative-brainstorming.md +72 -0
- package/skills/pixelcraft-direction/references/direction-card.md +11 -1
- package/skills/pixelcraft-direction/references/direction-scoring.md +5 -1
- package/skills/pixelcraft-direction/references/motion-identity.md +67 -0
- package/skills/pixelcraft-direction/references/movements.md +3 -0
- package/skills/pixelcraft-direction/references/reference-analysis.md +37 -0
- package/skills/pixelcraft-direction/references/slop-fingerprints.md +32 -7
- package/skills/pixelcraft-document/SKILL.md +27 -23
- package/skills/pixelcraft-document/references/archetypes.md +27 -4
- package/skills/pixelcraft-document/references/pdf-tools.md +241 -81
- package/skills/pixelcraft-document/references/pdfjs-and-pptx.md +114 -0
- package/skills/pixelcraft-document/references/print-css.md +96 -43
- package/skills/pixelcraft-document/references/slides.md +123 -27
- package/skills/pixelcraft-email/SKILL.md +42 -20
- package/skills/pixelcraft-email/references/client-quirks.md +101 -33
- package/skills/pixelcraft-email/references/html-tables.md +83 -22
- package/skills/pixelcraft-email/references/maizzle.md +54 -0
- package/skills/pixelcraft-email/references/mjml.md +13 -11
- package/skills/pixelcraft-email/references/react-email.md +76 -34
- package/skills/pixelcraft-extensions/SKILL.md +32 -27
- package/skills/pixelcraft-extensions/references/browser-extensions.md +91 -17
- package/skills/pixelcraft-extensions/references/figma-office.md +97 -14
- package/skills/pixelcraft-extensions/references/ide-and-saas-plugins.md +125 -0
- package/skills/pixelcraft-extensions/references/raycast.md +90 -11
- package/skills/pixelcraft-extensions/references/vscode-webviews.md +91 -17
- package/skills/pixelcraft-game-ui/SKILL.md +45 -26
- package/skills/pixelcraft-game-ui/references/bevy.md +69 -31
- package/skills/pixelcraft-game-ui/references/godot.md +100 -27
- package/skills/pixelcraft-game-ui/references/hud-principles.md +50 -21
- package/skills/pixelcraft-game-ui/references/love2d.md +53 -27
- package/skills/pixelcraft-game-ui/references/monogame.md +45 -29
- package/skills/pixelcraft-game-ui/references/unity-ugui.md +109 -0
- package/skills/pixelcraft-game-ui/references/unity-ui-toolkit.md +69 -27
- package/skills/pixelcraft-game-ui/references/unreal-umg.md +53 -26
- package/skills/pixelcraft-game-ui/references/web-and-middleware-game-ui.md +122 -0
- package/skills/pixelcraft-handoff/SKILL.md +14 -13
- package/skills/pixelcraft-handoff/references/design-translation.md +40 -10
- package/skills/pixelcraft-handoff/references/motion-handoff.md +54 -0
- package/skills/pixelcraft-media/SKILL.md +20 -23
- package/skills/pixelcraft-media/references/banners-video.md +83 -65
- package/skills/pixelcraft-media/references/og-generation.md +110 -63
- package/skills/pixelcraft-media/references/social-cards.md +57 -58
- package/skills/pixelcraft-mobile/SKILL.md +53 -36
- package/skills/pixelcraft-mobile/references/dotnet-maui.md +62 -34
- package/skills/pixelcraft-mobile/references/flet.md +53 -26
- package/skills/pixelcraft-mobile/references/flutter.md +76 -32
- package/skills/pixelcraft-mobile/references/harmonyos-and-emerging-mobile.md +121 -0
- package/skills/pixelcraft-mobile/references/ionic-capacitor.md +48 -26
- package/skills/pixelcraft-mobile/references/jetpack-compose.md +92 -24
- package/skills/pixelcraft-mobile/references/kivy.md +54 -31
- package/skills/pixelcraft-mobile/references/kotlin-multiplatform.md +53 -27
- package/skills/pixelcraft-mobile/references/lynxjs.md +110 -0
- package/skills/pixelcraft-mobile/references/nativescript-and-skip.md +91 -0
- package/skills/pixelcraft-mobile/references/react-native-expo.md +66 -31
- package/skills/pixelcraft-mobile/references/swiftui.md +158 -28
- package/skills/pixelcraft-mobile/references/tactile-interactions.md +55 -0
- package/skills/pixelcraft-mobile/references/task-state-composition.md +82 -2
- package/skills/pixelcraft-mobile/references/uikit.md +57 -23
- package/skills/pixelcraft-patterns/SKILL.md +30 -13
- package/skills/pixelcraft-patterns/references/accessibility-resilience.md +29 -0
- package/skills/pixelcraft-patterns/references/ai-and-offline-patterns.md +54 -0
- package/skills/pixelcraft-patterns/references/auth-onboarding.md +32 -13
- package/skills/pixelcraft-patterns/references/billing-paywalls.md +40 -0
- package/skills/pixelcraft-patterns/references/command-workspace.md +56 -0
- package/skills/pixelcraft-patterns/references/commerce.md +35 -16
- package/skills/pixelcraft-patterns/references/communication.md +34 -15
- package/skills/pixelcraft-patterns/references/creative-tools.md +30 -17
- package/skills/pixelcraft-patterns/references/creative-web-composition.md +38 -0
- package/skills/pixelcraft-patterns/references/dashboard-admin.md +22 -18
- package/skills/pixelcraft-patterns/references/history-diff-undo.md +50 -0
- package/skills/pixelcraft-patterns/references/marketing.md +31 -19
- package/skills/pixelcraft-patterns/references/multi-tenant-rbac.md +47 -0
- package/skills/pixelcraft-patterns/references/narrative-systems.md +42 -0
- package/skills/pixelcraft-patterns/references/notifications-activity.md +57 -0
- package/skills/pixelcraft-patterns/references/pattern-selection.md +8 -2
- package/skills/pixelcraft-patterns/references/scheduling-kanban.md +47 -0
- package/skills/pixelcraft-patterns/references/scroll-implementation.md +37 -0
- package/skills/pixelcraft-patterns/references/settings.md +40 -12
- package/skills/pixelcraft-plan/SKILL.md +54 -18
- package/skills/pixelcraft-plan/references/discovery-interview.md +110 -0
- package/skills/pixelcraft-plan/references/grill-me-protocol.md +63 -0
- package/skills/pixelcraft-plan/references/plan-template.md +44 -9
- package/skills/pixelcraft-plan/references/repo-discovery.md +16 -9
- package/skills/pixelcraft-plan/references/stack-freshness.md +22 -5
- package/skills/pixelcraft-plan/references/stack-selection.md +65 -9
- package/skills/pixelcraft-review/SKILL.md +41 -19
- package/skills/pixelcraft-review/references/audit-report.md +20 -1
- package/skills/pixelcraft-review/references/heuristics.md +63 -18
- package/skills/pixelcraft-review/references/personas.md +41 -14
- package/skills/pixelcraft-review/references/polish.md +66 -26
- package/skills/pixelcraft-review/scripts/check-acceptance.mjs +619 -0
- package/skills/pixelcraft-review/scripts/fixtures/focus-longhand-removal.css +34 -0
- package/skills/pixelcraft-review/scripts/slop-scan.mjs +679 -32
- package/skills/pixelcraft-spatial/SKILL.md +16 -17
- package/skills/pixelcraft-spatial/references/comfort-accessibility.md +25 -84
- package/skills/pixelcraft-spatial/references/platforms.md +123 -53
- package/skills/pixelcraft-tokens/SKILL.md +18 -14
- package/skills/pixelcraft-tokens/assets/tokens.example.json +1 -1
- package/skills/pixelcraft-tokens/assets/tokens.modes.example.json +1 -1
- package/skills/pixelcraft-tokens/references/format.md +39 -9
- package/skills/pixelcraft-tokens/references/governance.md +1 -1
- package/skills/pixelcraft-tokens/references/theme-presets.md +36 -8
- package/skills/pixelcraft-tokens/references/token-tooling.md +119 -0
- package/skills/pixelcraft-tokens/scripts/export-tokens.mjs +637 -75
- package/skills/pixelcraft-tui/SKILL.md +41 -25
- package/skills/pixelcraft-tui/references/bubbletea-lipgloss.md +49 -30
- package/skills/pixelcraft-tui/references/extended-tui-toolkits.md +127 -0
- package/skills/pixelcraft-tui/references/ink.md +77 -28
- package/skills/pixelcraft-tui/references/ratatui.md +70 -30
- package/skills/pixelcraft-tui/references/rich.md +53 -33
- package/skills/pixelcraft-tui/references/terminal-protocols.md +80 -0
- package/skills/pixelcraft-tui/references/textual.md +75 -34
- package/skills/pixelcraft-ux/SKILL.md +22 -12
- package/skills/pixelcraft-ux/references/feedback-performance.md +39 -19
- package/skills/pixelcraft-ux/references/forms.md +57 -3
- package/skills/pixelcraft-ux/references/i18n.md +50 -12
- package/skills/pixelcraft-ux/references/laws.md +35 -14
- package/skills/pixelcraft-ux/references/state-matrix.md +15 -1
- package/skills/pixelcraft-ux/references/ux-writing.md +1 -0
- package/skills/pixelcraft-visual-qa/SKILL.md +21 -7
- package/skills/pixelcraft-visual-qa/references/capture-desktop-game.md +28 -7
- package/skills/pixelcraft-visual-qa/references/capture-document.md +70 -0
- package/skills/pixelcraft-visual-qa/references/capture-email.md +13 -9
- package/skills/pixelcraft-visual-qa/references/capture-mobile.md +20 -5
- package/skills/pixelcraft-visual-qa/references/capture-terminal.md +6 -2
- package/skills/pixelcraft-visual-qa/references/motion-capture.md +63 -0
- package/skills/pixelcraft-visual-qa/references/performance-budgets.md +25 -12
- package/skills/pixelcraft-visual-qa/references/realtime-graphics.md +55 -0
- package/skills/pixelcraft-visual-qa/scripts/check-contrast.mjs +442 -0
- package/skills/pixelcraft-visual-qa/scripts/check-email.mjs +397 -0
- package/skills/pixelcraft-visual-qa/scripts/check-pdf.mjs +189 -0
- package/skills/pixelcraft-visual-qa/scripts/check-tui.mjs +321 -0
- package/skills/pixelcraft-visual-qa/scripts/finish-gate.mjs +50 -11
- package/skills/pixelcraft-visual-qa/scripts/shoot.mjs +214 -59
- package/skills/pixelcraft-visual-qa/scripts/style-inventory.mjs +121 -49
- package/skills/pixelcraft-web/SKILL.md +105 -49
- package/skills/pixelcraft-web/references/accessibility-performance.md +42 -0
- package/skills/pixelcraft-web/references/adaptive-layout.md +52 -8
- package/skills/pixelcraft-web/references/angular.md +63 -16
- package/skills/pixelcraft-web/references/assets-pipeline.md +67 -0
- package/skills/pixelcraft-web/references/astro.md +64 -13
- package/skills/pixelcraft-web/references/audio-reactive.md +61 -0
- package/skills/pixelcraft-web/references/auth-and-checkout-ui.md +115 -0
- package/skills/pixelcraft-web/references/build-and-architecture.md +215 -0
- package/skills/pixelcraft-web/references/canvas-and-node-editors.md +157 -0
- package/skills/pixelcraft-web/references/clojurescript.md +52 -17
- package/skills/pixelcraft-web/references/component-systems.md +102 -0
- package/skills/pixelcraft-web/references/component-testing.md +170 -0
- package/skills/pixelcraft-web/references/creative-effects.md +59 -0
- package/skills/pixelcraft-web/references/creative-runtime.md +34 -0
- package/skills/pixelcraft-web/references/enterprise-data-ui.md +138 -0
- package/skills/pixelcraft-web/references/file-upload-media-ui.md +82 -0
- package/skills/pixelcraft-web/references/forms-validation.md +123 -0
- package/skills/pixelcraft-web/references/fsharp-fable.md +3 -2
- package/skills/pixelcraft-web/references/gsap.md +102 -0
- package/skills/pixelcraft-web/references/html-css.md +144 -12
- package/skills/pixelcraft-web/references/htmx-alpine.md +68 -18
- package/skills/pixelcraft-web/references/i18n-engineering.md +106 -0
- package/skills/pixelcraft-web/references/interaction-and-search-primitives.md +196 -0
- package/skills/pixelcraft-web/references/java-web.md +27 -18
- package/skills/pixelcraft-web/references/kotlin-web.md +6 -2
- package/skills/pixelcraft-web/references/leptos-yew.md +62 -19
- package/skills/pixelcraft-web/references/lit-web-components.md +4 -2
- package/skills/pixelcraft-web/references/local-first-sync.md +105 -0
- package/skills/pixelcraft-web/references/media-players.md +104 -0
- package/skills/pixelcraft-web/references/motion-react.md +96 -0
- package/skills/pixelcraft-web/references/motion-recipes.md +82 -0
- package/skills/pixelcraft-web/references/preact-fresh-hono.md +111 -0
- package/skills/pixelcraft-web/references/pwa.md +6 -1
- package/skills/pixelcraft-web/references/qwik.md +51 -11
- package/skills/pixelcraft-web/references/r3f-integration.md +69 -0
- package/skills/pixelcraft-web/references/react-next.md +112 -13
- package/skills/pixelcraft-web/references/rendering-choice.md +63 -0
- package/skills/pixelcraft-web/references/rendering-performance.md +80 -0
- package/skills/pixelcraft-web/references/rich-text-and-code-editors.md +220 -0
- package/skills/pixelcraft-web/references/rive-lottie.md +73 -0
- package/skills/pixelcraft-web/references/scene-architecture.md +132 -0
- package/skills/pixelcraft-web/references/server-rendered.md +106 -63
- package/skills/pixelcraft-web/references/shader-workflow.md +77 -0
- package/skills/pixelcraft-web/references/smooth-scroll.md +58 -0
- package/skills/pixelcraft-web/references/solid.md +67 -16
- package/skills/pixelcraft-web/references/state-architecture.md +107 -0
- package/skills/pixelcraft-web/references/styling-ecosystem.md +273 -0
- package/skills/pixelcraft-web/references/svelte.md +61 -11
- package/skills/pixelcraft-web/references/tailwind.md +40 -14
- package/skills/pixelcraft-web/references/video-media.md +69 -0
- package/skills/pixelcraft-web/references/vue-nuxt.md +37 -13
- package/skills/pixelcraft-web/references/web-3d-engines.md +97 -0
|
@@ -1,62 +1,102 @@
|
|
|
1
|
-
# Ratatui
|
|
1
|
+
# Ratatui (Rust, 0.28–0.30+)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Lifecycle & panic-safe teardown (`ratatui::run` / `init` + `restore`)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Define semantic `Style`/`Color` constants or theme structs centrally:
|
|
5
|
+
Never leave a user's terminal trapped in raw mode or the alternate screen after an error or panic. On Ratatui 0.28+, use **`ratatui::init()`** paired with **`ratatui::restore()`** (or **`ratatui::run(|terminal| ...)`** on 0.30+), which automatically installs a panic hook that restores terminal state before printing the panic payload:
|
|
8
6
|
|
|
9
7
|
```rust
|
|
10
|
-
|
|
8
|
+
use ratatui::{
|
|
9
|
+
layout::{Constraint, Flex, Layout},
|
|
10
|
+
style::{Color, Modifier, Style},
|
|
11
|
+
DefaultTerminal, Frame,
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
pub struct PcTheme {
|
|
15
|
+
pub action: Style,
|
|
16
|
+
pub error: Style,
|
|
17
|
+
pub focused: Style,
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
impl Default for PcTheme {
|
|
21
|
+
fn default() -> Self {
|
|
22
|
+
Self {
|
|
23
|
+
action: Style::default().fg(Color::Cyan).add_modifier(Modifier::BOLD),
|
|
24
|
+
error: Style::default().fg(Color::Red).add_modifier(Modifier::BOLD),
|
|
25
|
+
focused: Style::default().fg(Color::Yellow).add_modifier(Modifier::REVERSED),
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
fn main() -> color_eyre::Result<()> {
|
|
31
|
+
ratatui::run(|terminal: &mut DefaultTerminal| app_loop(terminal))
|
|
32
|
+
}
|
|
11
33
|
```
|
|
12
34
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
## Layout and responsive idioms
|
|
35
|
+
## Token mapping & terminal capability respect
|
|
16
36
|
|
|
17
|
-
|
|
37
|
+
Define semantic `Style` / `Color` fields in one theme struct (defaulting to ANSI 16 named colors or mapping down cleanly when `NO_COLOR` is set or `COLORTERM` is absent) instead of scattering `Color::Rgb(...)` literals across widgets. Respect light and dark terminal backgrounds by avoiding hard-coded dark-only `Color::White` text over default terminal backgrounds—prefer `Color::Reset` for standard foreground/background cells.
|
|
18
38
|
|
|
19
|
-
##
|
|
39
|
+
## Layout (`Constraint::Fill` / `Flex`) & ecosystem crates
|
|
20
40
|
|
|
21
|
-
|
|
41
|
+
- Derive layout every frame from `frame.area()` using **`Constraint::Fill(weight)`**, `Constraint::Length`, `Constraint::Min`, `Constraint::Max`, and **`Flex`** (`Flex::SpaceBetween`, `Flex::Center`, `Flex::Start`, `Flex::Legacy`) instead of error-prone percentage math that leaves 1-cell gaps:
|
|
22
42
|
|
|
23
|
-
|
|
43
|
+
```rust
|
|
44
|
+
let [header, body, footer] = Layout::vertical([
|
|
45
|
+
Constraint::Length(2),
|
|
46
|
+
Constraint::Fill(1),
|
|
47
|
+
Constraint::Length(1),
|
|
48
|
+
])
|
|
49
|
+
.flex(Flex::Legacy)
|
|
50
|
+
.areas(frame.area());
|
|
51
|
+
```
|
|
24
52
|
|
|
25
|
-
|
|
53
|
+
- **Images in terminal cells (`ratatui-image`)**: use `ratatui-image` when displaying previews/thumbnails—it automatically probes and renders via Kitty Graphics, Sixel, iTerm2 inline images, or Unicode halfblock (`▀`/`▄`) fallback without crashing unsupported terminals.
|
|
54
|
+
- **Multi-line text input (`tui-textarea` / `edtui`)**: reuse mature editing crates for cursor movement, selection, undo/redo, and paste rather than hand-rolling byte-offset UTF-8 string slicing (which panics on multi-byte Unicode/CJK graphemes).
|
|
26
55
|
|
|
27
|
-
##
|
|
56
|
+
## Grapheme width (`UAX #29`), Bracketed Paste, `OSC 52` & 6-step teardown
|
|
28
57
|
|
|
29
|
-
|
|
58
|
+
- **Grapheme-cluster column width**: never use `str::len()` or `chars().count()` for cell alignment or cursor slicing. Segment text with **`unicode-segmentation`** (`s.graphemes(true)`) and compute column width with **`unicode-width`** (`UnicodeWidthStr::width`) so CJK (`2` cols), ZWJ emoji (`👨👩👧👦` = `2` cols), `VS16` (`⚠️` = `2` cols), and Vietnamese combining diacritics (`0` extra cols) never corrupt box borders; switch to `ratatui::symbols::border::ASCII` (`+--+`) when `--ascii`, `TERM=dumb`, or non-UTF-8 locale is active.
|
|
59
|
+
- **Bracketed Paste (`DECSET 2004`) & `OSC 52` clipboard**: enable `crossterm::event::EnableBracketedPaste` (`Event::Paste(String)`) so multi-line pastes into inputs never fire `KeyCode::Enter` per line; support copying via `arboard` locally plus **`OSC 52`** (`crossterm::clipboard::CopyToClipboard`) over SSH/`tmux`.
|
|
60
|
+
- **Complete 6-step panic & signal restoration**: whenever enabling mouse capture, bracketed paste, synchronized updates, or Kitty keyboard enhancement alongside `ratatui::init()`, ensure your `Drop` guard + panic hook + `tokio::signal` (`SIGINT`, `SIGTERM`, `SIGHUP`) handler executes all 6 steps ([terminal-protocols.md](terminal-protocols.md)): `?1049l` (leave alt screen), `?1000l/?1002l/?1003l/?1006l` (disable mouse), `?2004l` (disable bracketed paste), `?2026l` (end sync output), `\x1b[<u` (pop Kitty keyboard flags), and `?25h` + `disable_raw_mode()`.
|
|
61
|
+
- **Stream hygiene, `BrokenPipe`, & CLI packaging**: write TUI/spinners to `stderr` (or alt-screen only when `std::io::stdout().is_terminal()`), emit `--json`/`--plain` strictly to `stdout` while catching **`io::ErrorKind::BrokenPipe`** (`exit(0)` silently on `| head -n 5` instead of `.unwrap()` panicking!), use semantic exit codes (`0`, `1`, `2`, `130`), and generate `bash`/`zsh`/`fish`/`pwsh` completions + `man` pages via **`clap_complete`** and **`clap_mangen`** (`cargo-dist` / Homebrew / Winget / Scoop / Cargo).
|
|
30
62
|
|
|
31
|
-
|
|
63
|
+
Keep event polling (`crossterm::event::poll`) and tick intervals bounded so idle TUIs consume near-zero CPU. Manage async backend work on Tokio channels with explicit request IDs and cancellation (`CancellationToken`) so stale results never overwrite newer selections. Render explicit loading, empty, error, offline, and narrow-terminal fallback views into buffers—never leave blank black panes, and position the real terminal cursor (`frame.set_cursor_position(...)`) inside focused text inputs for assistive tools/IME.
|
|
32
64
|
|
|
33
|
-
|
|
65
|
+
## Snapshot & buffer verification (`TestBackend` + `insta`)
|
|
34
66
|
|
|
35
|
-
|
|
67
|
+
Test layout, narrow `80×24` collapse behavior, CJK/ZWJ/Vietnamese grapheme alignment, focus markers, and error states deterministically with **`TestBackend::new(width, height)`** and **`insta`** snapshots:
|
|
36
68
|
|
|
37
|
-
|
|
69
|
+
```rust
|
|
70
|
+
#[test]
|
|
71
|
+
fn renders_cleanly_at_80x24() {
|
|
72
|
+
let mut terminal = ratatui::Terminal::new(ratatui::backend::TestBackend::new(80, 24)).unwrap();
|
|
73
|
+
terminal.draw(|f| draw_ui(f, &App::sample())).unwrap();
|
|
74
|
+
insta::assert_snapshot!(terminal.backend());
|
|
75
|
+
}
|
|
76
|
+
```
|
|
38
77
|
|
|
39
78
|
## Do/don't pairs
|
|
40
79
|
|
|
41
80
|
| Do | Don't |
|
|
42
81
|
|---|---|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
| `
|
|
82
|
+
| Run `ratatui::run`/`restore` + full 6-step teardown (`?2004l`, `?1003l`, `\x1b[<u`) on panic & signals | Manual raw-mode setup leaving mouse capture, bracketed paste, or `CSI u` stuck after crashes |
|
|
83
|
+
| Measure/slice via `unicode-segmentation` + `unicode-width` + `border::ASCII` fallback | Slice UTF-8 strings by byte index or use `.len()` on CJK / `👨👩👧👦` / Vietnamese text |
|
|
84
|
+
| Enable `EnableBracketedPaste` (`Event::Paste`) and `OSC 52` SSH clipboard | Treat pasted newlines as accidental `Enter` confirmations |
|
|
85
|
+
| Catch `ErrorKind::BrokenPipe` on `--json`/`--plain` `stdout` writes and ship `clap_complete` + `man` pages | `.unwrap()` `writeln!(stdout)` so `mycli --plain \| head -n 5` panics with a backtrace |
|
|
86
|
+
| Centralize semantic `PcTheme` using `Color::Reset` + ANSI 16 dark/light-safe roles | Scatter `Color::Rgb(255, 255, 255)` unreadable on light terminals |
|
|
87
|
+
| Verify buffers across `80×24` and wide sizes with `TestBackend` + `insta` | Rely solely on `cargo build` or one wide manual glance |
|
|
48
88
|
|
|
49
89
|
## Known traps
|
|
50
90
|
|
|
51
|
-
|
|
91
|
+
Byte-index string slicing panicking on UTF-8/emoji/CJK/Vietnamese characters, forgetting `DisableBracketedPaste` / `PopKeyboardEnhancementFlags` on panic, `.unwrap()` panicking on `SIGPIPE`/`BrokenPipe`, hard-coding `Color::White` on light-background terminals, spinning a 0ms event loop burning 100% CPU, emitting alt-screen control codes when piped to `grep`/`jq`.
|
|
52
92
|
|
|
53
93
|
## Verification commands
|
|
54
94
|
|
|
55
95
|
```sh
|
|
56
96
|
cargo test
|
|
57
|
-
cargo
|
|
58
|
-
cargo
|
|
59
|
-
cargo run
|
|
97
|
+
cargo clippy --all-targets -- -D warnings
|
|
98
|
+
NO_COLOR=1 cargo run -- --help
|
|
99
|
+
cargo run -- --plain | head -n 5
|
|
60
100
|
```
|
|
61
101
|
|
|
62
|
-
|
|
102
|
+
`cargo test` (`TestBackend` / `insta` snapshots) and `cargo clippy` provide `static` and deterministic buffer evidence. Run the compiled binary in real dark and light terminals at `80×24`, `NO_COLOR=1`, `TERM=dumb`, `--ascii`, multi-line paste, and panic/interrupt recovery paths for `rendered` evidence; label untested emulators `not-checked`.
|
|
@@ -1,62 +1,82 @@
|
|
|
1
|
-
# Rich
|
|
1
|
+
# Rich (Python)
|
|
2
2
|
|
|
3
|
-
Rich is
|
|
3
|
+
Rich is a structured terminal rendering library—not a full-screen multi-pane application framework. Use it for CLI output, tables, panels, trees, syntax highlighting, Markdown, progress bars, and bounded live status displays. When an interface needs persistent panes, focus rings, or complex keyboard navigation, move to **Textual** (`references/textual.md`).
|
|
4
4
|
|
|
5
|
-
## Token mapping
|
|
5
|
+
## Token mapping (`rich.theme.Theme`) & stdout/stderr separation
|
|
6
6
|
|
|
7
|
-
Define semantic style
|
|
7
|
+
Define semantic style roles once with **`rich.theme.Theme`** and pass it to **`Console(theme=...)`**. Separate diagnostic/interactive UI (`Console(stderr=True)`) from machine-readable payload output on `stdout` so piping (`mycli list | jq`) never breaks on ANSI escape codes or spinner frames:
|
|
8
8
|
|
|
9
9
|
```python
|
|
10
|
-
|
|
10
|
+
from rich.console import Console
|
|
11
|
+
from rich.markup import escape
|
|
12
|
+
from rich.theme import Theme
|
|
13
|
+
|
|
14
|
+
PC_THEME = Theme({
|
|
15
|
+
"action": "bold #0074ca",
|
|
16
|
+
"success": "bold green",
|
|
17
|
+
"warning": "bold yellow",
|
|
18
|
+
"error": "bold red",
|
|
19
|
+
"muted": "dim",
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
out = Console(theme=PC_THEME) # primary output (auto-strips ANSI when piped)
|
|
23
|
+
err = Console(stderr=True, theme=PC_THEME) # progress, spinners, warnings, errors
|
|
24
|
+
|
|
25
|
+
filename = "report[2026].csv"
|
|
26
|
+
err.print(f"[action]Importing[/action] {escape(filename)}")
|
|
11
27
|
```
|
|
12
28
|
|
|
13
|
-
|
|
29
|
+
## Markup safety (`rich.markup.escape`)
|
|
14
30
|
|
|
15
|
-
|
|
31
|
+
Rich interprets `[...]` brackets in strings as style tags. Always wrap untrusted or dynamic strings (filenames, JSON snippets, array indices like `items[0]`, log lines) with **`rich.markup.escape(text)`**—or pass `markup=False` to `console.print(...)`—so brackets never swallow text or raise `MarkupError`.
|
|
16
32
|
|
|
17
|
-
|
|
33
|
+
## Layout, `rich.cells` width, & `--ascii` fallback
|
|
18
34
|
|
|
19
|
-
|
|
35
|
+
- Let Rich adapt tables and panels to `console.width` (`expand=False` or responsive `ratio`/`overflow="fold"`/`"ellipsis"`) rather than building fixed 120-column ASCII boxes, and measure custom padding with **`rich.cells.cell_len(text)`** (never `len(text)`, which miscounts `2`-col CJK, `👨👩👧👦` ZWJ emoji, `⚠️` `VS16`, and `0`-col Vietnamese combining diacritics).
|
|
36
|
+
- Switch tables/panels to **`rich.box.ASCII`** (`+--+`) and ASCII spinners (`spinner="line"`) when `--ascii`, `TERM=dumb`, or `legacy_windows` / non-UTF-8 encoding is active.
|
|
37
|
+
- Prefer ANSI 16 semantic color names (`cyan`, `green`, `yellow`, `red`, `default`) over hardcoded `#ffffff` or `#000000` so output stays legible on both dark and light terminal themes, pairing color with plain-text markers (`[OK]`, `[WARN]`, `[ERR]`) for `NO_COLOR=1` and screen readers.
|
|
20
38
|
|
|
21
|
-
|
|
39
|
+
## Stream hygiene, `BrokenPipeError`, progress, & CLI packaging
|
|
22
40
|
|
|
23
|
-
|
|
41
|
+
- **Strict `stdout` / `stderr` & silent `BrokenPipeError` exit**: run `Progress`, `Live`, spinners, and warnings exclusively on `Console(stderr=True)` (`refresh_per_second=4`–`10`, disabled automatically when `not err.is_terminal` or `CI=true`); emit `--json` / `--plain` data strictly to `sys.stdout` wrapped in a **`BrokenPipeError`** guard so `mycli list --plain | head -n 5` exits `0` silently without printing a Python traceback:
|
|
24
42
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
43
|
+
```python
|
|
44
|
+
import os
|
|
45
|
+
import sys
|
|
46
|
+
|
|
47
|
+
def flush_stdout_safely() -> None:
|
|
48
|
+
try:
|
|
49
|
+
sys.stdout.flush()
|
|
50
|
+
except BrokenPipeError:
|
|
51
|
+
devnull = os.open(os.devnull, os.O_WRONLY)
|
|
52
|
+
os.dup2(devnull, sys.stdout.fileno())
|
|
53
|
+
sys.exit(0)
|
|
54
|
+
```
|
|
36
55
|
|
|
37
|
-
|
|
56
|
+
- **Interrupts, semantic exit codes & distribution**: catch `KeyboardInterrupt` cleanly (stop `Progress`/`Live` so `?25h` cursor visibility restores, print cancelled summary to `stderr`, and exit **`130`**); use **`0`** for success, **`1`** for runtime errors, and **`2`** for CLI usage errors.
|
|
57
|
+
- **Prompts & packaging**: Rich's `Prompt.ask` / `Confirm.ask` fit short linear confirmations (prefer **`prompt_toolkit`** with Bracketed Paste `?2004h` for multi-line input—see [extended-tui-toolkits.md](extended-tui-toolkits.md)). Always provide non-interactive flags (`--yes`), `--help`, `--version`, **`bash`/`zsh`/`fish`/`pwsh` shell completions** (Typer/Click), a **`man` page**, and `uv tool` / Homebrew / Scoop / Winget packaging.
|
|
38
58
|
|
|
39
59
|
## Do/don't pairs
|
|
40
60
|
|
|
41
61
|
| Do | Don't |
|
|
42
62
|
|---|---|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
63
|
+
| Define 16-color-safe `Theme({...})` + `rich.cells.cell_len` + `box.ASCII` fallback | Hardcode `#ffffff` on assumed-black terminals or measure columns with Python `len()` |
|
|
64
|
+
| Escape dynamic strings with `rich.markup.escape(val)` or `markup=False` | Interpolate raw file paths or errors like `items[0]` into Rich markup |
|
|
65
|
+
| Put `Progress`, `Live`, and warnings on `Console(stderr=True)` and catch `BrokenPipeError` on `stdout` | Pollute piped `stdout` JSON with spinner ANSI codes or print `BrokenPipeError` on `\| head -n 5` |
|
|
66
|
+
| Emit plain line-based progress, `--json` mode, `0/1/2/130` exit codes, completions, and `man` page | Render cursor-rewriting live tables into CI log files or exit `0` on failures |
|
|
67
|
+
| Handle `KeyboardInterrupt` cleanly (`?25h` cursor restored, exit `130`) | Leave hidden cursors or raw Python tracebacks on `Ctrl+C` |
|
|
48
68
|
|
|
49
69
|
## Known traps
|
|
50
70
|
|
|
51
|
-
|
|
71
|
+
Unescaped `[...]` brackets throwing `MarkupError`, `Progress` written to `stdout` breaking `jq` pipes, uncaught `BrokenPipeError` tracebacks when piped to `head`, Python `len()` misaligning CJK/ZWJ/Vietnamese columns, `NO_COLOR=1` or light-terminal themes rendering status invisible.
|
|
52
72
|
|
|
53
73
|
## Verification commands
|
|
54
74
|
|
|
55
75
|
```sh
|
|
56
|
-
python -m pytest
|
|
57
76
|
python -m compileall .
|
|
58
|
-
python
|
|
59
|
-
NO_COLOR=1 python cli.py
|
|
77
|
+
python -m pytest
|
|
78
|
+
NO_COLOR=1 COLUMNS=80 python cli.py --help
|
|
79
|
+
python cli.py --plain | head -n 5
|
|
60
80
|
```
|
|
61
81
|
|
|
62
|
-
Inspect actual terminal
|
|
82
|
+
Unit tests and `Console(record=True, width=80, no_color=True)` string-capture fixtures provide repeatable `static`/snapshot evidence. Inspect actual dark and light terminal runs across `80`-column width, `NO_COLOR=1`, `--ascii`, piped `head -n 5`, and `Ctrl+C` interruption for `rendered` evidence; label untested emulators `not-checked`.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Terminal protocols & capability detection
|
|
2
|
+
|
|
3
|
+
Modern terminal emulators (Ghostty, Kitty, WezTerm, Alacritty, iTerm2, Windows Terminal, foot) support rich protocols that eliminate flicker, unlock crisp keyboard shortcuts, and enable graphics and clipboard integration over SSH. Every protocol is **progressive enhancement**—never assume universal emulator or multiplexer (`tmux`/`screen`) support.
|
|
4
|
+
|
|
5
|
+
## Modern terminal protocols
|
|
6
|
+
|
|
7
|
+
| Protocol | Sequence / contract | Purpose | Mandatory fallback & safety rule |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| **DEC Mode 2004** (Bracketed Paste) | Enable: `ESC [ ? 2004 h` · Disable: `ESC [ ? 2004 l` · Paste payload wrapped in `ESC [ 200 ~ ... ESC [ 201 ~` | Distinguishes pasted multi-line text from typed keystrokes. | **Mandatory** whenever reading raw/interactive input so pasting multi-line configs/SQL/commands never fires each newline as an accidental `Enter` submit! Always disable (`?2004l`) on exit. |
|
|
10
|
+
| **DEC Mode 2026** (Synchronized Output) | Begin: `ESC [ ? 2026 h` · End: `ESC [ ? 2026 l` (query via DECRQM `ESC [ ? 2026 $ p`) | Batches screen updates atomically so the terminal renders one complete frame with zero mid-frame tearing/flicker. | Safely ignored by older terminals; **always** emit `ESC [ ? 2026 l` on exit/panic so terminals never freeze waiting for end-of-frame. |
|
|
11
|
+
| **Graphics Protocols** (Kitty / Sixel / iTerm2) | Kitty `APC G ... ST` · Sixel `DCS q ... ST` · iTerm2 `OSC 1337 ; File=... BEL/ST` | Renders crisp thumbnails, charts, or previews inside character cells. | Probe support (or use `ratatui-image` / Chafa-style detection); degrade cleanly to **Unicode halfblocks (`▀`/`▄`)**, Braille, or an explicit text placeholder (`[Image: diagram.png]`) inside unsupported terminals or un-configured `tmux`/SSH. |
|
|
12
|
+
| **OSC 8 Hyperlinks** | `OSC 8 ; params ; URI ST label OSC 8 ; ; ST` | Makes labels clickable links in supporting terminals without cluttering narrow columns. | Never hide essential URLs behind `"click here"`—keep link text self-explanatory or print the raw URL in plain/`!isatty` output so piped logs and non-OSC-8 terminals still have the destination. |
|
|
13
|
+
| **Kitty Keyboard Protocol (`CSI u`)** | Push flags: `ESC [ > flags u` · Pop on exit: `ESC [ < u` | Disambiguates `Ctrl+I` vs `Tab`, `Ctrl+M` vs `Enter`, `Ctrl+[` vs `Esc`, `Shift+Enter`, and key release/repeat events. | Negotiate cleanly and **always pop (`ESC [ < u`) on exit/panic**; maintain legacy ANSI keybinding fallbacks so users on older terminals or basic SSH sessions can complete every task. |
|
|
14
|
+
| **OSC 52 Clipboard** | `OSC 52 ; c ; <base64-utf8> ST` | Copies text directly to the user's local clipboard even across remote SSH and `tmux` (`set-clipboard on`) without `pbcopy`/`xclip`/`wl-copy`. | Pair with local OS clipboard when running locally, respect emulator payload caps (~100 KB), handle security denial silently, and show visible copy confirmation. |
|
|
15
|
+
| **OSC 9;4 Progress** | `OSC 9 ; 4 ; <state> ; <0-100> ST` (`0`=clear, `1`=normal, `2`=error, `3`=indeterminate, `4`=paused) | Surfaces native taskbar/tab progress bars in Windows Terminal, Ghostty, WezTerm, and iTerm2. | Emit **only** to an interactive TTY and **always emit `state=0` (clear)** on completion, error exit, or `SIGINT` so stuck progress indicators never linger on the terminal tab. |
|
|
16
|
+
|
|
17
|
+
## Grapheme-cluster column width (`UAX #29`) & `--ascii` fallback
|
|
18
|
+
|
|
19
|
+
**Never** compute terminal column width with `.length`, `.len()`, `len()`, or UTF-16 code units—every border and table column will misalign on real international text:
|
|
20
|
+
|
|
21
|
+
- Segment by **Unicode Standard Annex #29 (`UAX #29`) extended grapheme clusters** + **East Asian Width**:
|
|
22
|
+
- **CJK ideographs** (`日本語` / `中文`) = **`2` cols** per character;
|
|
23
|
+
- **ZWJ Emoji sequences** (`👨👩👧👦`) = **`2` cols** total (not 8 or 11);
|
|
24
|
+
- **Variation Selector-16 (`VS16`, `U+FE0F`)** (`⚠️`) = **`2` cols**;
|
|
25
|
+
- **Vietnamese & combining diacritics** (e.g., `Nguyễn` NFD combining marks `U+0300`–`U+036F`) = **`0` extra cols**.
|
|
26
|
+
- Use proven width libraries per runtime: `unicode-segmentation` + `unicode-width` (Rust), `rivo/uniseg` / `go-runewidth` / `lipgloss.Width` (Go), `Intl.Segmenter` + `string-width` (Node/Bun), and `wcwidth` / `rich.cells.cell_len` (Python).
|
|
27
|
+
- **`--ascii` & non-UTF-8 locale fallback**: when `--ascii` is passed, `TERM=dumb`, or `LC_ALL`/`LANG` is `C`/`POSIX` (non-UTF-8), replace Unicode box-drawing (`╭─╮` → `+--+`), Braille spinners (`⠋` → `- \ | /`), and status glyphs (`✔`/`✖` → `[OK]`/`[ERR]`).
|
|
28
|
+
|
|
29
|
+
## 6-step panic & signal terminal restoration hook
|
|
30
|
+
|
|
31
|
+
Register a teardown hook covering normal exit, **`SIGINT`**, **`SIGTERM`**, **`SIGHUP`**, and uncaught **panics/exceptions** that executes all 6 restoration steps in order before writing any crash traceback:
|
|
32
|
+
|
|
33
|
+
1. **Leave alternate screen**: `\x1b[?1049l`
|
|
34
|
+
2. **Disable mouse tracking**: `\x1b[?1000l\x1b[?1002l\x1b[?1003l\x1b[?1006l`
|
|
35
|
+
3. **Disable bracketed paste**: `\x1b[?2004l`
|
|
36
|
+
4. **Disable synchronized output**: `\x1b[?2026l` (and clear `OSC 9;4` progress `\x1b]9;4;0;\x1b\\`)
|
|
37
|
+
5. **Pop Kitty keyboard protocol flags**: `\x1b[<u`
|
|
38
|
+
6. **Show cursor & exit raw mode**: `\x1b[?25h` + restore cooked `termios` / console mode.
|
|
39
|
+
|
|
40
|
+
## Capability, stream hygiene, `SIGPIPE`, color tiers & `--plain` screen-reader mode
|
|
41
|
+
|
|
42
|
+
| Signal / Condition | Required behavior |
|
|
43
|
+
|---|---|
|
|
44
|
+
| **Startup latency & live resize (`80×24` + `120×36`)** | Boot in **`< 200 ms`** (`hyperfine`/`time`) for compact CLIs/TUIs via lazy subcommand/plugin imports; reflow cleanly with **zero tearing/flicker** across **`80×24`** and **`120×36`** live `SIGWINCH` resizes. |
|
|
45
|
+
| **Stream separation (`stdout` vs `stderr`)** | Interactive TUI chrome, spinners, progress bars, and human warnings go strictly to `stderr` (or alternate screen only when `isatty(stdout)`). Machine-parseable payloads (`--json`, `--plain`, CSV) go strictly to `stdout`. |
|
|
46
|
+
| **Downstream pipe close (`SIGPIPE` / `EPIPE` / `BrokenPipeError`)** | Piping into `head -n 5` or `jq` closes `stdout` early. Catch `BrokenPipe` / `EPIPE` / `BrokenPipeError` and exit `0` **silently**—never print uncaught stack traces or panic dumps! |
|
|
47
|
+
| **`NO_COLOR=1` / `TERM=dumb` / `CI=true` / `--plain` screen-reader mode** | Strip ANSI colors (`NO_COLOR=1`), disable CSI/OSC escapes (`TERM=dumb`), disable interactive prompts (`CI=true`), and provide **`--plain`** (linear, non-animated, cursor-stable text output with explicit `[OK]`/`[ERR]` markers so terminal screen readers like NVDA, VoiceOver, and TDSR/Fenrir are never spammed by redrawing spinners). |
|
|
48
|
+
| **`16-color` + `256-color` + truecolor themes** | **Never** hardcode `#ffffff` assuming a black terminal or `#000000` assuming a white terminal. Verify graceful downgrade across `COLORTERM=truecolor`, `TERM=xterm-256color` (`256-color` palette), and **`16-color` dark + light ANSI themes**. |
|
|
49
|
+
|
|
50
|
+
## CLI & TUI distribution, `SHA-256` integrity & deliverables
|
|
51
|
+
|
|
52
|
+
Ship production terminal tools with complete operator ergonomics:
|
|
53
|
+
- **Standard flags & semantic exit codes**: `-h`/`--help`, `-V`/`--version`, `--json`, **`--plain`** (screen-reader non-animated mode), `--no-color`, `--ascii`; exit **`0`** on success, **`1`** on runtime/API failure, **`2`** on CLI usage/flag error, and **`130`** on `SIGINT` (`Ctrl+C`).
|
|
54
|
+
- **Shell completions & `man` page**: generate completions for **`bash`, `zsh`, `fish`, and `pwsh`** (`mycli completions <shell>`) plus a `roff` **`man` page** (`man 1 mycli`).
|
|
55
|
+
- **Checksums, signatures & clean uninstall**: publish **`SHA-256` (`SHA256SUMS`) checksums and cryptographic release signatures** (`cosign` / GPG / GitHub Attestations) across **Homebrew**, **Winget**, **Scoop**, **Cargo**, **npm**, or **PyPI**, paired with **documented uninstall instructions** removing binaries, completions, caches, and config files cleanly.
|
|
56
|
+
- **Required deliverable captures**: attach **`asciinema` (`.cast`) or Charm `VHS` recordings** plus rendered verification across **`iTerm2` / `Terminal.app`, `Windows Terminal`, `GNOME Terminal`, `tmux`, and `SSH`**.
|
|
57
|
+
|
|
58
|
+
## Do/don't pairs
|
|
59
|
+
|
|
60
|
+
| Do | Don't |
|
|
61
|
+
|---|---|
|
|
62
|
+
| Boot in `< 200 ms` (`hyperfine`), enable `?2004h` Bracketed Paste, and run the 6-step teardown on panic/signal | Ship a `1.5 s` CLI cold start, fire `Enter` on multi-line paste, or leave `?1049h`/`?1003h`/`CSI u` stuck after a crash |
|
|
63
|
+
| Measure columns with `UAX #29` grapheme + East Asian Width + `--ascii` fallback across `80×24` and `120×36` live resizes | Align borders with `.length`/`.len()`, breaking CJK, `👨👩👧👦`, `⚠️`, and Vietnamese diacritics |
|
|
64
|
+
| Route spinners to `stderr`, JSON/plain data to `stdout`, support `--plain` screen-reader mode, and exit silently on `SIGPIPE` | Spam screen readers with `60 Hz` Braille spinner redraws or dump a stack trace on `mycli list \| head -n 5` |
|
|
65
|
+
| Verify `16-color` (dark+light), `256-color`, and `NO_COLOR=1` legibility | Hardcode `#ffffff` text invisible on Solarized/macOS Light terminals |
|
|
66
|
+
| Ship `--help`, `--version`, `0/1/2/130` exit codes, completions, `man` page, `SHA-256` checksums/signatures, and uninstall docs | Exit `0` on errors or ship unsigned archives with no checksums or uninstall cleanup |
|
|
67
|
+
|
|
68
|
+
## Verification commands
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
# Benchmark < 200ms startup latency and test capability degradation / SIGPIPE:
|
|
72
|
+
hyperfine --warmup 3 'your-cli --version'
|
|
73
|
+
NO_COLOR=1 your-cli --help
|
|
74
|
+
TERM=xterm-256color your-cli --help
|
|
75
|
+
TERM=dumb your-cli --plain | head -n 5
|
|
76
|
+
# Verify stdout remains free of ANSI escape sequences when piped:
|
|
77
|
+
if your-cli --plain | LC_ALL=C grep -q $'\x1b\['; then echo "FAIL: ANSI leaked"; exit 1; fi
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Piped escape, `SHA-256` checksum, and `head -n 5` `SIGPIPE` checks provide deterministic `static`/output evidence. Record **`hyperfine`/`time` (`< 200 ms`)**, **`asciinema`/`VHS` walkthroughs**, `80×24` + `120×36` live resize, `16-color`/`256-color`/`NO_COLOR=1`/`--plain` modes, and 6-step panic restoration across **`iTerm2`/`Terminal.app`, `Windows Terminal`, `GNOME Terminal`, `tmux`, and `SSH`** (`rendered`; label unavailable host OS emulators `not-checked`).
|
|
@@ -1,67 +1,108 @@
|
|
|
1
|
-
# Textual
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
# Textual (Python)
|
|
2
|
+
|
|
3
|
+
## Token mapping & Textual v1–v3+ `Theme` API
|
|
4
|
+
|
|
5
|
+
Textual CSS (TCSS) uses **character cell units** (`1`, `2`, `1fr`, `50%`, `w`, `h`)—**never `px`** (pixel units are invalid in TCSS). Register semantic themes via the **`Theme`** API (`app.register_theme(...)`) and reference built-in semantic design variables (`$primary`, `$surface`, `$panel`, `$error`, `$text-muted`) across TCSS:
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from textual.app import App, ComposeResult
|
|
9
|
+
from textual.theme import Theme
|
|
10
|
+
|
|
11
|
+
PC_THEME = Theme(
|
|
12
|
+
name="pixelcraft-dark",
|
|
13
|
+
primary="#5BB2FF",
|
|
14
|
+
secondary="#7EE787",
|
|
15
|
+
accent="#D2A8FF",
|
|
16
|
+
foreground="#E6EDF3",
|
|
17
|
+
background="#0D1117",
|
|
18
|
+
surface="#161B22",
|
|
19
|
+
panel="#21262D",
|
|
20
|
+
error="#F85149",
|
|
21
|
+
dark=True,
|
|
22
|
+
)
|
|
23
|
+
```
|
|
8
24
|
|
|
9
25
|
```tcss
|
|
10
|
-
|
|
11
|
-
$space-control-inline:
|
|
26
|
+
/* Integer cell units only — never `px` */
|
|
27
|
+
$space-control-inline: 2;
|
|
12
28
|
|
|
13
|
-
Button {
|
|
14
|
-
background: $
|
|
29
|
+
Button.-primary {
|
|
30
|
+
background: $primary;
|
|
31
|
+
padding: 0 $space-control-inline;
|
|
15
32
|
}
|
|
16
33
|
```
|
|
17
34
|
|
|
18
|
-
|
|
35
|
+
Register the theme in `on_mount` (`self.register_theme(PC_THEME); self.theme = "pixelcraft-dark"`) so users can switch cleanly between light, dark, and high-contrast themes (including `textual-ansi` for 16-color/low-capability terminals).
|
|
36
|
+
|
|
37
|
+
## Layout, `CommandPalette`, & responsive idioms
|
|
19
38
|
|
|
20
|
-
|
|
39
|
+
Use `Vertical`, `Horizontal`, `Grid`, `Container`, `TabbedContent`, `DataTable`, `Dock`, fractional (`1fr`) and cell sizing, and terminal-size CSS/reactive breakpoints. Test at `80×24` minimum and define which secondary pane collapses first.
|
|
21
40
|
|
|
22
|
-
|
|
41
|
+
Expose keyboard-first command discovery through Textual's built-in **`CommandPalette`** (`Ctrl+P` by default) by adding custom `Provider` classes (`search` yielding `Hit` results) alongside concise `BINDINGS` displayed in `Footer`.
|
|
23
42
|
|
|
24
|
-
##
|
|
43
|
+
## Async workers (`@work(exclusive=True)`) & states idiom
|
|
25
44
|
|
|
26
|
-
|
|
45
|
+
Never block the Textual asyncio event loop with disk/HTTP calls. Isolate async or blocking work in **`@work`** methods with explicit `exclusive=True` (automatically cancelling superseded refreshes when the user changes filters or navigates) and `thread=True` for blocking SDK calls:
|
|
27
46
|
|
|
28
|
-
|
|
47
|
+
```python
|
|
48
|
+
from textual import work
|
|
49
|
+
from textual.worker import get_current_worker
|
|
29
50
|
|
|
30
|
-
|
|
51
|
+
class InvoiceApp(App):
|
|
52
|
+
@work(exclusive=True, thread=True)
|
|
53
|
+
def load_invoices(self, query: str) -> None:
|
|
54
|
+
worker = get_current_worker()
|
|
55
|
+
rows = fetch_blocking(query)
|
|
56
|
+
if not worker.is_cancelled:
|
|
57
|
+
self.call_from_thread(self.apply_rows, rows)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Handle loading (`LoadingIndicator`), empty, error, offline, and worker-cancelled states visibly in the widget tree; preserve user input across `push_screen` / `pop_screen` modal dialogs and terminal resizes.
|
|
31
61
|
|
|
32
|
-
##
|
|
62
|
+
## `UAX #29` width (`wcwidth`/`rich.cells`), Bracketed Paste, `OSC 52` & teardown
|
|
33
63
|
|
|
34
|
-
|
|
64
|
+
- **Grapheme width & `--ascii`**: never compute terminal column alignment with Python `len(s)`—use **`rich.cells.cell_len`** or **`wcwidth.wcswidth`** so CJK (`2` cols), ZWJ emoji (`👨👩👧👦` = `2` cols), `VS16` (`⚠️` = `2` cols), and Vietnamese combining diacritics (`0` extra cols) align cleanly; provide `textual-ansi` (16-color dark+light safe) and ASCII borders (`border: ascii`) when `--ascii`, `TERM=dumb`, or non-UTF-8 locale is set.
|
|
65
|
+
- **Bracketed Paste (`DECSET 2004`) & `OSC 52` clipboard**: handle Textual's **`events.Paste`** (`?2004h`) in `Input` / `TextArea` / custom widgets so multi-line pastes never fire accidental `Enter` submissions, and call **`self.copy_to_clipboard(text)`** (which emits **`OSC 52`** automatically over remote SSH/`tmux`).
|
|
66
|
+
- **Stream hygiene, `BrokenPipeError`, & 6-step crash restoration**: only boot the alternate-screen Textual app when `sys.stdout.isatty()`; for `--json`/`--plain` CLI modes, write strictly to `sys.stdout`, catch **`BrokenPipeError`** (`os.dup2(os.open(os.devnull, os.O_WRONLY), sys.stdout.fileno())` + `sys.exit(0)` so `| head -n 5` exits silently without a Python traceback!), and ensure `SIGINT`/`SIGTERM`/`SIGHUP` + uncaught exception hooks complete the 6-step terminal reset (`?1049l`, mouse `?1000l/?1002l/?1003l/?1006l`, `?2004l`, `?2026l`, `\x1b[<u`, `?25h` + raw mode exit—see [terminal-protocols.md](terminal-protocols.md)).
|
|
67
|
+
- **Accessibility & CLI distribution**: ensure every task works strictly via keyboard (`Tab`/`Shift+Tab`, arrow keys, `Enter`, `Esc`, `CommandPalette`), pair colors with plain-text state markers (`[ERR]`, `[*]`), and ship `--help`, `--version`, `0/1/2/130` exit codes, `bash`/`zsh`/`fish`/`pwsh` completions (via Typer/Click/argcomplete), a `man` page, and `uv tool` / Homebrew / Scoop / Winget packaging.
|
|
35
68
|
|
|
36
|
-
##
|
|
69
|
+
## Headless verification (`App.run_test()` / `Pilot` & SVG snapshots)
|
|
37
70
|
|
|
38
|
-
|
|
71
|
+
Drive real keyboard workflows and narrow-terminal resize checks deterministically using **`App.run_test()`** and **`Pilot`**, paired with **`pytest-textual-snapshot`** (`snap_compare`) SVG snapshots:
|
|
39
72
|
|
|
40
|
-
|
|
73
|
+
```python
|
|
74
|
+
import pytest
|
|
41
75
|
|
|
42
|
-
|
|
76
|
+
@pytest.mark.asyncio
|
|
77
|
+
async def test_narrow_keyboard_flow():
|
|
78
|
+
app = InvoiceApp()
|
|
79
|
+
async with app.run_test(size=(80, 24)) as pilot:
|
|
80
|
+
await pilot.press("ctrl+p")
|
|
81
|
+
await pilot.press("escape")
|
|
82
|
+
assert app.focused is not None
|
|
83
|
+
```
|
|
43
84
|
|
|
44
85
|
## Do/don't pairs
|
|
45
86
|
|
|
46
87
|
| Do | Don't |
|
|
47
88
|
|---|---|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
52
|
-
|
|
|
89
|
+
| Use cell units (`padding: 0 2;`), registered `Theme` vars, and `textual-ansi` / `border: ascii` fallbacks | Write web pixel units (`4px`) or hardcode `#ffffff` unreadable on light 16-color terminals |
|
|
90
|
+
| Measure columns with `rich.cells.cell_len` / `wcwidth`, handle `events.Paste`, and use `copy_to_clipboard` (`OSC 52`) | Use Python `len(s)` on CJK/`👨👩👧👦`/Vietnamese text or let pasted newlines fire `Enter` submits |
|
|
91
|
+
| Use `@work(exclusive=True)`, catch `BrokenPipeError` on `--plain`/`--json`, and verify 6-step signal reset | Block asyncio, dump `BrokenPipeError` tracebacks on `\| head -n 5`, or leave `?1049h`/`?1003h` stuck |
|
|
92
|
+
| Test keyboard flows with `App.run_test(size=(80, 24))` + `Pilot` & `snap_compare` | Rely only on manually glancing at one wide developer terminal |
|
|
93
|
+
| Pair `BINDINGS` + `Footer` + `CommandPalette` + CLI completions (`bash`/`zsh`/`fish`/`pwsh`) + `man` page | Hide essential commands behind mouse-only clicks or ship without `--version`/completions |
|
|
53
94
|
|
|
54
95
|
## Known traps
|
|
55
96
|
|
|
56
|
-
|
|
97
|
+
Invalid CSS `px` units in TCSS, blocking the asyncio loop with synchronous `requests` calls, Python `len()` miscounting CJK/ZWJ/combining marks, `BrokenPipeError` tracebacks on piped `--json` output, focus lost after closing `ModalScreen`, omitting non-interactive CLI fallback when piped in CI.
|
|
57
98
|
|
|
58
99
|
## Verification commands
|
|
59
100
|
|
|
60
101
|
```sh
|
|
61
|
-
python -m pytest
|
|
62
|
-
pytest --snapshot-update # only when intentionally updating
|
|
63
102
|
python -m compileall .
|
|
64
|
-
python
|
|
103
|
+
python -m pytest
|
|
104
|
+
NO_COLOR=1 python app.py --help
|
|
105
|
+
python app.py --plain | head -n 5
|
|
65
106
|
```
|
|
66
107
|
|
|
67
|
-
|
|
108
|
+
`compileall` and logic tests are `static`; `App.run_test`/`Pilot` and `snap_compare` SVGs verify headless rendering (`rendered` snapshot evidence). Also run in real dark and light terminal emulators at `80×24`, `TERM=dumb`/`NO_COLOR=1`, `--ascii`, multi-line paste, and piped `head -n 5` (`rendered`; label untested terminals `not-checked`).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: pixelcraft-ux
|
|
3
|
-
description: Designs rigorous user experience before and during implementation. Use for task analysis, JTBD, user flows, information architecture, navigation, forms, validation, empty/error/loading/offline states, feedback timing, perceived performance, cognitive-load reduction, localization-ready UX, UX writing, and interaction recovery
|
|
3
|
+
description: Designs rigorous user experience before and during implementation across any frontend stack. Use for task analysis, JTBD, user flows, information architecture, navigation, forms, passkeys, validation, empty/error/loading/offline and AI/streaming states, feedback timing, perceived performance, cognitive-load reduction, cognitive walkthrough, usability testing, localization-ready UX (i18n, RTL), UX writing, and interaction recovery.
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
version: 0.1.0
|
|
@@ -16,9 +16,9 @@ UX precedes styling. Establish user intent, task sequence, state coverage, and r
|
|
|
16
16
|
- Read [references/cognitive-walkthrough.md](references/cognitive-walkthrough.md) when judging first-use learnability or step-by-step task completion.
|
|
17
17
|
- Read [references/usability-testing.md](references/usability-testing.md) when behavioral uncertainty requires real-user evidence rather than inspection.
|
|
18
18
|
- Read [references/state-matrix.md](references/state-matrix.md) whenever data, network, permission, input, or async behavior exists.
|
|
19
|
-
- Read [references/forms.md](references/forms.md) for labels, validation, input preservation, autofill, paste, mobile keyboards, redundant entry,
|
|
19
|
+
- Read [references/forms.md](references/forms.md) for labels, validation, input preservation, autofill, paste, mobile keyboards, redundant entry, passkeys, cross-platform `IME` composition `Enter`/`Escape` guards, and error recovery.
|
|
20
20
|
- Read [references/feedback-performance.md](references/feedback-performance.md) for response-time limits, undo/destructive behavior, loading strategy, and perceived performance.
|
|
21
|
-
- Read [references/i18n.md](references/i18n.md) before layout/copy for
|
|
21
|
+
- Read [references/i18n.md](references/i18n.md) before layout/copy for `+30–40%` prose vs `+50–100%` short-label expansion, `Unicode NFC` & Vietnamese/stacked-diacritic glyph coverage, `IME` safety, RTL, and ICU/MF2 plurals.
|
|
22
22
|
- Read [references/locale-test-matrix.md](references/locale-test-matrix.md) when selecting concrete locales, scripts, fixtures, and rendering evidence for international verification.
|
|
23
23
|
- Read [references/ux-writing.md](references/ux-writing.md) for microcopy, actions, errors, empty states, and tone by mode.
|
|
24
24
|
- Read [references/laws.md](references/laws.md) when applying Hick, Fitts, Jakob, Doherty, recognition-over-recall, and cognitive-load evidence.
|
|
@@ -27,20 +27,30 @@ UX precedes styling. Establish user intent, task sequence, state coverage, and r
|
|
|
27
27
|
|
|
28
28
|
1. **Define job:** actor, triggering situation, desired outcome, constraints, success signal, frequency, expertise, locale/accessibility needs.
|
|
29
29
|
2. **Map task:** current steps, decision points, interruptions, handoffs, errors, and recovery. Remove steps before decorating them.
|
|
30
|
-
3. **
|
|
31
|
-
4. **
|
|
32
|
-
5. **Complete state matrix:** do not
|
|
33
|
-
6. **Design interaction copy and feedback:**
|
|
34
|
-
7. **Reduce cognitive load:** smart defaults, recognition, progressive disclosure, grouped decisions.
|
|
35
|
-
8. **
|
|
36
|
-
9. **
|
|
30
|
+
3. **Diverge IA & workflow (greenfield / redesign):** before locking one layout or navigation pattern, compare **2–3 competing flow/IA shapes** (e.g., master-detail workbench vs. stepped drawer vs. inline ledger; single-screen workspace vs. tabbed routes) against step count, context preservation, and recovery cost. Record why the rejected shapes lost. Skip only when existing product IA or an approved spec fixes the flow.
|
|
31
|
+
4. **Walk the task:** use the cognitive-walkthrough contract for first-use intent, visibility, association, and feedback; escalate behavioral uncertainty to real-user evidence instead of inventing validation.
|
|
32
|
+
5. **Complete the mandatory core state matrix:** do not build only the happy path. Explicitly specify and wire every applicable core state: **empty** (first-use + no-results), **loading** (stable skeleton/progress without layout shift), **error** (cause + preserved input + recovery action), **disabled** (why disabled + how to unlock), **offline / degraded network**, **permission / unauthorized**, **long-content / overflow / extreme counts**, and **AI / streaming** (pending, partial tokens, abort/stop, citation provenance, side-effect approval).
|
|
33
|
+
6. **Design interaction copy and feedback:** concrete domain verbs, response-time budgets, progress, undo/recovery; zero AI marketing clichés (`references/ux-writing.md`).
|
|
34
|
+
7. **Reduce cognitive load:** smart defaults, recognition over recall, progressive disclosure, grouped decisions.
|
|
35
|
+
8. **Apply logical layout, expansion budgets & `IME`/`NFC` safety by default:** use logical directional properties (`inline-start`/`inline-end`, leading/trailing), budget `+30–40%` prose and `+50–100%` short-label expansion, normalize `Unicode NFC` diacritics with verified glyph coverage (`ư, ơ, ệ`), guard `Enter`/`Escape` during active `IME` composition, and format dates/numbers/plurals via locale APIs **even on English-first apps**.
|
|
36
|
+
9. **Validate against platform conventions & record risks:** back/escape, scroll restoration, shortcuts, gestures, focus/controller behavior, and unresolved UX risks with evidence labels.
|
|
37
37
|
|
|
38
|
-
## Non-negotiable checks
|
|
38
|
+
## Non-negotiable checks & anti-slop guard
|
|
39
39
|
|
|
40
40
|
- Do not ask for information already available, inferable, previously entered, or low-value at the moment of use.
|
|
41
41
|
- Preserve user input across validation, navigation, authentication expiry, network failure, and accidental refresh where feasible.
|
|
42
|
+
- Guard `Enter`/`Escape` key handlers on search bars, chat composers, inline editors, and dialogs against active `IME` composition (`isComposing`, `markedTextRange`, `composition != null`, `hasMarkedText`).
|
|
42
43
|
- Every destructive action provides proportional undo, confirmation, or explicit irreversibility friction.
|
|
43
44
|
- Every async action exposes pending/success/failure/cancellation/retry semantics.
|
|
44
45
|
- Navigation state survives back/forward, refresh, deep link, logout/login, and app relaunch as appropriate.
|
|
45
46
|
- Primary tasks are operable without hover, memory of hidden commands, perfect network, or precise pointer control.
|
|
46
|
-
-
|
|
47
|
+
- **Anti-slop UX guard:** never ship a happy-path-only wireframe, dead-end `"No items yet"` empty state, `"Oops! Something went wrong"` error toast, vague `"Submit"`/`"Learn more"` buttons, AI hype microcopy, or half-wired forms that wipe entered values on validation failure.
|
|
48
|
+
|
|
49
|
+
## Pre-submit checklist
|
|
50
|
+
|
|
51
|
+
- [ ] 2–3 competing IA/workflow shapes compared and recorded for undecided greenfield/redesign flows (or existing/approved IA cited).
|
|
52
|
+
- [ ] All applicable core states specified and wired: `empty`, `loading`, `error`, `disabled`, `offline`, `permission`, `long-content`, and `AI/streaming`.
|
|
53
|
+
- [ ] User input preserved across errors and retries; `Enter`/`Escape` guarded during active `IME` composition; destructive actions have proportionate undo or confirmation.
|
|
54
|
+
- [ ] Logical layout direction (`inline-start`/leading), `+50–100%` short-label / `+30–40%` prose expansion, `Unicode NFC` diacritic glyph integrity, and locale-aware formatting applied.
|
|
55
|
+
- [ ] All CTAs, headings, errors, and empty states use concrete domain nouns/verbs with zero AI marketing clichés or fake proof.
|
|
56
|
+
- [ ] Primary task verified without hover, via keyboard/platform back-escape, and labeled honestly (`rendered`, `static`, `model-judgment`, or `not-checked`).
|