@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,46 +1,89 @@
|
|
|
1
|
-
# Electron
|
|
1
|
+
# Electron & Electrobun
|
|
2
2
|
|
|
3
3
|
## Token mapping
|
|
4
4
|
|
|
5
|
-
Use generated CSS
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
Use generated DTCG CSS custom properties in renderer UI. Keep main-process native chrome (window `backgroundColor` to eliminate launch flash, `nativeTheme.themeSource`, tray icons, dialogs) synchronized via shared semantic constants without leaking secrets or filesystem logic into the renderer.
|
|
6
|
+
|
|
7
|
+
## Modern Electron security & architecture baseline
|
|
8
|
+
|
|
9
|
+
Never weaken Electron's process boundary for convenience. Enforce these defaults on every `BrowserWindow` and embedded `WebContentsView`:
|
|
10
|
+
|
|
11
|
+
- **Strict renderer isolation**: `contextIsolation: true`, `sandbox: true`, `nodeIntegration: false`, exposing only a minimal, typed preload surface via **`contextBridge.exposeInMainWorld`**.
|
|
12
|
+
- **Typed IPC & streaming**: use **`ipcMain.handle`** / **`ipcRenderer.invoke`** for request/response with structured error propagation, and **`MessagePortMain`** for high-throughput renderer↔worker streaming.
|
|
13
|
+
- **`WebContentsView`** (replaces deprecated `BrowserView`): embed split web surfaces or multi-tab views cleanly inside a `BaseWindow` / `BrowserWindow`.
|
|
14
|
+
- **`protocol.handle`**: serve local/custom-scheme assets via standard Fetch `Request`/`Response` handlers (replaces deprecated `registerFileProtocol`).
|
|
15
|
+
- **`utilityProcess.fork`**: offload heavy CPU work, SQLite/indexing, or native addons out of the main process so window dragging, menus, and IPC never stall.
|
|
16
|
+
- **Credentials & hardening**: encrypt local tokens/secrets with **`safeStorage`** (OS keychain/DPAPI/libsecret) and lock production binaries with **`@electron/fuses`** (disable `RunAsNode`, disable `EnableNodeOptionsEnvironmentVariable`, enable ASAR integrity verification).
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
// main.ts — zero white flash on dark cold start + strict sandbox + native backdrop
|
|
20
|
+
const win = new BrowserWindow({
|
|
21
|
+
width: 1200,
|
|
22
|
+
height: 800,
|
|
23
|
+
minWidth: 720,
|
|
24
|
+
minHeight: 500,
|
|
25
|
+
show: false,
|
|
26
|
+
backgroundColor: '#111318',
|
|
27
|
+
vibrancy: process.platform === 'darwin' ? 'sidebar' : undefined,
|
|
28
|
+
backgroundMaterial: process.platform === 'win32' ? 'mica' : undefined,
|
|
29
|
+
titleBarStyle: process.platform === 'darwin' ? 'hiddenInset' : 'hidden',
|
|
30
|
+
titleBarOverlay: process.platform !== 'darwin' ? { height: 42, symbolColor: '#e5e7eb', color: '#00000000' } : undefined,
|
|
31
|
+
webPreferences: {
|
|
32
|
+
preload: path.join(__dirname, 'preload.js'),
|
|
33
|
+
contextIsolation: true,
|
|
34
|
+
sandbox: true,
|
|
35
|
+
nodeIntegration: false,
|
|
36
|
+
spellcheck: true,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
win.once('ready-to-show', () => win.show());
|
|
41
|
+
ipcMain.handle('doc:save', async (_evt, payload: SaveRequest) => saveDocumentAtomically(payload));
|
|
42
|
+
```
|
|
14
43
|
|
|
15
|
-
##
|
|
44
|
+
## The 8 WebView Giveaway Killers, Mica/vibrancy & native DnD
|
|
16
45
|
|
|
17
|
-
|
|
46
|
+
Eliminate every browser tell on Electron & Electrobun windows (budgeting **`< 1.0–1.2 s` cold start**, **`~0%` idle CPU** when minimized/unfocused, and explicitly justifying Electron's memory footprint in the brief):
|
|
18
47
|
|
|
19
|
-
|
|
48
|
+
1. **`cursor: default`** on all buttons, tabs, sidebar items, and chrome (`cursor: pointer` only on external `https://` links).
|
|
49
|
+
2. **`user-select: none`** across toolbars, sidebars, tabs, menus, and buttons (selectable strictly inside editors, tables, and log panes).
|
|
50
|
+
3. **Block browser shortcuts & menus in production**: remove default `View → Reload / Toggle Developer Tools` accelerators in packaged builds (`!app.isPackaged`), call `webContents.setVisualZoomLevelLimits(1, 1)` to disable accidental pinch-zoom, set `overscroll-behavior: none`, and wire native `Menu.buildFromTemplate(...).popup()` on `context-menu` instead of raw Chromium inspect menus.
|
|
51
|
+
4. **Zero white flash (`show: false` + `backgroundColor`)**: initialize `BrowserWindow` hidden with the active theme's background color and reveal on `ready-to-show`.
|
|
52
|
+
5. **Custom `40–52 px` titlebar & fullscreen traffic-light inset**: pair `titleBarOverlay` (Windows/Linux Snap Layouts preserved) and `titleBarStyle: 'hiddenInset'` (macOS **`72–80 px` left inset**, collapsed to standard padding on `enter-full-screen` / `leave-full-screen`) with `-webkit-app-region: drag` on the bar and `-webkit-app-region: no-drag` on every interactive child.
|
|
53
|
+
6. **Native backdrops + inactive-window dimming**: pair `backgroundMaterial: 'mica'` / `vibrancy` (with opaque fallback for High Contrast / Reduce Transparency) with `focus`/`blur` window classes (`:window-inactive` / `[data-window-focused="false"]`) that soften sidebar/titlebar contrast on unfocused windows.
|
|
54
|
+
7. **Two-way native file drag-and-drop & dialogs**: accept inbound file drops via `webUtils.getPathForFile(file)` in preload with clear drop-zone states, support **outbound drag to Finder/Explorer** via `event.sender.startDrag({ file, icon })`, and use `dialog.showOpenDialog` / `showSaveDialog`.
|
|
55
|
+
8. **Native OS menu bar, `Cmd`/`Ctrl` modifiers & single-instance deep links**: set `Menu.setApplicationMenu(...)` (`App/File/Edit/View/Window/Help`), acquire `app.requestSingleInstanceLock()`, and route `second-instance` + `open-url` deep links cleanly.
|
|
20
56
|
|
|
21
|
-
|
|
57
|
+
## Electron vs Tauri vs Electrobun decision matrix
|
|
22
58
|
|
|
23
|
-
|
|
59
|
+
**Electrobun** pairs **Bun** (fast JS/TS runtime) + **Zig** native bindings + the **system WebView** (WKWebView / WebView2 / WebKitGTK) as a lightweight TypeScript-first desktop alternative when Electron's Chromium bundle size (~100 MB+) is unacceptable and you prefer TS/Zig over Rust (Tauri):
|
|
24
60
|
|
|
25
|
-
|
|
61
|
+
| Runtime | Footprint & cold start | Renderer consistency | Native backend | Best fit |
|
|
62
|
+
|---|---|---|---|---|
|
|
63
|
+
| **Electron** | ~100–150 MB (`< 1.0–1.2 s` cold start; justify RAM in brief) | Identical Chromium/WebGPU across Windows, macOS, Linux | Node.js + `utilityProcess` + native addons | Complex editors/IDEs needing guaranteed Chromium parity, `WebContentsView`, and mature ecosystem |
|
|
64
|
+
| **Tauri v2** | ~3–10 MB (`< 300–500 ms` cold start) | Varies by OS WebView (WKWebView / WebView2 / WebKitGTK) | Rust (`#[tauri::command]`, `Channel`) | Lightweight security-first desktop + mobile apps with Rust backend |
|
|
65
|
+
| **Electrobun** | ~12–20 MB (`< 300–500 ms` cold start) | Varies by OS WebView | Bun TS + Zig FFI | Teams wanting ultra-fast Bun TS tooling, tiny binaries, and fast differential updates without writing Rust |
|
|
26
66
|
|
|
27
|
-
##
|
|
67
|
+
## Storage, 2026 signing & accessibility idioms
|
|
28
68
|
|
|
29
|
-
|
|
69
|
+
- **OS paths & atomic writes**: store data strictly under `app.getPath('userData')` / `app.getPath('logs')` using atomic `temp → fsync → rename` writes and SQLite `WAL` mode inside a `utilityProcess` ([working-context.md](working-context.md)).
|
|
70
|
+
- **2026 signing & auto-update**: notarize macOS builds (`@electron/notarize` / `notarytool` + `stapler`); sign Windows releases via **Azure Artifact Signing** or HSM Authenticode (remembering EV certs no longer bypass SmartScreen instantly—maintain consistent CI publisher reputation); verify cryptographically signed delta updates in background and roll back on startup crash.
|
|
71
|
+
- **Accessibility**: bundle offline fonts, honor `prefers-reduced-motion`, clamp multi-monitor bounds across mixed-DPI (`100%` ↔ `200%`) `screen.getAllDisplays()` work areas, guard `close` on dirty documents, and verify `VoiceOver`, `NVDA`/`JAWS`/`Narrator`, and `Orca`.
|
|
30
72
|
|
|
31
73
|
## Do/don't pairs
|
|
32
74
|
|
|
33
75
|
| Do | Don't |
|
|
34
76
|
|---|---|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
77
|
+
| `contextIsolation: true`, `sandbox: true`, narrow `contextBridge` API | Enable `nodeIntegration: true` or expose raw `ipcRenderer.send` to renderer |
|
|
78
|
+
| Launch `show: false` + dark `backgroundColor` + `cursor: default` + `user-select: none` + block prod `Cmd/Ctrl+R` | Flash white on dark start, show hand cursors on chrome, or leave `Ctrl+R`/Inspect Element active in production |
|
|
79
|
+
| Use `WebContentsView`, `protocol.handle`, `utilityProcess.fork`, `webUtils.getPathForFile`, and `startDrag` | Block main thread with sync `fs`/SQLite or ship one-way browser `<input type="file">` pickers |
|
|
80
|
+
| Encrypt tokens with `safeStorage`, lock `@electron/fuses`, and store files in `userData` atomically | Store plaintext OAuth tokens in `localStorage` or write non-atomic files beside the binary |
|
|
81
|
+
| Use `titleBarOverlay` (Windows) and `72–80 px` macOS inset (collapsing on fullscreen) + inactive dimming | Cover macOS traffic lights, swallow button clicks in `-webkit-app-region: drag`, or break Snap Layouts |
|
|
82
|
+
| Clamp restored window bounds against mixed-DPI `screen.getAllDisplays()` work areas | Restore windows off-screen after an external monitor is disconnected |
|
|
40
83
|
|
|
41
84
|
## Known traps
|
|
42
85
|
|
|
43
|
-
|
|
86
|
+
Disabling `sandbox`/`contextIsolation`, white flash from omitting `show: false` + `backgroundColor`, leaving `Cmd/Ctrl+R` reload enabled in packaged builds, forgetting to collapse macOS `72–80 px` traffic-light padding in fullscreen, blocking main process instead of `utilityProcess`, restoring invalid multi-monitor coordinates, assuming EV certificates bypass Windows SmartScreen immediately.
|
|
44
87
|
|
|
45
88
|
## Verification commands
|
|
46
89
|
|
|
@@ -48,7 +91,6 @@ Security boundary shortcuts, main/renderer state divergence, memory/resource use
|
|
|
48
91
|
npm run lint
|
|
49
92
|
npm run test -- --run
|
|
50
93
|
npm run build
|
|
51
|
-
npm start
|
|
52
94
|
```
|
|
53
95
|
|
|
54
|
-
|
|
96
|
+
Lint, unit tests, and bundle builds are `static` evidence. Run packaged, signed builds (with `@electron/fuses` applied) on real macOS, Windows, and Linux hosts to verify `< 1.2 s` cold start, `~0%` idle CPU, all 8 WebView giveaway killers, `titleBarOverlay`/Mica, screen readers (`VoiceOver`/`NVDA`/`Narrator`/`Orca`), mixed-DPI multi-monitor restore, and dirty-close recovery for `rendered` evidence; label untested OSes `not-checked`.
|
|
@@ -1,54 +1,83 @@
|
|
|
1
|
-
# Go GUI:
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
# Go GUI: Wails (v2 / v3), Fyne, and Gio
|
|
2
|
+
|
|
3
|
+
## Toolkit comparison & idioms
|
|
4
|
+
|
|
5
|
+
| Toolkit | Rendering model | Key 2025–2026 idioms | Best fit |
|
|
6
|
+
|---|---|---|---|
|
|
7
|
+
| **Wails v3** (and **v2**) | OS WebView + Go backend | **v3**: multi-window (`app.Window.NewWithOptions`), native application menus & system tray (`app.NewSystemTray`), `application.NewService(...)` generated TS bindings, `wails3` CLI. (**v2**: single-window `wails build` for existing repos.) | Web-UI desktop apps with a fast Go backend and small binaries |
|
|
8
|
+
| **Fyne (v2.5 / v2.6+)** | Native Go OpenGL/Canvas retained widgets | Custom `fyne.Theme`, reactive `fyne.io/fyne/v2/data/binding`, `app.Preferences()` persistence, `widget.NewList` virtualization | Pure-Go cross-platform desktop/mobile utilities without WebView |
|
|
9
|
+
| **Gio (`gioui.org`)** | Immediate-mode GPU (`layout.Context`, `material.Theme`) | Frame-local `layout.Flex` / `layout.Inset`, explicit `op.Ops`, high-FPS custom vector/tool rendering | Custom Go graphics/engineering tools where immediate-mode control dominates |
|
|
10
|
+
|
|
11
|
+
## Token mapping & idiomatic Go snippets
|
|
12
|
+
|
|
13
|
+
- **Wails v3**: map DTCG tokens into CSS custom properties inside the frontend while mirroring window background, native menus, and tray icon states in Go:
|
|
14
|
+
|
|
15
|
+
```go
|
|
16
|
+
// Wails v3 multi-window + service + system tray setup
|
|
17
|
+
app := application.New(application.Options{
|
|
18
|
+
Name: "InvoiceDesk",
|
|
19
|
+
Services: []application.Service{application.NewService(&InvoiceService{})},
|
|
20
|
+
})
|
|
21
|
+
win := app.Window.NewWithOptions(application.WebviewWindowOptions{
|
|
22
|
+
Title: "Invoices",
|
|
23
|
+
Width: 1120,
|
|
24
|
+
Height: 760,
|
|
25
|
+
MinWidth: 720,
|
|
26
|
+
MinHeight: 500,
|
|
27
|
+
})
|
|
28
|
+
tray := app.SystemTray.New()
|
|
29
|
+
tray.AttachWindow(win).WindowOffset(5)
|
|
30
|
+
```
|
|
16
31
|
|
|
17
|
-
|
|
32
|
+
- **Fyne v2.5/v2.6+**: centralize tokens inside a custom `fyne.Theme` implementation (`Color(name, variant)`, `Size(name)`), bind UI controls reactively with `data/binding` (`binding.NewString()`, `binding.NewFloat()`), and persist user/window preferences via `app.Preferences()`:
|
|
18
33
|
|
|
19
|
-
|
|
34
|
+
```go
|
|
35
|
+
status := binding.NewString()
|
|
36
|
+
_ = status.Set("Ready")
|
|
37
|
+
label := widget.NewLabelWithData(status)
|
|
38
|
+
themePref := myApp.Preferences().StringWithFallback("theme", "system")
|
|
39
|
+
```
|
|
20
40
|
|
|
21
|
-
|
|
41
|
+
- **Gio**: centralize semantic `color.NRGBA` and spacing constants in a Go theme package consumed by `layout.Context` builders rather than scattering inline RGBA structs across frame functions.
|
|
22
42
|
|
|
23
|
-
##
|
|
43
|
+
## Layout, WebView giveaway killers (Wails), & reduced motion
|
|
24
44
|
|
|
25
|
-
|
|
45
|
+
- **Wails (all 8 WebView Giveaway Killers)**: configure `Hidden: true` + theme-matched `BackgroundColour` on `WebviewWindowOptions` (showing on ready to eliminate dark-mode white flash), enforce `cursor: default` and `user-select: none` on UI chrome, disable production browser `contextmenu` / `Cmd/Ctrl+R` reload / rubber-band overscroll, mark `40–52 px` headers with `--wails-draggable: drag` (`no-drag` on buttons, `72–80 px` macOS traffic-light inset collapsed on fullscreen), apply native macOS vibrancy / Windows `Mica` + unfocused window dimming, wire native file drop (`EnableFileDrop: true`) + native open/save dialogs, and register native `App/File/Edit/View/Window/Help` menus + single-instance deep-link activation ([tauri.md](tauri.md), [working-context.md](working-context.md)).
|
|
46
|
+
- **Fyne**: compose with `container.NewBorder`, `NewHSplit`, `NewGridWithColumns`, and virtualized `widget.NewList`/`NewTable`; never create thousands of `widget.Label` widgets eagerly inside a `VBox`.
|
|
47
|
+
- **Gio**: derive layout cleanly from `gtx.Constraints` every frame and respect `gtx.Metric` (`Dp`/`Sp`) for HiDPI and font scaling.
|
|
48
|
+
- Register bundled font assets explicitly and test CJK/RTL shaping and glyph fallback across OSes. Honor `prefers-reduced-motion` in Wails WebViews; in Fyne and Gio, expose an app-level reduced-motion preference when OS preference hooks are absent and tie any timer/animation goroutines to `context.Context` cancellation (`~0%` idle CPU when unfocused/minimized).
|
|
26
49
|
|
|
27
|
-
##
|
|
50
|
+
## Accessibility, atomic storage, & states
|
|
28
51
|
|
|
29
|
-
|
|
52
|
+
- **Wails**: accessibility relies on semantic HTML/ARIA inside the WebView plus native OS menu/shortcut/dialog verification (`VoiceOver`, `NVDA`/`Narrator`, `Orca`).
|
|
53
|
+
- **Fyne**: implement `fyne.Accessible` (`AccessibilityLabel`, `AccessibilityRole`) where supported, keep keyboard focus (`fyne.Focusable`) explicit, and verify actual VoiceOver/Narrator/Orca coverage honestly—do not assume parity with native OS toolkits.
|
|
54
|
+
- **Gio**: custom GPU rendering has limited built-in screen-reader support; do not select Gio for screen-reader-mandated productivity software without an explicit accessibility bridge, and mark untested assistive-tech support `not-checked`.
|
|
55
|
+
- **OS paths & atomic writes**: store config/data under `os.UserConfigDir()` / `os.UserCacheDir()` (never next to the binary), write files via temp file + `f.Sync()` + `os.Rename()`, and run SQLite in `WAL` mode ([working-context.md](working-context.md)). Cancel background goroutines via `context.Context`, guard dirty-document close events, and update Fyne/Gio UI safely on the toolkit's UI queue (`fyne.Do(...)` in Fyne v2.6+ / `window.Invalidate()` in Gio).
|
|
30
56
|
|
|
31
57
|
## Do/don't pairs
|
|
32
58
|
|
|
33
59
|
| Do | Don't |
|
|
34
60
|
|---|---|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
61
|
+
| Use Wails v3 `application.NewService` + native menus + `Hidden: true` dark launch + all 8 WebView giveaway killers | Ship a single-window WebView SPA that flashes white, shows `cursor: pointer` on chrome, or reloads on `Ctrl+R` |
|
|
62
|
+
| Use Fyne `data/binding`, `app.Preferences()`, and `fyne.Do(...)` from goroutines | Mutate Fyne widgets directly from background goroutines without synchronization |
|
|
63
|
+
| Store config in `os.UserConfigDir()` with `temp → f.Sync() → os.Rename()` + SQLite `WAL` | Write state beside the executable or truncate user files in place |
|
|
64
|
+
| Use `widget.NewList` / `NewTable` in Fyne for large datasets | Append 2,000 rows directly into `container.NewVBox` |
|
|
65
|
+
| Pass `context.Context` into background work and cancel on close/navigation | Leak orphaned goroutines that burn idle CPU or mutate stale window state |
|
|
66
|
+
| Verify actual screen-reader support per toolkit honestly | Claim VoiceOver/Narrator compliance for Gio/Fyne purely because `go build` passed |
|
|
39
67
|
|
|
40
68
|
## Known traps
|
|
41
69
|
|
|
42
|
-
CGO/
|
|
70
|
+
CGO cross-compilation friction in Fyne (OpenGL/OS bindings) vs pure-Go/WebView builds, mutating Fyne UI off the main thread (causing races before `fyne.Do`), Wails v2 vs v3 API confusion (`wails` vs `wails3` CLI), OS WebView differences in Wails (WKWebView vs WebView2 vs WebKitGTK), missing font fallbacks in Gio/Fyne, uncancelled goroutines on window close.
|
|
43
71
|
|
|
44
72
|
## Verification commands
|
|
45
73
|
|
|
46
74
|
```sh
|
|
47
75
|
go test ./...
|
|
48
76
|
go vet ./...
|
|
49
|
-
fyne package 2>/dev/null || true
|
|
50
|
-
wails build 2>/dev/null || true
|
|
51
77
|
go run .
|
|
78
|
+
# Run the packaging command matching your toolkit when installed:
|
|
79
|
+
wails3 build # Wails v3 projects (use `wails build` for Wails v2)
|
|
80
|
+
fyne package # Fyne projects
|
|
52
81
|
```
|
|
53
82
|
|
|
54
|
-
Run
|
|
83
|
+
`go test` and `go vet` provide `static` / logic evidence. Run packaged builds on target desktop OSes to verify window chrome, tray/menus, resize/HiDPI, keyboard navigation, screen readers (where supported), and dirty-close cancellation for `rendered` evidence; label untested OSes `not-checked`.
|
|
@@ -1,54 +1,97 @@
|
|
|
1
|
-
# GTK
|
|
2
|
-
|
|
3
|
-
## Token mapping
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
# GTK 4 & libadwaita
|
|
2
|
+
|
|
3
|
+
## Token mapping & `AdwStyleManager` / `AdwAccentColor`
|
|
4
|
+
|
|
5
|
+
Prefer libadwaita 1.4–1.8 semantic CSS variables (`--window-bg-color`, `--view-bg-color`, `--accent-bg-color`, `--accent-color`, `--destructive-bg-color`) and built-in style classes (`suggested-action`, `destructive-action`, `boxed-list`, `card`, `dimmed`) over hard-coded hex values so dark mode, high contrast, and system accent colors work automatically.
|
|
6
|
+
|
|
7
|
+
- Inspect **`AdwStyleManager`** (`style_manager.get_dark()`, `get_high_contrast()`, `set_color_scheme(ADW_COLOR_SCHEME_DEFAULT)`) and **`AdwAccentColor`** (libadwaita 1.6+, reflecting desktop accent preferences via `AdwStyleManager:accent-color`).
|
|
8
|
+
- Scope custom application tokens in one CSS resource loaded at `GTK_STYLE_PROVIDER_PRIORITY_APPLICATION` so user accessibility themes still override when needed.
|
|
9
|
+
|
|
10
|
+
## Modern GTK4 / libadwaita 1.4–1.8 widgets & Blueprint (`.blp`)
|
|
11
|
+
|
|
12
|
+
Replace deprecated GTK3 and early libadwaita widgets (`AdwLeaflet`, `AdwFlap`, `AdwSqueezer`, `GtkMessageDialog`, `AdwMessageDialog`) with modern adaptive primitives:
|
|
13
|
+
|
|
14
|
+
- **`AdwNavigationSplitView`** + **`AdwBreakpoint`**: automatically collapses sidebar + content into a stacked navigation view below your chosen width threshold (`max-width: 600sp`).
|
|
15
|
+
- **`AdwDialog` / `AdwAlertDialog`**: adaptive dialogs that present as centered overlays on desktop and bottom sheets on narrow/mobile Linux form factors.
|
|
16
|
+
- **`AdwStatusPage`**: structured empty, loading, error, and onboarding states with icon, title, description, and action button.
|
|
17
|
+
- **Blueprint (`.blp`)**: prefer Blueprint compiler syntax over verbose hand-written GtkBuilder XML for readable, type-checked declarative UI:
|
|
18
|
+
|
|
19
|
+
```blp
|
|
20
|
+
using Gtk 4.0;
|
|
21
|
+
using Adw 1;
|
|
22
|
+
|
|
23
|
+
template $InvoiceWindow : Adw.ApplicationWindow {
|
|
24
|
+
default-width: 960;
|
|
25
|
+
default-height: 640;
|
|
26
|
+
width-request: 360;
|
|
27
|
+
|
|
28
|
+
Adw.Breakpoint {
|
|
29
|
+
condition ("max-width: 600sp")
|
|
30
|
+
setters { split_view.collapsed: true; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
content: Adw.NavigationSplitView split_view {
|
|
34
|
+
sidebar: Adw.NavigationPage { title: _("Folders"); child: Gtk.ListBox {}; };
|
|
35
|
+
content: Adw.NavigationPage {
|
|
36
|
+
title: _("Invoices");
|
|
37
|
+
child: Adw.StatusPage {
|
|
38
|
+
icon-name: "document-open-symbolic";
|
|
39
|
+
title: _("No Invoices Yet");
|
|
40
|
+
description: _("Create an invoice or import a CSV.");
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
```
|
|
12
46
|
|
|
13
|
-
|
|
47
|
+
## Wayland, XDG paths, atomic storage, & Linux packaging
|
|
14
48
|
|
|
15
|
-
|
|
49
|
+
- **Wayland has no global window positioning**: Wayland intentionally prevents apps from querying or setting absolute `(x, y)` desktop coordinates. Persist `default-width`, `default-height`, and `maximized` state only; use `AdwDialog`, `GtkPopover`, and `transient-for` relationships rather than manual screen coordinate math, and preserve libadwaita's `:backdrop` unfocused headerbar/sidebar dimming so multi-window focus stays clear.
|
|
50
|
+
- **XDG Desktop Portals & Flatpak**: use portal-backed GTK4 APIs (`GtkFileDialog`, `GtkUriLauncher`, `GtkFileLauncher`, `GNotification`, `GtkDropTarget` / `GdkDrag` two-way file DnD) or `libportal` / Rust `ashpd` so file open/save, print, notifications, and dark-mode settings work cleanly inside Flatpak sandboxes without broad `--filesystem=home` permissions.
|
|
51
|
+
- **XDG Base Directories & atomic writes**: store config in `g_get_user_config_dir()` (`$XDG_CONFIG_HOME`), persistent data/SQLite (`WAL` mode) in `g_get_user_data_dir()` (`$XDG_DATA_HOME`), state in `g_get_user_state_dir()` (`$XDG_STATE_HOME`), and caches in `g_get_user_cache_dir()` (`$XDG_CACHE_HOME`). Write files atomically via `g_file_set_contents_full(..., G_FILE_SET_CONTENTS_CONSISTENT, ...)` (temp file + `fsync` + atomic `rename`).
|
|
52
|
+
- **Linux packaging & signing**: distribute `.deb`/`.rpm`, **Flatpak** (Flathub manifest), and/or GPG-signed **AppImage** accompanied by validated `.desktop` + **AppStream metainfo XML** (`appstreamcli validate --pedantic` + `desktop-file-validate`).
|
|
16
53
|
|
|
17
|
-
|
|
54
|
+
## States, `close-request`, & async main-loop discipline
|
|
18
55
|
|
|
19
|
-
|
|
56
|
+
GTK4 replaced GTK3's removed `delete-event` with the **`close-request`** signal on `GtkWindow`. Return `true` (`GDK_EVENT_STOP`) to defer closing while presenting an `AdwAlertDialog` for unsaved documents:
|
|
20
57
|
|
|
21
|
-
|
|
58
|
+
```c
|
|
59
|
+
static gboolean on_close_request(GtkWindow *win, gpointer user_data) {
|
|
60
|
+
if (!app_has_unsaved_changes(user_data)) return FALSE; // allow close
|
|
61
|
+
show_unsaved_changes_dialog(win, user_data);
|
|
62
|
+
return TRUE; // hold window open until user decides
|
|
63
|
+
}
|
|
64
|
+
```
|
|
22
65
|
|
|
23
|
-
|
|
66
|
+
Never block the GLib main loop (`GMainContext`) with synchronous disk or network I/O; run work via `GTask` / `GIO` async APIs (or Rust `gio::spawn_blocking` / Python `GLib.idle_add` handoff) with `GCancellable` cancellation, `< 300 ms` cold start, and `~0%` idle CPU.
|
|
24
67
|
|
|
25
|
-
|
|
68
|
+
## Typography, motion, accessibility, & forms idioms
|
|
26
69
|
|
|
27
|
-
|
|
70
|
+
Use Pango text layout with semantic style classes (`title-1`, `heading`, `body`, `caption`); always escape dynamic user strings with `g_markup_escape_text` before passing into Pango markup. Honor `gtk-enable-animations` (`GtkSettings`) for custom motion—libadwaita animations honor it automatically.
|
|
28
71
|
|
|
29
|
-
Use
|
|
72
|
+
Use `GtkAccessible` properties (`GTK_ACCESSIBLE_PROPERTY_LABEL`, `DESCRIPTION`), keyboard shortcuts (`GtkShortcutController` + `AdwShortcutsDialog`), mnemonics (`_Save`), and `AdwEntryRow` / `AdwComboRow` / `AdwSwitchRow` inside `AdwPreferencesGroup` for clean, accessible forms. Verify with **Orca** (AT-SPI2) screen reader, keyboard-only traversal, and High Contrast mode.
|
|
30
73
|
|
|
31
74
|
## Do/don't pairs
|
|
32
75
|
|
|
33
76
|
| Do | Don't |
|
|
34
77
|
|---|---|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
78
|
+
| Connect `GtkWindow::close-request` to prompt on dirty documents | Reference removed GTK3 `delete-event` or lose edits on window close |
|
|
79
|
+
| Use `AdwNavigationSplitView` + `AdwBreakpoint` + `AdwDialog` + `:backdrop` dimming | Use deprecated `AdwLeaflet`, `GtkMessageDialog`, or override `:backdrop` unfocused states |
|
|
80
|
+
| Use `GtkFileDialog` / XDG Portals + XDG Base Dirs + `G_FILE_SET_CONTENTS_CONSISTENT` atomic saves | Request unrestricted `--filesystem=host` or write dotfiles directly into `$HOME` |
|
|
81
|
+
| Persist `width`/`height`/`maximized` on Wayland and validate AppStream/`.desktop` metadata | Attempt to save/restore global `(x, y)` coordinates on Wayland or ship invalid `.metainfo.xml` |
|
|
82
|
+
| Escape dynamic strings with `g_markup_escape_text` before Pango markup | Interpolate raw filenames into `<b>%s</b>` markup strings |
|
|
40
83
|
|
|
41
84
|
## Known traps
|
|
42
85
|
|
|
43
|
-
Blocking
|
|
86
|
+
Blocking `GMainContext` during I/O, using deprecated GTK3/libadwaita 1.0 APIs, breaking Flatpak sandboxes instead of using portals, assuming X11 global window positioning under Wayland, hard-coding light colors that fail `AdwStyleManager` High Contrast, custom `GtkDrawingArea` widgets missing `GtkAccessible` roles/labels.
|
|
44
87
|
|
|
45
88
|
## Verification commands
|
|
46
89
|
|
|
47
90
|
```sh
|
|
48
|
-
meson test
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
./your-app
|
|
91
|
+
meson test -C build
|
|
92
|
+
desktop-file-validate data/*.desktop
|
|
93
|
+
appstreamcli validate --no-net data/*.metainfo.xml
|
|
94
|
+
GTK_DEBUG=interactive ./build/your-app
|
|
52
95
|
```
|
|
53
96
|
|
|
54
|
-
|
|
97
|
+
Build, metadata validation, and unit tests are `static` evidence. Inspect live GTK Inspector (`GTK_DEBUG=interactive`), Wayland/tiling resize across breakpoints, Dark & High Contrast themes, **Orca** AT-SPI screen reader, keyboard-only navigation, and Flatpak sandbox portal behavior for `rendered` evidence; label untested desktop environments `not-checked`.
|
|
@@ -1,52 +1,81 @@
|
|
|
1
|
-
# Java desktop: JavaFX and Swing
|
|
1
|
+
# Java desktop: JavaFX (22+) and Swing (FlatLaf)
|
|
2
2
|
|
|
3
|
-
## Token mapping
|
|
3
|
+
## Token mapping & modern theming
|
|
4
4
|
|
|
5
|
-
JavaFX
|
|
5
|
+
- **JavaFX**: map DTCG semantic tokens to CSS custom properties in an application stylesheet (`.root { -pc-action: #0074ca; }`) or adopt **AtlantaFX** (`PrimerLight`, `PrimerDark`, `NordLight`, `NordDark`, `CupertinoLight`, `CupertinoDark`) which builds modern desktop themes cleanly on semantic CSS variables.
|
|
6
|
+
- **Swing**: adopt **FlatLaf** (`FlatLightLaf`, `FlatDarkLaf`, `FlatMacLightLaf`, `FlatMacDarkLaf`) rather than legacy Metal/Nimbus Look-and-Feels. FlatLaf provides crisp HiDPI vector icons, modern dark/light themes, native macOS/Windows titlebar integration, and semantic UI defaults via `FlatLaf.setGlobalExtraDefaults(...)` / `.properties` files.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Register bundled font files explicitly; verify fallback/glyphs, fractional DPI scaling, platform text settings, localization expansion. Do not hard-code pixel font metrics into preferred sizes.
|
|
14
|
-
|
|
15
|
-
## Motion/reduced motion
|
|
8
|
+
```java
|
|
9
|
+
// Swing + FlatLaf modern theme initialization (before constructing any Swing frames):
|
|
10
|
+
FlatLaf.setGlobalExtraDefaults(Map.of("@accentColor", "#0074CA"));
|
|
11
|
+
FlatLightLaf.setup(); // or FlatDarkLaf.setup() / FlatMacDarkLaf.setup()
|
|
12
|
+
```
|
|
16
13
|
|
|
17
|
-
|
|
14
|
+
Never scatter inline `-fx-background-color` strings or per-component `new Color(...)` literals across views.
|
|
15
|
+
|
|
16
|
+
## JavaFX 22+ `Platform.Preferences` (system dark mode, accent, reduced motion)
|
|
17
|
+
|
|
18
|
+
JavaFX 22+ natively exposes OS theme, accent color, reduced motion, and reduced transparency preferences through **`Platform.getPreferences()`**—observe these properties directly instead of guessing with OS-specific hacks:
|
|
19
|
+
|
|
20
|
+
```java
|
|
21
|
+
import javafx.application.ColorScheme;
|
|
22
|
+
import javafx.application.Platform;
|
|
23
|
+
import atlantafx.base.theme.PrimerDark;
|
|
24
|
+
import atlantafx.base.theme.PrimerLight;
|
|
25
|
+
|
|
26
|
+
var prefs = Platform.getPreferences();
|
|
27
|
+
Runnable syncTheme = () -> {
|
|
28
|
+
boolean dark = prefs.getColorScheme() == ColorScheme.DARK;
|
|
29
|
+
Application.setUserAgentStylesheet(
|
|
30
|
+
dark ? new PrimerDark().getUserAgentStylesheet()
|
|
31
|
+
: new PrimerLight().getUserAgentStylesheet()
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
syncTheme.run();
|
|
35
|
+
prefs.colorSchemeProperty().addListener((obs, oldVal, newVal) -> syncTheme.run());
|
|
36
|
+
// Also inspect prefs.reducedMotionProperty() and prefs.accentColorProperty()
|
|
37
|
+
```
|
|
18
38
|
|
|
19
|
-
##
|
|
39
|
+
## Layout, typography, & motion idioms
|
|
20
40
|
|
|
21
|
-
JavaFX
|
|
41
|
+
- **JavaFX**: use scene-graph layout panes (`BorderPane`, `VBox`, `HBox`, `GridPane`, `SplitPane`, `VirtualFlow`/`ListView`) with explicit `minWidth`/`minHeight`, resize persistence, and multi-monitor bounds clamping.
|
|
42
|
+
- **Swing**: always use layout managers (`BorderLayout`, `GridBagLayout`, `MigLayout`, `JSplitPane`)—never absolute `setBounds(...)` pixel placement.
|
|
43
|
+
- Register bundled TTF/OTF fonts (`Font.loadFont` in JavaFX; `GraphicsEnvironment.registerFont` in Swing) and verify fractional HiDPI rendering (`125%`/`150%`/`200%`), glyph fallback, and localized text expansion.
|
|
44
|
+
- Bind JavaFX `Timeline`/`Transition` duration or skip non-essential motion when `Platform.getPreferences().isReducedMotion()` is `true`; cancel Swing `Timer` and JavaFX animations on view close.
|
|
22
45
|
|
|
23
|
-
##
|
|
46
|
+
## Accessibility, states, & forms idioms
|
|
24
47
|
|
|
25
|
-
|
|
48
|
+
- **JavaFX**: built-in controls expose native OS accessibility trees; for custom `Node`/`Pane` controls, always set `setAccessibleRole(AccessibleRole.BUTTON)` and `setAccessibleText(...)` (plus `setAccessibleHelp(...)` sparingly).
|
|
49
|
+
- **Swing**: set `JLabel.setLabelFor(field)`, `getAccessibleContext().setAccessibleName(...)`, keyboard mnemonics (`setMnemonic`), and accelerators (`KeyStroke`).
|
|
50
|
+
- Never block the **JavaFX Application Thread** or **Swing EDT (Event Dispatch Thread)** with disk, database, or network I/O: use `javafx.concurrent.Task` / `Service` or `SwingWorker` / virtual threads with explicit cancellation and `Platform.runLater` / `SwingUtilities.invokeLater` handoff. Guard `setOnCloseRequest` / `WindowListener.windowClosing` for unsaved documents.
|
|
26
51
|
|
|
27
|
-
##
|
|
52
|
+
## Native packaging (`jlink` & `jpackage`)
|
|
28
53
|
|
|
29
|
-
|
|
54
|
+
Do not ask end users to install a matching system JDK manually. Build a stripped runtime image with `jlink` and package native signed OS installers/bundles with **`jpackage`** (`.dmg`/`.pkg` on macOS, `.msi`/`.exe` on Windows, `.deb`/`.rpm` on Linux) including app icons, file associations, and launcher metadata.
|
|
30
55
|
|
|
31
56
|
## Do/don't pairs
|
|
32
57
|
|
|
33
58
|
| Do | Don't |
|
|
34
59
|
|---|---|
|
|
35
|
-
| JavaFX `
|
|
36
|
-
| Swing
|
|
37
|
-
|
|
|
38
|
-
|
|
|
60
|
+
| Observe JavaFX 22+ `Platform.getPreferences()` for dark mode, accent, and reduced motion | Hard-code a light-only stylesheet or ignore system reduced motion |
|
|
61
|
+
| Use **AtlantaFX** (JavaFX) or **FlatLaf** (Swing) with semantic variables/defaults | Ship legacy 2000s Metal/Caspian themes or inline hex strings everywhere |
|
|
62
|
+
| Set `AccessibleRole` + `accessibleText` / `JLabel.setLabelFor` on controls | Use a clickable `Pane` or `JPanel` with no keyboard focus or screen-reader name |
|
|
63
|
+
| Run I/O in `Task`/`SwingWorker` off the FX thread / EDT with cancellation | Freeze the window by calling HTTP/SQL synchronously inside an `ActionListener` |
|
|
64
|
+
| Bundle self-contained native installers with `jlink` + `jpackage` | Ship a bare `.jar` requiring users to configure `JAVA_HOME` |
|
|
39
65
|
|
|
40
66
|
## Known traps
|
|
41
67
|
|
|
42
|
-
|
|
68
|
+
Blocking the FX Application Thread or Swing EDT, leaking strong listeners on `Platform.getPreferences()` or observable properties across closed windows, blurry bitmap icons under Windows `150%` scaling (use SVG/FlatSVGIcon or multi-resolution images), `setBounds` clipping localized strings, Swing/JavaFX interop (`JFXPanel`) focus/DPI bugs, missing macOS notarization or Windows signing on `jpackage` bundles.
|
|
43
69
|
|
|
44
70
|
## Verification commands
|
|
45
71
|
|
|
46
72
|
```sh
|
|
73
|
+
# Run the build tool configured in the repository (Maven or Gradle):
|
|
47
74
|
./mvnw verify
|
|
48
75
|
./gradlew test build
|
|
49
76
|
./gradlew run
|
|
77
|
+
# Packaging smoke test (requires JDK 21+ with jpackage):
|
|
78
|
+
jpackage --type app-image --name App --input build/libs --main-jar app.jar
|
|
50
79
|
```
|
|
51
80
|
|
|
52
|
-
|
|
81
|
+
`verify`/`test`/`build` provide `static` / logic evidence. Run the launched desktop app (and `jpackage` bundle) on target OSes across Light/Dark/High Contrast modes, fractional HiDPI, keyboard-only Tab/mnemonic traversal, VoiceOver/Narrator/Orca, and dirty-close recovery for `rendered` evidence; label untested OSes `not-checked`.
|