@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,53 +1,109 @@
|
|
|
1
1
|
# Plotly Dash
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
3
|
+
## Dash 3 runtime, theming, and component ecosystem
|
|
4
|
+
|
|
5
|
+
Dash 3 runs on **React 18**, replaces the removed `app.run_server()` with **`app.run()`**, and introduces **`dash.hooks`** for reusable plugin/layout/callback lifecycle extensions.
|
|
6
|
+
|
|
7
|
+
- **Token mapping**: Place semantic CSS variables in `assets/tokens.css` (auto-served by Dash) or configure **Dash Mantine Components (`dash_mantine_components` / `dmc.MantineProvider`)** with a typed theme object rather than duplicating inline `style={...}` dicts. Always synchronize Plotly figure templates (`layout.template`) with light/dark page tokens.
|
|
8
|
+
- **High-density tables**: Prefer **Dash AG Grid (`dash_ag_grid.AgGrid`)** over legacy `dash_table.DataTable` for virtualized sorting, filtering, pinned columns, accessible keyboard grid navigation, and numeric formatting.
|
|
9
|
+
- **Multipage apps**: Enable **Dash Pages** (`Dash(__name__, use_pages=True)`) with `dash.register_page(__name__, path="/cohorts", name="Cohorts")` and render `dash.page_container` inside one shared shell.
|
|
10
|
+
|
|
11
|
+
## Callbacks: Patch, clientside, background, and duplicate outputs
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
import dash
|
|
15
|
+
from dash import Dash, DiskcacheManager, Input, Output, Patch, State, callback, clientside_callback, dcc, html
|
|
16
|
+
import dash_mantine_components as dmc
|
|
17
|
+
import dash_ag_grid as dag
|
|
18
|
+
import diskcache
|
|
19
|
+
|
|
20
|
+
cache = diskcache.Cache("./.dash-cache")
|
|
21
|
+
app = Dash(__name__, use_pages=True, background_callback_manager=DiskcacheManager(cache))
|
|
22
|
+
|
|
23
|
+
app.layout = dmc.MantineProvider(
|
|
24
|
+
dmc.AppShell(
|
|
25
|
+
[
|
|
26
|
+
dmc.AppShellHeader(dmc.Group([dmc.Title("Ops Monitor", order=3), dmc.Switch(id="dark-toggle", label="Dark")])),
|
|
27
|
+
dmc.AppShellMain([
|
|
28
|
+
dmc.Button("Run heavy backfill", id="run-btn"),
|
|
29
|
+
dmc.Button("Cancel", id="cancel-btn", variant="outline"),
|
|
30
|
+
dmc.Progress(id="job-progress", value=0),
|
|
31
|
+
dcc.Graph(id="live-chart"),
|
|
32
|
+
dag.AgGrid(id="orders-grid", columnDefs=[{"field": "order_id"}, {"field": "amount"}], rowData=[]),
|
|
33
|
+
dash.page_container,
|
|
34
|
+
]),
|
|
35
|
+
]
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
# Partial update with Patch(): append a point without re-serializing the whole figure
|
|
40
|
+
@callback(Output("live-chart", "figure", allow_duplicate=True), Input("tick", "n_intervals"), prevent_initial_call=True)
|
|
41
|
+
def append_point(_):
|
|
42
|
+
patched = Patch()
|
|
43
|
+
patched["data"][0]["x"].append(next_ts())
|
|
44
|
+
patched["data"][0]["y"].append(next_value())
|
|
45
|
+
return patched
|
|
46
|
+
|
|
47
|
+
# Zero-roundtrip JS callback for instant UI responsiveness (theme switch, drawer toggle)
|
|
48
|
+
clientside_callback(
|
|
49
|
+
"checked => checked ? 'dark' : 'light'",
|
|
50
|
+
Output("mantine-provider", "forceColorScheme"),
|
|
51
|
+
Input("dark-toggle", "checked"),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
# Non-blocking background callback with cancellation and real progress
|
|
55
|
+
@callback(
|
|
56
|
+
Output("orders-grid", "rowData"),
|
|
57
|
+
Input("run-btn", "n_clicks"),
|
|
58
|
+
background=True,
|
|
59
|
+
running=[(Output("run-btn", "disabled"), True, False)],
|
|
60
|
+
cancel=[Input("cancel-btn", "n_clicks")],
|
|
61
|
+
progress=[Output("job-progress", "value")],
|
|
62
|
+
prevent_initial_call=True,
|
|
63
|
+
)
|
|
64
|
+
def run_backfill(set_progress, _n):
|
|
65
|
+
rows = []
|
|
66
|
+
for pct, batch in fetch_batches():
|
|
67
|
+
rows.extend(batch)
|
|
68
|
+
set_progress(pct)
|
|
69
|
+
return rows
|
|
70
|
+
|
|
71
|
+
if __name__ == "__main__":
|
|
72
|
+
app.run(debug=True)
|
|
73
|
+
```
|
|
20
74
|
|
|
21
|
-
Use
|
|
75
|
+
- Use `dash.hooks.layout(...)` / `dash.hooks.error(...)` to attach cross-cutting banners, telemetry, or global error handling cleanly across pages.
|
|
76
|
+
- Always pair `Output(..., allow_duplicate=True)` with `prevent_initial_call=True` (or `"initial_duplicate"`) and document which callbacks write to the same target.
|
|
22
77
|
|
|
23
|
-
##
|
|
78
|
+
## Typography, motion, and accessibility
|
|
24
79
|
|
|
25
|
-
|
|
80
|
+
Load custom fonts via `assets/` or `external_stylesheets` and configure `figure.layout.font` explicitly because Plotly SVGs do not inherit every page font role. Honor `prefers-reduced-motion` in `assets/*.css`. Use semantic HTML (`html.Main`, `html.Nav`, `html.Label`) or accessible `dmc` primitives, verify keyboard reach in AG Grid and modals, and pair Plotly charts with text summaries or expandable tables.
|
|
26
81
|
|
|
27
|
-
##
|
|
82
|
+
## States and forms idiom
|
|
28
83
|
|
|
29
|
-
|
|
84
|
+
Keep user/session state in `dcc.Store(storage_type="session" | "memory")` (never mutable module globals), bound payload size, and surface empty datasets, callback errors, and offline states visibly rather than leaving an infinite loading spinner. Use `State(...)` + an explicit Apply button for multi-filter expensive queries.
|
|
30
85
|
|
|
31
86
|
## Do/don't pairs
|
|
32
87
|
|
|
33
88
|
| Do | Don't |
|
|
34
89
|
|---|---|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
90
|
+
| `app.run(debug=True)` in Dash 3 | Removed `app.run_server(...)` |
|
|
91
|
+
| `Patch()` for incremental chart/grid mutations | Re-serializing megabyte figure dicts on every tick |
|
|
92
|
+
| `clientside_callback` for theme toggles and pure UI state | Round-tripping to Python just to open a modal or flip dark mode |
|
|
93
|
+
| `background=True` with `running=`, `cancel=`, `progress=` | Blocking Gunicorn workers on 30-second queries |
|
|
94
|
+
| `dash_ag_grid.AgGrid` + `dash_mantine_components` | Nested raw `html.Div`s with repeated inline `style={...}` |
|
|
95
|
+
| `dcc.Store` per-session state | Mutating global Python lists/DataFrames across concurrent users |
|
|
40
96
|
|
|
41
97
|
## Known traps
|
|
42
98
|
|
|
43
|
-
|
|
99
|
+
Calling removed `app.run_server()`, circular callback graphs, giant JSON payloads in `dcc.Store`, forgetting `prevent_initial_call` with `allow_duplicate=True`, uncancelled long background jobs, Plotly default light template clashing with dark mode, and silent callback exceptions leaving spinners stuck.
|
|
44
100
|
|
|
45
101
|
## Verification commands
|
|
46
102
|
|
|
47
103
|
```sh
|
|
48
|
-
python app.py
|
|
49
|
-
python -m pytest
|
|
50
104
|
python -m compileall .
|
|
105
|
+
python -m pytest
|
|
106
|
+
python app.py
|
|
51
107
|
```
|
|
52
108
|
|
|
53
|
-
Use
|
|
109
|
+
Use `dash.testing` (`dash_duo` with headless Chromium) or Playwright to inspect rendered callbacks, network payloads, dark mode, and keyboard navigation (`rendered` evidence); direct Python callback unit tests prove logic only (`static`).
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Token mapping
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Keep project settings in `evidence.config.yaml` and theme configuration in `theme.yaml` at the project root. Define paired light/dark palettes and color scales in `theme.yaml` before overriding individual components:
|
|
6
6
|
|
|
7
7
|
```yaml
|
|
8
8
|
theme:
|
|
@@ -10,66 +10,81 @@ theme:
|
|
|
10
10
|
primary:
|
|
11
11
|
light: "#2563eb"
|
|
12
12
|
dark: "#3b82f6"
|
|
13
|
+
colorPalettes:
|
|
14
|
+
default:
|
|
15
|
+
light: ["#2563eb", "#0d9488", "#d97706", "#7c3aed"]
|
|
16
|
+
dark: ["#60a5fa", "#2dd4bf", "#fbbf24", "#a78bfa"]
|
|
13
17
|
```
|
|
14
18
|
|
|
15
|
-
Verify exact theme keys against the installed
|
|
19
|
+
Verify exact theme keys against the installed `@evidence-dev/evidence` version because palette/theme schemas evolve across releases.
|
|
16
20
|
|
|
17
21
|
## Layout and responsive idioms
|
|
18
22
|
|
|
19
|
-
Pages are Markdown files
|
|
23
|
+
Pages are Markdown files under `pages/`. `evidence.config.yaml` sets defaults such as layout width, navigation, and appearance. Evidence compiles SQL extracts from `sources/` into local Parquet files queried in the browser via **Universal SQL (DuckDB-Wasm)**. Compose operational reports around reading order and decision density rather than equal-height KPI cards. Test narrow screens, print/export views, shared filter URLs, and long dimension names.
|
|
20
24
|
|
|
21
|
-
## Typography
|
|
25
|
+
## Typography and numeric precision
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
Configure font families in `theme.yaml` where supported. Keep numeric format strings explicit (`fmt=usd0`, `fmt=pct1`, tabular alignment) and label time grain and timezone in headings or notes. Markdown prose is part of the product: document metric definitions, freshness timestamps, and caveats right beside the visuals.
|
|
24
28
|
|
|
25
|
-
## Motion
|
|
29
|
+
## Motion and reduced motion
|
|
26
30
|
|
|
27
|
-
Evidence renders browser UI. Any custom
|
|
31
|
+
Evidence renders Svelte browser UI. Any custom transitions must respect `prefers-reduced-motion`, and never rely on chart animation as the sole signal that filters or data updated.
|
|
28
32
|
|
|
29
33
|
## Accessibility specifics
|
|
30
34
|
|
|
31
|
-
Use semantic Markdown
|
|
35
|
+
Use semantic Markdown heading levels (`h1` -> `h2` -> `h3`) and plain-language summaries around charts and tables. Validate keyboard reach and visible focus on inputs (`Dropdown`, `DateRange`, `ButtonGroup`), contrast in both light and dark modes, non-color chart encodings, and table column labels in the rendered DOM rather than assuming BI components are accessible by default.
|
|
32
36
|
|
|
33
|
-
## States idiom
|
|
37
|
+
## States and Universal SQL idiom
|
|
34
38
|
|
|
35
|
-
SQL fenced blocks define named queries; components consume them through `
|
|
39
|
+
SQL fenced blocks define named client-side DuckDB-Wasm queries; Svelte components consume them through `{query_name}` props and reactive `${inputs.*}` bindings. Handle empty results, source-build failure, stale Parquet snapshots, and missing permissions explicitly:
|
|
36
40
|
|
|
37
41
|
````markdown
|
|
38
42
|
```sql daily_orders
|
|
39
|
-
select
|
|
43
|
+
select
|
|
44
|
+
order_date,
|
|
45
|
+
region,
|
|
46
|
+
revenue_usd
|
|
47
|
+
from warehouse.daily_orders
|
|
48
|
+
where region like '${inputs.region.value}'
|
|
49
|
+
order by order_date desc
|
|
40
50
|
```
|
|
41
51
|
|
|
42
|
-
{
|
|
43
|
-
|
|
52
|
+
<Dropdown data={regions} name=region value=region title="Region">
|
|
53
|
+
<DropdownOption value="%" valueLabel="All regions" />
|
|
54
|
+
</Dropdown>
|
|
44
55
|
|
|
45
|
-
|
|
56
|
+
{#if daily_orders.length === 0}
|
|
57
|
+
No orders match the selected region. Widen the filter or check the latest source build.
|
|
58
|
+
{:else}
|
|
59
|
+
<BarChart data={daily_orders} x=order_date y=revenue_usd yFmt=usd0 title="Daily revenue" />
|
|
60
|
+
<DataTable data={daily_orders} search=true rows=15 />
|
|
61
|
+
{/if}
|
|
62
|
+
````
|
|
46
63
|
|
|
47
|
-
## Forms idiom
|
|
64
|
+
## Forms and filter idiom
|
|
48
65
|
|
|
49
|
-
Use labeled
|
|
66
|
+
Use labeled Evidence input components (`Dropdown`, `DateRange`, `TextInput`, `ButtonGroup`). Reflect active filters in prose or headings, validate date/numeric bounds, and avoid constructing unquoted raw SQL identifiers from user text even against local DuckDB-Wasm snapshots.
|
|
50
67
|
|
|
51
68
|
## Do/don't pairs
|
|
52
69
|
|
|
53
70
|
| Do | Don't |
|
|
54
71
|
|---|---|
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
72
|
+
| Svelte component syntax (`<DataTable data={daily_orders} />`) | Liquid/Markdoc syntax (`{% table data="daily_orders" /%}`) that fails to compile |
|
|
73
|
+
| Run `npm run sources` to refresh Parquet extracts before `npm run build` | Deploy stale `static/data` snapshots without checking source freshness |
|
|
74
|
+
| Version-controlled `evidence.config.yaml` and `theme.yaml` | Undocumented local-only theme or connector settings |
|
|
75
|
+
| `{#if query.length === 0}` empty states beside affected charts | Blank chart regions with no explanation |
|
|
76
|
+
| Visible last-built timestamp and source caveats | Implying live warehouse queries when serving static Universal SQL extracts |
|
|
60
77
|
|
|
61
78
|
## Known traps
|
|
62
79
|
|
|
63
|
-
Warehouse
|
|
80
|
+
Warehouse credentials committed to `sources/*/connection.yaml` (use env vars), unbounded source queries bloating browser Parquet downloads, implicit timezone/date-grain mismatches between warehouse SQL and DuckDB-Wasm, SQL dialect differences across connectors, stale static builds, filter state confusion on narrow viewports, and prose diverging from SQL logic.
|
|
64
81
|
|
|
65
82
|
## Verification commands
|
|
66
83
|
|
|
67
84
|
```sh
|
|
68
|
-
|
|
69
|
-
cat theme.yaml
|
|
70
|
-
cat package.json
|
|
85
|
+
npm run sources
|
|
71
86
|
npm run build
|
|
72
87
|
npm run dev
|
|
73
88
|
```
|
|
74
89
|
|
|
75
|
-
|
|
90
|
+
`npm run sources` verifies connector extraction into Universal SQL / DuckDB-Wasm Parquet files (`static`/`data` evidence); `npm run build` validates Svelte/Markdown compilation (`static`); browser inspection across light/dark modes and narrow viewports is required for `rendered` evidence.
|
|
@@ -1,65 +1,103 @@
|
|
|
1
1
|
# Gradio
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Version compatibility and breaking changes (Gradio 5 vs 6)
|
|
4
|
+
|
|
5
|
+
Check the installed `gradio` version before editing theme, CSS, or chat code:
|
|
6
|
+
|
|
7
|
+
- **Message-format chat history**: Use OpenAI-style message dicts (`{"role": "user" | "assistant", "content": ...}`) with `type="messages"` in Gradio 5 (`gr.Chatbot(type="messages")`, `gr.ChatInterface(..., type="messages")`). Legacy `[user, bot]` tuple history is deprecated in Gradio 5 and removed in Gradio 6 (where message dicts are the default).
|
|
8
|
+
- **`theme` and `css` placement**: In Gradio 5, pass `theme=` and `css=` to `gr.Blocks(theme=..., css=...)`. In **Gradio 6**, `theme`, `css`, `js`, and `head` move to `demo.launch(theme=..., css=...)`. Inspect the repo's `gradio` pin and existing entrypoints before choosing placement.
|
|
4
9
|
|
|
5
10
|
## Token mapping
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
Start with a prebuilt theme (`gr.themes.Base`, `Soft`, `Default`, `Monochrome`) and override semantic CSS variables with `.set(...)`. Attach stable `elem_id` or `elem_classes` hooks rather than targeting generated Svelte classes:
|
|
8
13
|
|
|
9
14
|
```python
|
|
10
|
-
|
|
15
|
+
import gradio as gr
|
|
16
|
+
|
|
17
|
+
theme = gr.themes.Soft(primary_hue="blue", neutral_hue="slate").set(
|
|
18
|
+
body_background_fill="#faf8f1",
|
|
11
19
|
loader_color="#0074ca",
|
|
12
20
|
)
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
|
|
22
|
+
# Gradio 5: gr.Blocks(theme=theme, css=".result-panel { border-radius: 12px; }")
|
|
23
|
+
# Gradio 6: pass theme=theme and css=... to demo.launch(...)
|
|
24
|
+
with gr.Blocks() as demo:
|
|
25
|
+
out = gr.Markdown(elem_classes=["result-panel"])
|
|
26
|
+
|
|
27
|
+
demo.launch(theme=theme, css=".result-panel { border-radius: 12px; }")
|
|
15
28
|
```
|
|
16
29
|
|
|
17
|
-
|
|
30
|
+
## Chat, dynamic rendering, multipage, and state idioms
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
import gradio as gr
|
|
18
34
|
|
|
19
|
-
|
|
35
|
+
def respond(message: str, history: list[dict]):
|
|
36
|
+
partial = ""
|
|
37
|
+
for token in stream_model(message, history):
|
|
38
|
+
partial += token
|
|
39
|
+
yield partial
|
|
20
40
|
|
|
21
|
-
|
|
41
|
+
with gr.Blocks() as demo:
|
|
42
|
+
prefs = gr.BrowserState({"temperature": 0.2}) # persisted in browser localStorage
|
|
43
|
+
session_cache = gr.State({}) # per-session server state
|
|
22
44
|
|
|
23
|
-
|
|
45
|
+
gr.ChatInterface(
|
|
46
|
+
fn=respond,
|
|
47
|
+
type="messages", # required in Gradio 5; default in Gradio 6
|
|
48
|
+
title="Model Evaluator",
|
|
49
|
+
)
|
|
24
50
|
|
|
25
|
-
|
|
51
|
+
count = gr.Slider(1, 4, step=1, value=2, label="Candidate outputs")
|
|
26
52
|
|
|
27
|
-
|
|
53
|
+
@gr.render(inputs=count)
|
|
54
|
+
def render_candidates(n: int):
|
|
55
|
+
with gr.Row():
|
|
56
|
+
for i in range(int(n)):
|
|
57
|
+
gr.Textbox(label=f"Candidate {i + 1}", interactive=False)
|
|
28
58
|
|
|
29
|
-
|
|
59
|
+
with demo.route("Settings"):
|
|
60
|
+
gr.Markdown("## Evaluation settings")
|
|
61
|
+
gr.Slider(0.0, 1.0, value=0.2, label="Temperature")
|
|
30
62
|
|
|
31
|
-
|
|
63
|
+
demo.launch(ssr_mode=True, mcp_server=True)
|
|
64
|
+
```
|
|
32
65
|
|
|
33
|
-
|
|
66
|
+
- **`@gr.render`**: Dynamically generate components from reactive inputs instead of pre-allocating dozens of hidden widgets with `visible=False`.
|
|
67
|
+
- **Multipage (`demo.route(...)`)**: Split distinct workflows (inference vs benchmark settings) onto dedicated routes with automatic nav links instead of cramming tabs into one page.
|
|
68
|
+
- **`gr.BrowserState` vs `gr.State`**: Use `gr.BrowserState` for safe non-secret client preferences that survive reloads; use `gr.State` for ephemeral per-session server objects; never store credentials in `BrowserState`.
|
|
69
|
+
- **`ssr_mode=True` & `mcp_server=True`**: Enable `ssr_mode=True` when fast initial HTML paint matters (requires Node runtime); enable `mcp_server=True` when exposing typed Python functions (with docstrings and type hints) as MCP tools for agents.
|
|
70
|
+
- **Custom components**: Author custom components with the **Svelte 5** CLI workflow (`gradio cc create`, `gradio cc dev`, `gradio cc build`) rather than injecting fragile inline `<script>` hacks.
|
|
34
71
|
|
|
35
|
-
##
|
|
72
|
+
## Layout, motion, and accessibility
|
|
36
73
|
|
|
37
|
-
|
|
74
|
+
Group controls in `gr.Row`, `gr.Column`, `gr.Tabs`, and `gr.Accordion` along the input -> trigger -> output scan path. Use generator yields and `gr.Progress(track_tqdm=True)` for truthful long-running feedback; ensure custom CSS honors `prefers-reduced-motion`. Give every control a clear `label` and `info` text, keep media alt/captions present, and test narrow iframe and mobile widths.
|
|
38
75
|
|
|
39
|
-
## Forms idiom
|
|
76
|
+
## Forms and concurrency idiom
|
|
40
77
|
|
|
41
|
-
|
|
78
|
+
Make expensive inference triggers explicit (`gr.Button("Run", variant="primary")`) rather than firing on every slider tick. Configure `concurrency_limit` and `cancels=[run_event]` on `.click()` handlers so users can abort slow generations cleanly and queue backpressure stays visible. Validate file types/sizes before GPU work and preserve inputs on error (`gr.Error("...")`).
|
|
42
79
|
|
|
43
80
|
## Do/don't pairs
|
|
44
81
|
|
|
45
82
|
| Do | Don't |
|
|
46
83
|
|---|---|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
51
|
-
|
|
|
84
|
+
| `type="messages"` dict history (`{"role", "content"}`) | Deprecated `[user, bot]` tuple chat history |
|
|
85
|
+
| Match `theme`/`css` placement to installed Gradio 5 vs 6 | Pass Gradio 5 `Blocks(theme=...)` blindly on Gradio 6 |
|
|
86
|
+
| `@gr.render` for variable-length UI lists | Pre-creating 20 hidden components toggled with `visible=` |
|
|
87
|
+
| `elem_classes=["result-panel"]` stable CSS hooks | Scraping generated Svelte class hashes |
|
|
88
|
+
| Explicit Run + Cancel button with `concurrency_limit` | Triggering heavy inference on every slider drag |
|
|
89
|
+
| `gr.BrowserState` only for non-secret client prefs | Storing API keys or PII in `gr.BrowserState` |
|
|
52
90
|
|
|
53
91
|
## Known traps
|
|
54
92
|
|
|
55
|
-
|
|
93
|
+
Gradio 5/6 `Blocks` vs `launch` API mismatch, tuple-vs-messages `Chatbot` format errors, generator cancellation leaks, queue starvation without `concurrency_limit`, large media uploads exhausting memory, `ssr_mode=True` failing without Node, and mobile/iframe horizontal clipping.
|
|
56
94
|
|
|
57
95
|
## Verification commands
|
|
58
96
|
|
|
59
97
|
```sh
|
|
60
|
-
python app.py
|
|
61
|
-
python -m pytest
|
|
62
98
|
python -m compileall .
|
|
99
|
+
python -m pytest
|
|
100
|
+
python app.py
|
|
63
101
|
```
|
|
64
102
|
|
|
65
|
-
|
|
103
|
+
Backend `pytest` checks verify handler logic (`static`); inspect rendered desktop/mobile/iframe views, streaming cancellation, and error paths in a browser for `rendered` evidence.
|
|
@@ -1,47 +1,82 @@
|
|
|
1
|
-
# Julia Genie
|
|
1
|
+
# Julia Genie / Stipple
|
|
2
2
|
|
|
3
|
-
Genie
|
|
3
|
+
Genie and Stipple provide reactive Julia web/data-app infrastructure built over Vue/Quasar browser components. Keep reactive idioms native to Julia (`GenieFramework`) rather than porting Python patterns literally.
|
|
4
4
|
|
|
5
5
|
## Token mapping
|
|
6
6
|
|
|
7
|
-
Stipple/
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
Stipple renders Quasar/Vue components in the browser. Configure theme colors and typography through `public/css/` custom stylesheets (semantic CSS variables and Quasar brand overrides `--q-primary`, `--q-dark-page`) rather than mutating autogenerated component internals. Keep Plotly/Makie chart palettes synchronized with page tokens explicitly.
|
|
8
|
+
|
|
9
|
+
## Reactive `@app` idiom (`@in`, `@out`, `@private`, `@onchange`)
|
|
10
|
+
|
|
11
|
+
Declare every reactive variable's direction explicitly: `@in` is browser-writable, `@out` is server-to-browser read-only, and `@private` stays strictly server-side (never serialized over WebSocket to the browser).
|
|
12
|
+
|
|
13
|
+
```julia
|
|
14
|
+
module OpsApp
|
|
15
|
+
using GenieFramework, DataFrames, PlotlyBase
|
|
16
|
+
@genietools
|
|
17
|
+
|
|
18
|
+
@app begin
|
|
19
|
+
@in region = "EMEA"
|
|
20
|
+
@in run_trigger = false
|
|
21
|
+
@out regions = ["EMEA", "AMER", "APAC"]
|
|
22
|
+
@out loading = false
|
|
23
|
+
@out error_msg = ""
|
|
24
|
+
@out rows = DataTable(DataFrame(order_id = String[], revenue = Float64[]))
|
|
25
|
+
@private db_pool = init_db_pool() # never serialized to client
|
|
26
|
+
|
|
27
|
+
@onchange isready, region, run_trigger begin
|
|
28
|
+
loading = true
|
|
29
|
+
error_msg = ""
|
|
30
|
+
try
|
|
31
|
+
df = query_orders(db_pool, region)
|
|
32
|
+
rows = DataTable(df)
|
|
33
|
+
catch err
|
|
34
|
+
error_msg = sprint(showerror, err)
|
|
35
|
+
rows = DataTable(DataFrame(order_id = String[], revenue = Float64[]))
|
|
36
|
+
finally
|
|
37
|
+
loading = false
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
function ui()
|
|
43
|
+
[
|
|
44
|
+
row(class = "q-pa-md items-center q-gutter-md", [
|
|
45
|
+
select(:region, options = :regions, label = "Region", outlined = true),
|
|
46
|
+
btn("Refresh", color = "primary", @click("run_trigger = !run_trigger"), loading = :loading),
|
|
47
|
+
]),
|
|
48
|
+
p("{{error_msg}}", class = "text-negative q-px-md", @if("error_msg != ''")),
|
|
49
|
+
p("No orders match this region.", class = "q-px-md", @if("!loading && error_msg == '' && rows.data.length === 0")),
|
|
50
|
+
table(:rows, flat = true, bordered = true),
|
|
51
|
+
]
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
@page("/", ui)
|
|
55
|
+
end
|
|
56
|
+
```
|
|
24
57
|
|
|
25
|
-
##
|
|
58
|
+
## Layout, typography, motion, and accessibility
|
|
26
59
|
|
|
27
|
-
|
|
60
|
+
Compose responsive views with Quasar flex/grid helpers (`row`, `cell`, `col-12 col-md-6`) instead of fixed pixel widths. Load custom fonts via `public/css/` with fallbacks and `tabular-nums` on numeric cells. Bind `loading = :loading` truthfully to server computation and honor `prefers-reduced-motion` in custom CSS. Because Stipple emits Vue/Quasar DOM, inspect actual browser labels, keyboard reach, focus order, contrast, and text/table alternatives for plots.
|
|
28
61
|
|
|
29
|
-
##
|
|
62
|
+
## States and concurrency idiom
|
|
30
63
|
|
|
31
|
-
|
|
64
|
+
- Keep mutable per-user state inside `@app` reactive models (instantiated per session); never mutate module-global `DataFrame`s shared across sessions.
|
|
65
|
+
- Keep database handles, tokens, and large intermediate matrices in `@private` fields so they never serialize over WebSocket.
|
|
66
|
+
- Offload long scientific/optimization runs with `Threads.@spawn` / async channels so WebSocket heartbeats remain responsive, and surface timeout/error branches cleanly.
|
|
32
67
|
|
|
33
68
|
## Do/don't pairs
|
|
34
69
|
|
|
35
70
|
| Do | Don't |
|
|
36
71
|
|---|---|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
72
|
+
| `@in` for user inputs, `@out` for read-only outputs, `@private` for server objects | Exposing server handles or large raw arrays as `@in`/`@out` |
|
|
73
|
+
| Explicit `loading`, `error_msg`, and empty-table UI branches | Leaving an empty table or stuck spinner when a query throws |
|
|
74
|
+
| Per-session `@app` state with `try/catch/finally` | Mutating module-level globals across concurrent sessions |
|
|
75
|
+
| Semantic CSS vars in `public/css/` synced with Plotly/Makie themes | Brittle overrides of generated Quasar internals |
|
|
41
76
|
|
|
42
77
|
## Known traps
|
|
43
78
|
|
|
44
|
-
|
|
79
|
+
Serializing huge DataFrames or secrets via `@out` instead of `@private`, blocking Genie worker threads on unspawned scientific compute, Julia first-plot/TTFX cold latency without precompilation/PackageCompiler, plot/dark-mode theme mismatch, and mutating shared module globals.
|
|
45
80
|
|
|
46
81
|
## Verification commands
|
|
47
82
|
|
|
@@ -51,4 +86,4 @@ julia --project app.jl
|
|
|
51
86
|
npx playwright test
|
|
52
87
|
```
|
|
53
88
|
|
|
54
|
-
|
|
89
|
+
`Pkg.test()` validates Julia data and handler logic (`static`/unit evidence); browser/Playwright inspection across narrow viewports, concurrent sessions, error paths, and reconnects provides `rendered` evidence.
|