gentle-pi 4.6.0 → 4.8.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/README.md +65 -55
- package/assets/agents/gentle-ai-explore.md +4 -3
- package/assets/agents/gentle-ai-verify.md +23 -6
- package/assets/agents/gentle-ai-worker.md +9 -6
- package/assets/agents/jd-fix-agent.md +1 -0
- package/assets/agents/jd-judge-a.md +2 -3
- package/assets/agents/jd-judge-b.md +2 -3
- package/assets/agents/review-readability.md +1 -5
- package/assets/agents/review-reliability.md +1 -5
- package/assets/agents/review-resilience.md +1 -5
- package/assets/agents/review-risk.md +1 -5
- package/assets/design-canvas/canvas-api.js +45 -0
- package/assets/design-canvas/canvas-boards.js +456 -0
- package/assets/design-canvas/canvas-boot.js +217 -0
- package/assets/design-canvas/canvas-checks.js +491 -0
- package/assets/design-canvas/canvas-comments.js +315 -0
- package/assets/design-canvas/canvas-compare.js +159 -0
- package/assets/design-canvas/canvas-events.js +75 -0
- package/assets/design-canvas/canvas-export.js +393 -0
- package/assets/design-canvas/canvas-focus.js +203 -0
- package/assets/design-canvas/canvas-handoffs.js +150 -0
- package/assets/design-canvas/canvas-i18n-es.js +392 -0
- package/assets/design-canvas/canvas-i18n.js +108 -0
- package/assets/design-canvas/canvas-layout.js +526 -0
- package/assets/design-canvas/canvas-menu.js +213 -0
- package/assets/design-canvas/canvas-messages.js +86 -0
- package/assets/design-canvas/canvas-minimap.js +163 -0
- package/assets/design-canvas/canvas-parts.js +401 -0
- package/assets/design-canvas/canvas-popover.js +234 -0
- package/assets/design-canvas/canvas-rail.js +348 -0
- package/assets/design-canvas/canvas-sizes.js +524 -0
- package/assets/design-canvas/canvas-store.js +164 -0
- package/assets/design-canvas/canvas-tokens.js +674 -0
- package/assets/design-canvas/canvas-ui.js +24 -0
- package/assets/design-canvas/canvas-view.js +184 -0
- package/assets/design-canvas/canvas.css +759 -16
- package/assets/design-canvas/canvas.js +2 -1497
- package/assets/design-canvas/index.html +117 -36
- package/assets/design-canvas/inspector.js +546 -16
- package/assets/install-wizard/wizard.js +6 -1
- package/assets/migrations/agent-body-history.json +40 -1
- package/assets/orchestrator-delegation-reference.md +10 -16
- package/assets/orchestrator-delegation.md +5 -5
- package/assets/orchestrator-full-delegation-card.md +64 -0
- package/assets/orchestrator-full-delegation.md +34 -0
- package/assets/orchestrator-memory.md +5 -5
- package/assets/orchestrator-prompts.md +2 -2
- package/assets/orchestrator-quota-recovery.md +5 -0
- package/assets/orchestrator-skills.md +14 -13
- package/assets/orchestrator-tracking.md +10 -14
- package/assets/orchestrator-verification.md +12 -8
- package/assets/orchestrator-writer.md +4 -4
- package/assets/orchestrator.md +21 -25
- package/bin/gentle-shell.mjs +292 -65
- package/contracts/review-provider-contract-mirror/provider-contract.lock.json +8 -9
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/manifest.json +3 -3
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/orchestration/pi.md +1 -0
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/routing/pi.md +6 -6
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/generated/provider-capabilities.baseline.json +3 -3
- package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/generated/provider-roles.baseline.json +1 -1
- package/docs/agent-status.md +61 -0
- package/docs/assets/brand/sponsor-banner.svg +60 -0
- package/docs/bundled-install.md +20 -10
- package/docs/delegated-verification.md +46 -8
- package/docs/desktop-rpc.md +1253 -0
- package/docs/gentle-agents-activity.md +40 -0
- package/docs/gentle-shell.md +91 -30
- package/docs/install-wizard.md +30 -21
- package/docs/odd-preparation-continuity.md +24 -0
- package/docs/permission-modes.md +17 -4
- package/docs/prompt-budget.md +12 -0
- package/docs/rdd-odd-friction-triage-2026-11-07.md +57 -0
- package/docs/readme-reference.md +142 -45
- package/docs/render-cache-performance.md +11 -1
- package/docs/review-coordinator.md +53 -0
- package/docs/review-delivery-preflight.md +22 -0
- package/docs/review-request-context.md +19 -0
- package/docs/review-windows-acl.md +18 -0
- package/docs/voice.md +6 -3
- package/docs/work-continuity.md +11 -1
- package/docs/yolo-mode.md +5 -5
- package/extensions/ask-user-choice.ts +1 -0
- package/extensions/ask-user-question.ts +3 -2
- package/extensions/child-context.ts +21 -7
- package/extensions/child-safety.ts +3 -0
- package/extensions/gentle-agent-status.ts +99 -0
- package/extensions/gentle-agents.ts +559 -66
- package/extensions/gentle-ai.ts +2001 -518
- package/extensions/gentle-design.ts +69 -3
- package/extensions/gentle-desktop-rpc.ts +143 -0
- package/extensions/gentle-guide.ts +3 -0
- package/extensions/gentle-shell.ts +398 -115
- package/extensions/gentle-todo.ts +66 -27
- package/extensions/gentle-tps.ts +48 -0
- package/extensions/quiet-tools.ts +38 -8
- package/extensions/skill-registry.ts +349 -167
- package/extensions/startup-banner.ts +30 -3
- package/lib/agent-assets.ts +30 -6
- package/lib/agent-profile-pin.ts +3 -3
- package/lib/agent-profiles.ts +160 -2
- package/lib/agent-status.ts +105 -0
- package/lib/agent-tool-overlay.ts +117 -0
- package/lib/agents-config.ts +93 -6
- package/lib/agents-history.ts +24 -5
- package/lib/agents-message-delivery.ts +17 -0
- package/lib/agents-messaging.ts +55 -7
- package/lib/agents-protocol.ts +15 -0
- package/lib/agents-report-cap.ts +115 -0
- package/lib/agents-runner.ts +272 -16
- package/lib/agents-session-transport.ts +17 -1
- package/lib/auto-permission-runtime.ts +1 -1
- package/lib/background-jobs-tools.ts +9 -4
- package/lib/bounded-writer-admission.ts +197 -32
- package/lib/card-content-policy.ts +8 -6
- package/lib/child-context-files.ts +21 -6
- package/lib/codemode-renderer.ts +1 -0
- package/lib/command-palette.ts +133 -17
- package/lib/context-backstop.ts +14 -5
- package/lib/delivery-conflict-markers.ts +349 -0
- package/lib/design-canvas-assets.ts +36 -0
- package/lib/design-canvas-server.ts +241 -23
- package/lib/design-comments.ts +94 -4
- package/lib/design-handoffs.ts +2 -1
- package/lib/design-layout.ts +125 -0
- package/lib/design-parts.ts +281 -0
- package/lib/design-system-tokens.ts +111 -0
- package/lib/desktop-agents-service.ts +294 -0
- package/lib/desktop-design-service.ts +233 -0
- package/lib/desktop-jobs-service.ts +263 -0
- package/lib/desktop-rpc-agents.ts +294 -0
- package/lib/desktop-rpc-config.ts +731 -0
- package/lib/desktop-rpc-design.ts +138 -0
- package/lib/desktop-rpc-jobs.ts +181 -0
- package/lib/desktop-rpc-permissions.ts +177 -0
- package/lib/desktop-rpc-profiles.ts +196 -0
- package/lib/desktop-rpc-usage.ts +229 -0
- package/lib/desktop-rpc.ts +225 -0
- package/lib/desktop-usage-service.ts +310 -0
- package/lib/destructive-command-guard.ts +236 -17
- package/lib/execution-surface-guard.ts +20 -0
- package/lib/exploration-budget.ts +4 -2
- package/lib/gentle-ai-binary.ts +1 -1
- package/lib/gentle-ai-renderer.ts +13 -1
- package/lib/gentle-design.ts +204 -14
- package/lib/gentle-shell-bundled.ts +106 -28
- package/lib/gentle-shell-launcher.ts +43 -8
- package/lib/herdr-activity.ts +14 -2
- package/lib/herdr-busy.ts +45 -0
- package/lib/hidden-tools.ts +35 -0
- package/lib/image-attachments.ts +33 -0
- package/lib/image-disk-cache.ts +137 -0
- package/lib/inprocess-reviewer.ts +358 -144
- package/lib/jobs-view.ts +198 -11
- package/lib/model-fallback-policy.ts +9 -0
- package/lib/model-routing-authority.ts +31 -4
- package/lib/nan-provider.ts +42 -28
- package/lib/native-choice-list.ts +20 -2
- package/lib/native-review-cli.ts +172 -20
- package/lib/orchestrator-discovery.ts +39 -2
- package/lib/orchestrator-mode-policy.ts +105 -0
- package/lib/questionnaire/questionnaire-view.ts +105 -12
- package/lib/rdd-mode-control.ts +32 -0
- package/lib/reply-language-anchor.ts +129 -0
- package/lib/request-context-placement.ts +53 -0
- package/lib/review-blocker.ts +92 -0
- package/lib/review-candidate-symlink-scan.ts +136 -0
- package/lib/review-candidate-view-owner.ts +81 -44
- package/lib/review-candidate-view.ts +11 -1
- package/lib/review-continuation-registry.ts +116 -0
- package/lib/review-coordinator.ts +407 -0
- package/lib/review-delivery-preflight.ts +85 -0
- package/lib/review-failure-facts.ts +49 -0
- package/lib/review-host-relay.ts +51 -11
- package/lib/review-integration-v2.ts +63 -4
- package/lib/review-relay-phase-timing.ts +45 -0
- package/lib/review-start-context.ts +17 -0
- package/lib/reviewer-stream.ts +87 -0
- package/lib/session-profile-freeze.ts +4 -2
- package/lib/shell-bar.ts +140 -58
- package/lib/shell-changes.ts +2 -0
- package/lib/shell-panel.ts +17 -3
- package/lib/shell-prompt.ts +16 -3
- package/lib/shell-sidebar-layout.ts +112 -40
- package/lib/shell-sidebar.ts +7 -0
- package/lib/shell-todo.ts +10 -3
- package/lib/shell-usage.ts +10 -0
- package/lib/verifier-admission.ts +1 -1
- package/lib/vim-editor-adapter.ts +9 -2
- package/lib/visual-customization-policy.ts +36 -16
- package/lib/visual-customize-view.ts +216 -21
- package/lib/visual-layout-preview.ts +9 -5
- package/lib/visual-profiles.ts +2 -2
- package/lib/windows-session-transport.ts +53 -2
- package/lib/writer-batch-admission.ts +55 -0
- package/lib/yolo-session-policy.ts +46 -16
- package/package.json +3 -2
- package/prompts/skill-creation.md +1 -10
- package/runtime/design-canvas-assets.mjs +37 -0
- package/runtime/gentle-ai-binary.mjs +1 -1
- package/runtime/gentle-shell-bundled.mjs +106 -28
- package/runtime/gentle-shell-launcher.mjs +42 -7
- package/runtime/native-review-cli.mjs +169 -17
- package/runtime/review-integration-v2.mjs +63 -4
- package/scripts/bootstrap.cmd +2 -2
- package/scripts/bootstrap.sh +41 -4
- package/scripts/build-full-delegation-card.mjs +179 -0
- package/scripts/build-runtime-modules.mjs +1 -0
- package/scripts/bundled-install.mjs +38 -8
- package/scripts/download-progress.mjs +68 -0
- package/scripts/gentle-ai-installer.mjs +41 -18
- package/scripts/gentle-ai-proxy.mjs +294 -0
- package/scripts/install-gentle-ai.mjs +14 -1
- package/scripts/installer-downloads.mjs +34 -8
- package/scripts/installer-preflight.mjs +33 -22
- package/scripts/installer-probes.mjs +25 -5
- package/scripts/installer-runner.mjs +27 -12
- package/scripts/installer-server.mjs +46 -16
- package/scripts/installer-windows.mjs +2 -2
- package/scripts/pi-update.mjs +166 -27
- package/scripts/prepare-verifier.mjs +107 -0
- package/scripts/render-cache-host.mjs +72 -0
- package/scripts/render-cache-performance-worker.mjs +5 -4
- package/scripts/render-cache-performance.mjs +6 -1
- package/scripts/run-test-suite.mjs +40 -28
- package/scripts/update-agent-body-history.mjs +55 -8
- package/scripts/verify-package-files.mjs +50 -19
- package/scripts/voice-worker.cjs +32 -6
- package/skills/branch-pr/SKILL.md +16 -16
- package/skills/comment-writer/SKILL.md +1 -1
- package/skills/design/SKILL.md +16 -13
- package/skills/gentle-ai/SKILL.md +7 -7
- package/skills/gentle-ui-design/SKILL.md +46 -0
- package/skills/gentle-ui-design/references/adaptive-interfaces.md +46 -0
- package/skills/gentle-ui-design/references/browse-and-compare.md +62 -0
- package/skills/gentle-ui-design/references/composition-and-feedback.md +56 -0
- package/skills/gentle-ui-design/references/task-and-content.md +60 -0
- package/skills/judgment-day/SKILL.md +2 -2
- package/skills/judgment-day/references/prompts-and-formats.md +1 -1
- package/skills/rdd-defect-workflow/SKILL.md +6 -6
- package/skills/skill-improver/SKILL.md +2 -2
- package/skills/skill-registry/SKILL.md +11 -11
- package/skills/tui-design/SKILL.md +1 -1
- package/skills/work-unit-commits/SKILL.md +10 -11
- package/tests/agent-home.test.ts +28 -9
- package/tests/agent-profiles-workflow.test.ts +163 -0
- package/tests/agent-prompt-diet-contract.test.ts +101 -0
- package/tests/agent-risk-escalation.test.ts +1 -1
- package/tests/agent-status.test.ts +143 -0
- package/tests/agent-tool-overlay-acceptance.test.ts +158 -0
- package/tests/agent-tool-overlay.test.ts +89 -0
- package/tests/agents-config.test.ts +106 -1
- package/tests/agents-history.test.ts +31 -0
- package/tests/agents-jobs-frames.test.ts +93 -0
- package/tests/agents-message-delivery.test.ts +36 -0
- package/tests/agents-prompt-lifecycle-runtime.test.ts +376 -0
- package/tests/agents-queries.test.ts +144 -4
- package/tests/agents-report-cap.test.ts +126 -0
- package/tests/agents-runner-drain.test.ts +193 -0
- package/tests/agents-runner.test.ts +215 -3
- package/tests/agents-session-transport.test.ts +34 -0
- package/tests/always-on-prompt-verdicts-contract.test.ts +188 -0
- package/tests/append-system-prompt-route.test.ts +12 -1
- package/tests/approved-text-leftovers-contract.test.ts +136 -0
- package/tests/artifact-language.test.ts +1 -1
- package/tests/ask-user-choice.test.ts +4 -3
- package/tests/ask-user-question.test.ts +99 -1
- package/tests/audit-leftovers-contract.test.ts +51 -0
- package/tests/auto-permission-runtime.test.ts +1 -1
- package/tests/autonomous-guard.test.ts +346 -10
- package/tests/bounded-stop-contract.test.ts +51 -3
- package/tests/branch-pr-skill.test.ts +10 -1
- package/tests/bridge-cost.test.ts +19 -4
- package/tests/bundled-install.test.ts +31 -6
- package/tests/card-content-policy.test.ts +3 -3
- package/tests/chained-pr-skill.test.ts +8 -6
- package/tests/child-context-files.test.ts +64 -8
- package/tests/child-safety.test.ts +11 -0
- package/tests/child-skills-catalog.test.ts +56 -0
- package/tests/codegraph-tools.test.ts +11 -5
- package/tests/codemode-rendering.test.ts +4 -1
- package/tests/command-palette.test.ts +284 -1
- package/tests/delegate-for-reason-contract.test.ts +32 -10
- package/tests/delivery-conflict-markers.test.ts +348 -0
- package/tests/design-canvas-all-sizes.test.ts +631 -0
- package/tests/design-canvas-allowlist.test.ts +32 -0
- package/tests/design-canvas-assets.test.ts +11 -695
- package/tests/design-canvas-boards.test.ts +77 -0
- package/tests/design-canvas-checks.test.ts +655 -0
- package/tests/design-canvas-compare.test.ts +79 -0
- package/tests/design-canvas-events.test.ts +59 -0
- package/tests/design-canvas-export.test.ts +1168 -0
- package/tests/design-canvas-focus.test.ts +113 -0
- package/tests/design-canvas-handoffs.test.ts +59 -0
- package/tests/design-canvas-i18n-review.test.ts +513 -0
- package/tests/design-canvas-i18n-views.test.ts +259 -0
- package/tests/design-canvas-i18n.test.ts +526 -0
- package/tests/design-canvas-inspector.test.ts +937 -0
- package/tests/design-canvas-layout.test.ts +1222 -0
- package/tests/design-canvas-minimap.test.ts +413 -0
- package/tests/design-canvas-modules.test.ts +90 -0
- package/tests/design-canvas-parts.test.ts +721 -0
- package/tests/design-canvas-rail.test.ts +799 -0
- package/tests/design-canvas-server.test.ts +855 -17
- package/tests/design-canvas-sizes.test.ts +548 -0
- package/tests/design-canvas-store.test.ts +180 -0
- package/tests/design-canvas-tokens.test.ts +965 -0
- package/tests/design-canvas-view.test.ts +299 -0
- package/tests/design-comments.test.ts +201 -1
- package/tests/design-handoffs.test.ts +20 -0
- package/tests/design-layout.test.ts +100 -0
- package/tests/design-parts.test.ts +260 -0
- package/tests/design-system-tokens.test.ts +215 -0
- package/tests/desktop-rpc-agents.test.ts +893 -0
- package/tests/desktop-rpc-config.test.ts +1452 -0
- package/tests/desktop-rpc-design.test.ts +662 -0
- package/tests/desktop-rpc-jobs.test.ts +796 -0
- package/tests/desktop-rpc-permissions.test.ts +311 -0
- package/tests/desktop-rpc-profiles.test.ts +140 -0
- package/tests/desktop-rpc-safety.test.ts +119 -0
- package/tests/desktop-rpc-usage.test.ts +697 -0
- package/tests/desktop-rpc.test.ts +252 -0
- package/tests/destructive-command-guard.test.ts +52 -0
- package/tests/devbinary/pi-host-relay.devtest.ts +149 -80
- package/tests/devbinary/review-session-consent.devtest.ts +84 -0
- package/tests/download-progress.test.ts +71 -0
- package/tests/engram-safety.test.ts +111 -0
- package/tests/execution-surface-guard.test.ts +55 -0
- package/tests/fixtures/devbinary/status-v9-escalated-non-blocking.captured.json +92 -0
- package/tests/fixtures/devbinary/status-v9-escalated-non-blocking.provenance.md +3 -0
- package/tests/fixtures/primary-session-prompt/gentleman.golden.md +26 -31
- package/tests/fixtures/proxy-tls/proxy.crt +19 -0
- package/tests/fixtures/proxy-tls/proxy.key +28 -0
- package/tests/fixtures/refusal-identity.probe.mjs +139 -0
- package/tests/fixtures/session-profile-v1/gentle-ai-reviewer.ts +89 -0
- package/tests/fixtures/session-profile-v1/replay.ts +53 -6
- package/tests/full-delegation-closure.test.ts +160 -0
- package/tests/full-delegation-notices.test.ts +76 -0
- package/tests/generic-agent-tools.test.ts +3 -3
- package/tests/gentle-agent-status.test.ts +74 -0
- package/tests/gentle-agents-child-jobs.test.ts +237 -0
- package/tests/gentle-agents.test.ts +1403 -20
- package/tests/gentle-ai-binary.test.ts +3 -1
- package/tests/gentle-ai-child-guards.test.ts +1 -0
- package/tests/gentle-ai-elapsed-store.test.ts +19 -0
- package/tests/gentle-ai-exploration-budget.test.ts +18 -2
- package/tests/gentle-ai-installer.test.ts +135 -51
- package/tests/gentle-ai-proxy.test.ts +434 -0
- package/tests/gentle-ai-renderer.test.ts +36 -2
- package/tests/gentle-ai.test.ts +233 -43
- package/tests/gentle-design.test.ts +386 -1
- package/tests/gentle-herdr-activity.test.ts +9 -6
- package/tests/gentle-shell-bin.test.ts +123 -0
- package/tests/gentle-shell-bundled.test.ts +293 -31
- package/tests/gentle-shell-launcher.test.ts +78 -11
- package/tests/gentle-shell.test.ts +1017 -146
- package/tests/gentle-todo.test.ts +51 -11
- package/tests/gentle-tps.test.ts +123 -0
- package/tests/gentle-ui-design-skill.test.ts +59 -0
- package/tests/herdr-busy.test.ts +59 -0
- package/tests/herdr-task-summary-policy.test.ts +8 -4
- package/tests/hidden-tools.test.ts +188 -0
- package/tests/image-disk-cache.test.ts +163 -0
- package/tests/independent-recovery-delivery.test.ts +97 -0
- package/tests/inprocess-reviewer.test.ts +249 -4
- package/tests/install-wizard.test.ts +27 -1
- package/tests/installer-downloads.test.ts +30 -1
- package/tests/installer-posix-bootstrap.test.ts +115 -14
- package/tests/installer-preflight.test.ts +54 -5
- package/tests/installer-probes.test.ts +146 -0
- package/tests/installer-runner.test.ts +79 -44
- package/tests/installer-server.test.ts +215 -13
- package/tests/installer-windows-bootstrap.test.ts +19 -1
- package/tests/jobs-view.test.ts +260 -6
- package/tests/judgment-day-severity-admission.test.ts +46 -0
- package/tests/lazy-module-contradictions-contract.test.ts +158 -0
- package/tests/maintainer/desktop-rpc.maintest.ts +632 -0
- package/tests/maintainer/pi-update-source.maintest.ts +48 -18
- package/tests/modal-mouse-boundaries.test.ts +136 -0
- package/tests/model-fallback-policy.test.ts +26 -7
- package/tests/model-routing-authority.test.ts +178 -2
- package/tests/nan-provider-runtime.test.ts +17 -3
- package/tests/nan-provider.test.ts +111 -56
- package/tests/native-choice-list.test.ts +77 -2
- package/tests/native-review-capability-contract.test.ts +17 -1
- package/tests/native-review-cli-nonblocking-findings.test.ts +165 -0
- package/tests/native-review-cli.test.ts +269 -1
- package/tests/native-review-parity.test.ts +24 -5
- package/tests/native-review-refusal-identity.test.ts +25 -0
- package/tests/no-self-pause-contract.test.ts +13 -2
- package/tests/odd-integration.test.ts +11 -3
- package/tests/odd-routing-canonical-ratchet.test.ts +3 -3
- package/tests/odd-routing-contract.test.ts +80 -28
- package/tests/orchestrator-budget.test.ts +35 -5
- package/tests/orchestrator-consultation-sdk.test.ts +32 -6
- package/tests/orchestrator-delegation-mode.test.ts +154 -0
- package/tests/orchestrator-discovery.test.ts +28 -0
- package/tests/orchestrator-mode-policy.test.ts +175 -0
- package/tests/orchestrator-prompt-budget.test.ts +13 -2
- package/tests/orchestrator-prompt-diet-contract.test.ts +221 -0
- package/tests/orchestrator-rdd-ownership.test.ts +4 -3
- package/tests/orchestrator-work-search.test.ts +4 -2
- package/tests/package-files.test.ts +25 -1
- package/tests/package-manifest.test.ts +16 -13
- package/tests/parallel-reason-contract.test.ts +6 -3
- package/tests/permission-allowlist.test.ts +372 -0
- package/tests/persona-neutral-voseo.test.ts +4 -4
- package/tests/persona-reply-language.test.ts +1 -1
- package/tests/persona-single-channel.test.ts +13 -5
- package/tests/pi-update-launcher.test.ts +25 -7
- package/tests/pi-update-source.test.ts +113 -6
- package/tests/pi-update.test.ts +294 -19
- package/tests/pnpm-workspace-config.test.ts +58 -0
- package/tests/pnpm-workspace-policy.test.ts +47 -0
- package/tests/primary-context-files.test.ts +233 -0
- package/tests/primary-context-three-files.test.ts +174 -0
- package/tests/primary-session-prompt.test.ts +13 -0
- package/tests/profile-pin.test.ts +29 -2
- package/tests/profile-tier-footer.test.ts +5 -0
- package/tests/profiles-panel-delegation-mode.test.ts +422 -0
- package/tests/provider-defect-handoff.test.ts +9 -2
- package/tests/questionnaire-view.test.ts +115 -0
- package/tests/quiet-bash-runtime.test.ts +1 -1
- package/tests/quiet-tool-rendering.test.ts +48 -0
- package/tests/rdd-aware-verification-contract.test.ts +17 -12
- package/tests/rdd-customize.test.ts +287 -0
- package/tests/rdd-mode-cache.test.ts +450 -0
- package/tests/rdd-mode-control.test.ts +407 -0
- package/tests/rdd-mode-scope-regression.test.ts +137 -0
- package/tests/rdd-off-independent-regression.test.ts +69 -0
- package/tests/rdd-status-line.test.ts +112 -1
- package/tests/render-cache-performance.test.ts +171 -2
- package/tests/reply-language-anchor-placement.test.ts +184 -0
- package/tests/reply-language-anchor.test.ts +189 -0
- package/tests/request-context-append-only.test.ts +218 -0
- package/tests/request-context-placement.test.ts +148 -0
- package/tests/review-agent-end-preflight.test.ts +80 -2
- package/tests/review-blocker.test.ts +193 -0
- package/tests/review-candidate-owner-retry.test.ts +1 -1
- package/tests/review-candidate-symlink-scan.test.ts +157 -0
- package/tests/review-candidate-view.test.ts +66 -1
- package/tests/review-candidate-windows-boundary.test.ts +131 -0
- package/tests/review-candidate-windows-probe.test.ts +63 -0
- package/tests/review-committed-restart-ack.test.ts +129 -0
- package/tests/review-continuation-registry.test.ts +107 -0
- package/tests/review-contract-prompt.test.ts +1 -1
- package/tests/review-controller-native-routing.test.ts +261 -5
- package/tests/review-controller-workspace-root.test.ts +230 -3
- package/tests/review-controller.test.ts +98 -12
- package/tests/review-coordinator-correction-gate.test.ts +105 -0
- package/tests/review-coordinator-findings.test.ts +206 -0
- package/tests/review-coordinator-nonblocking-scope.test.ts +169 -0
- package/tests/review-coordinator-runtime.test.ts +117 -0
- package/tests/review-coordinator.test.ts +462 -0
- package/tests/review-delivery-preflight.test.ts +462 -0
- package/tests/review-due-compaction.test.ts +31 -0
- package/tests/review-due-public-boundary.test.ts +26 -0
- package/tests/review-failure-facts.test.ts +87 -0
- package/tests/review-host-relay-routing.test.ts +258 -4
- package/tests/review-host-relay.test.ts +39 -0
- package/tests/review-integration-nonblocking-findings.test.ts +108 -0
- package/tests/review-integration-v2.test.ts +46 -3
- package/tests/review-json-arguments.test.ts +105 -11
- package/tests/review-last-event-closure.test.ts +68 -0
- package/tests/review-ledger-contract.test.ts +19 -40
- package/tests/review-loadout-rdd-off-sdk.test.ts +95 -32
- package/tests/review-one-call-findings.test.ts +131 -0
- package/tests/review-one-call-followups.test.ts +308 -0
- package/tests/review-one-call-reviewer-requests.test.ts +207 -0
- package/tests/review-one-call.test.ts +452 -0
- package/tests/review-owner-identity.test.ts +60 -24
- package/tests/review-relay-phase-timing.test.ts +128 -0
- package/tests/review-relay-transport-agent.test.ts +39 -2
- package/tests/review-reviewer-evidence.test.ts +223 -0
- package/tests/review-risk-assessment.test.ts +126 -8
- package/tests/review-run-statement-guidance-independent.test.ts +54 -0
- package/tests/review-session-standing-permission-controller.test.ts +53 -3
- package/tests/review-start-context.test.ts +19 -0
- package/tests/review-tool-prose-budget.test.ts +122 -0
- package/tests/reviewer-stream.test.ts +149 -0
- package/tests/run-test-suite.test.ts +122 -1
- package/tests/runtime-harness.mjs +4 -1
- package/tests/sensitive-path-tools.test.ts +181 -5
- package/tests/session-profile-append-controller-pi.test.ts +60 -31
- package/tests/session-profile-binding.test.ts +19 -1
- package/tests/session-profile-disk-reader-pi.test.ts +58 -16
- package/tests/session-profile-extension.test.ts +2 -2
- package/tests/session-profile-v1-compat.test.ts +35 -1
- package/tests/shell-bar.test.ts +186 -42
- package/tests/shell-panel.test.ts +50 -22
- package/tests/shell-prompt.test.ts +17 -0
- package/tests/shell-sidebar-fullscreen.test.ts +5 -5
- package/tests/shell-sidebar-layout.test.ts +294 -23
- package/tests/shell-sidebar-scroll-benchmark.test.ts +1 -1
- package/tests/shell-surface-transparent.test.ts +89 -0
- package/tests/shell-todo.test.ts +12 -0
- package/tests/shell-usage.test.ts +59 -10
- package/tests/skill-contradictions-contract.test.ts +122 -0
- package/tests/skill-registry-watcher.test.ts +216 -2
- package/tests/skill-registry.test.ts +1461 -5
- package/tests/startup-banner.test.ts +152 -1
- package/tests/startup-home-repo.test.ts +2 -0
- package/tests/support/design-canvas-dom.ts +369 -0
- package/tests/support/review-coordinator-runtime.ts +264 -0
- package/tests/task-size-routing-contract.test.ts +45 -12
- package/tests/test-strength-contract.test.ts +2 -1
- package/tests/todo-request-append-only.test.ts +214 -0
- package/tests/tool-batching-contract.test.ts +3 -1
- package/tests/update-agent-body-history.test.ts +138 -0
- package/tests/verification-tiers-contract.test.ts +229 -0
- package/tests/verifier-admission.test.ts +49 -0
- package/tests/verifier-preparation.test.ts +229 -0
- package/tests/verify-agent-contract.test.ts +20 -2
- package/tests/verify-first-launch-contract.test.ts +162 -11
- package/tests/vim-editor-adapter.test.ts +2 -2
- package/tests/visual-customization-policy.test.ts +39 -6
- package/tests/visual-customize-view.test.ts +573 -9
- package/tests/visual-layout-preview.test.ts +15 -1
- package/tests/visual-profiles.test.ts +11 -0
- package/tests/voice-worker.test.ts +73 -2
- package/tests/windows-session-transport.test.ts +126 -0
- package/tests/work-continuity-contract.test.ts +77 -6
- package/tests/writer-admission-messages.test.ts +232 -0
- package/tests/writer-batch-admission.test.ts +66 -0
- package/tests/writer-edit-surface-scope.test.ts +52 -20
- package/tests/writer-feature-document-admission.test.ts +276 -0
- package/tests/yolo-customize.test.ts +27 -4
- package/tests/yolo-mode.test.ts +62 -18
- package/tests/yolo-session-policy.test.ts +270 -1
- package/skills/_shared/review-ledger-contract.md +0 -106
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/README.md +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/schemas/lens.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/schemas/refuter.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/schemas/targeted-validator.schema.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/vectors/lens.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/vectors/refuter.json +0 -0
- /package/contracts/review-provider-contract-mirror/{v1.4.0 → v1.5.0}/bundle/vectors/targeted-validator.json +0 -0
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
import { findAll, flush, handoffDoc, heardGeneration, inspectorPick, loadCanvas, memoryStorage, texts, withClass, type FakeElement } from "./support/design-canvas-dom.ts";
|
|
4
|
+
|
|
5
|
+
// The canvas language over the review surfaces (odd/tasks/canvas-i18n.md S2, S3, S8, S9): the comments panel and its
|
|
6
|
+
// filter, Send all, the comment box, the handoff row, Partial implementations, the token inspector and the Quality
|
|
7
|
+
// tab, each in Spanish after choosing Español and the exact English again after English, relabeled in place. What
|
|
8
|
+
// goes to the agent stays English (S3). Every assertion compares strings, numbers or booleans, never fake elements.
|
|
9
|
+
|
|
10
|
+
const LANGUAGE_KEY = "gentle-design:language";
|
|
11
|
+
const TECHNICAL_KEY = "gentle-design:technical";
|
|
12
|
+
const COMMENTS_URL = "/t/api/designs/alpha/comments";
|
|
13
|
+
const SEND_ALL_URL = "/t/api/designs/alpha/comments/send-all";
|
|
14
|
+
const PARTS_URL = "/t/api/designs/alpha/parts";
|
|
15
|
+
|
|
16
|
+
/** The canvas with index.html's language markup, an English browser, Implement only this online and the language `stored`. */
|
|
17
|
+
async function loadLanguage(replies: Record<string, unknown> = {}, stored?: string, seed: Record<string, string> = {}) {
|
|
18
|
+
const storage = memoryStorage({ ...seed, ...(stored === undefined ? {} : { [LANGUAGE_KEY]: stored }) });
|
|
19
|
+
const navigator = { languages: ["en-US"], language: "en-US" };
|
|
20
|
+
const canvas = await loadCanvas(300, replies, { delivery: { part: true } }, { localStorage: storage.localStorage, navigator }, true);
|
|
21
|
+
// The fake DOM starts every element visible; index.html starts these hidden.
|
|
22
|
+
for (const id of ["gd-popover", "gd-menu", "gd-device-menu", "gd-inspector", "gd-quality"]) canvas.document.getElementById(id).hidden = true;
|
|
23
|
+
canvas.boards.forEach((board, index) => { board.frame.rect = { left: 100 + index * 500, top: 120, width: 400, height: 300 }; });
|
|
24
|
+
return canvas;
|
|
25
|
+
}
|
|
26
|
+
type Canvas = Awaited<ReturnType<typeof loadLanguage>>;
|
|
27
|
+
|
|
28
|
+
const $ = (canvas: Canvas, id: string) => canvas.document.getElementById(id);
|
|
29
|
+
const settle = async () => { for (let i = 0; i < 10; i++) await flush(); };
|
|
30
|
+
const label = (item: FakeElement) => texts(item, "gd-menu-label")[0];
|
|
31
|
+
/** Opens Settings and chooses the language item `name` with Enter. */
|
|
32
|
+
function choose(canvas: Canvas, name: string) {
|
|
33
|
+
$(canvas, "gd-rail-settings").dispatch("click");
|
|
34
|
+
const item = findAll($(canvas, "gd-menu"), (element) => element.getAttribute("role") === "menuitemradio").find((candidate) => label(candidate) === name)!;
|
|
35
|
+
item.focus();
|
|
36
|
+
item.dispatch("keydown", { key: "Enter", shiftKey: false });
|
|
37
|
+
}
|
|
38
|
+
const marked = (canvas: Canvas, key: string) => findAll(canvas.document.body, (element) => element.getAttribute("data-i18n") === key).map((element) => element.textContent);
|
|
39
|
+
const markedAttribute = (canvas: Canvas, attribute: string, key: string) => findAll(canvas.document.body, (element) => element.getAttribute(`data-i18n-${attribute}`) === key).map((element) => element.getAttribute(attribute));
|
|
40
|
+
/** Runs `read` in English, Spanish and English again, checking each against what is expected, and that no frame reloads. */
|
|
41
|
+
async function bothWays<T>(canvas: Canvas, read: () => T, english: T, spanish: T) {
|
|
42
|
+
const frames = canvas.frames();
|
|
43
|
+
const sources = frames.map((frame) => frame.src);
|
|
44
|
+
const fetched = canvas.fetched.length;
|
|
45
|
+
assert.deepEqual(read(), english);
|
|
46
|
+
choose(canvas, "Español");
|
|
47
|
+
assert.deepEqual(read(), spanish);
|
|
48
|
+
choose(canvas, "English");
|
|
49
|
+
assert.deepEqual(read(), english);
|
|
50
|
+
await settle();
|
|
51
|
+
assert.equal(canvas.fetched.length, fetched, "a switch fetches nothing");
|
|
52
|
+
assert.ok(canvas.frames().length === frames.length && canvas.frames().every((frame, index) => frame === frames[index] && frame.src === sources[index]), "the same frames, none reloaded");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ---- the comments panel, its filter and Send all (canvas-comments.js, index.html)
|
|
56
|
+
|
|
57
|
+
const comment = (id: string, file: string, extra: Record<string, unknown> = {}) => ({ id, file, selector: `#${id}`, excerpt: "", comment: `Text of ${id}`, status: "open", createdAt: "2026-10-26T10:00:00.000Z", sentAt: null, ...extra });
|
|
58
|
+
const COMMENTS = { comments: [
|
|
59
|
+
comment("c1", "01-a.html", { viewport: { width: 390, height: 844 } }),
|
|
60
|
+
comment("c2", "01-a.html", { sentAt: "2026-10-26T11:00:00.000Z", screenshot: { mimeType: "image/png" } }),
|
|
61
|
+
comment("c3", "02-b.html", { status: "resolved" }),
|
|
62
|
+
] };
|
|
63
|
+
|
|
64
|
+
function panel(canvas: Canvas) {
|
|
65
|
+
const items = withClass($(canvas, "gd-comment-list"), "gd-comment-item").map((item) => {
|
|
66
|
+
const show = withClass(item, "gd-comment-show")[0];
|
|
67
|
+
const toggle = withClass(item, "gd-comment-actions")[0].children[0];
|
|
68
|
+
const chip = withClass(item, "gd-comment-viewport")[0];
|
|
69
|
+
const shot = withClass(item, "gd-comment-shot")[0];
|
|
70
|
+
return [show.getAttribute("aria-label"), ...texts(item, "gd-badge"), chip ? `${chip.textContent} | ${chip.title}` : "", shot ? shot.alt : "", toggle.textContent, toggle.getAttribute("aria-label")];
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
review: [...marked(canvas, "review"), ...markedAttribute(canvas, "aria-label", "review")],
|
|
74
|
+
tabs: [...marked(canvas, "comments"), ...marked(canvas, "tabComments"), ...marked(canvas, "quality"), $(canvas, "gd-count-comments").textContent],
|
|
75
|
+
filter: [...markedAttribute(canvas, "aria-label", "showComments"), $(canvas, "gd-filter-open").textContent, $(canvas, "gd-filter-resolved").textContent],
|
|
76
|
+
list: markedAttribute(canvas, "aria-label", "comments"),
|
|
77
|
+
sendAll: $(canvas, "gd-send-all").textContent,
|
|
78
|
+
items,
|
|
79
|
+
pins: withClass(canvas.world, "gd-pin").map((pin) => pin.getAttribute("aria-label")),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
test("the comments panel in Spanish: tabs, filter counts, Send all (n), each card's badges, size chip and Resolve, and the pins; the exact English again", async () => {
|
|
84
|
+
const canvas = await loadLanguage({ [COMMENTS_URL]: COMMENTS });
|
|
85
|
+
canvas.message(canvas.boards[0].frame.contentWindow, { type: "gd:pin-rects", rects: [{ id: "c1", rect: { x: 10, y: 10, width: 20, height: 20 } }, { id: "c2", rect: null }] });
|
|
86
|
+
const english = {
|
|
87
|
+
review: ["Review", "Review"],
|
|
88
|
+
tabs: ["Comments", "Comments", "Quality", "2"],
|
|
89
|
+
filter: ["Show comments", "Open (2)", "Resolved (1)"],
|
|
90
|
+
list: ["Comments"],
|
|
91
|
+
sendAll: "Send all (1)",
|
|
92
|
+
items: [
|
|
93
|
+
["Show comment 1 on 01-a.html", "Not sent", "Phone 390 × 844 | Made at Phone 390 × 844", "", "Resolve", "Resolve comment 1"],
|
|
94
|
+
["Show comment 2 on 01-a.html", "Sent", "Detached", "", "Screenshot of comment 2", "Resolve", "Resolve comment 2"],
|
|
95
|
+
],
|
|
96
|
+
pins: ["Comment 1 (open): Text of c1"],
|
|
97
|
+
};
|
|
98
|
+
const spanish = {
|
|
99
|
+
review: ["Revisión", "Revisión"],
|
|
100
|
+
tabs: ["Comentarios", "Comentarios", "Calidad", "2"],
|
|
101
|
+
filter: ["Mostrar comentarios", "Abiertos (2)", "Resueltos (1)"],
|
|
102
|
+
list: ["Comentarios"],
|
|
103
|
+
sendAll: "Enviar todo (1)",
|
|
104
|
+
items: [
|
|
105
|
+
["Mostrar el comentario 1 en 01-a.html", "Aún no enviado", "Móvil 390 × 844 | Hecho en Móvil 390 × 844", "", "Resolver", "Resolver el comentario 1"],
|
|
106
|
+
["Mostrar el comentario 2 en 01-a.html", "Enviado", "Desvinculado", "", "Captura del comentario 2", "Resolver", "Resolver el comentario 2"],
|
|
107
|
+
],
|
|
108
|
+
pins: ["Comentario 1 (abierto): Text of c1"],
|
|
109
|
+
};
|
|
110
|
+
await bothWays(canvas, () => panel(canvas), english, spanish);
|
|
111
|
+
|
|
112
|
+
// The resolved filter: Reopen.
|
|
113
|
+
$(canvas, "gd-filter-resolved").dispatch("click");
|
|
114
|
+
const resolved = () => panel(canvas).items;
|
|
115
|
+
await bothWays(canvas, resolved, [["Show comment 3 on 02-b.html", "Not sent", "", "", "Reopen", "Reopen comment 3"]], [["Mostrar el comentario 3 en 02-b.html", "Aún no enviado", "", "", "Reabrir", "Reabrir el comentario 3"]]);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
test("the comments panel's empty states in Spanish, and the exact English again", async () => {
|
|
119
|
+
const none = await loadLanguage();
|
|
120
|
+
const empty = (canvas: Canvas) => [$(canvas, "gd-panel-empty").hidden, $(canvas, "gd-panel-empty").textContent, $(canvas, "gd-filter-open").textContent, $(canvas, "gd-send-all").textContent];
|
|
121
|
+
await bothWays(none, () => empty(none), [false, "No comments yet. Turn on Comment mode and click an element.", "Open (0)", "Send all (0)"], [false, "Aún no hay comentarios. Activa el modo Comentar y haz clic en un elemento.", "Abiertos (0)", "Enviar todo (0)"]);
|
|
122
|
+
|
|
123
|
+
const open = await loadLanguage({ [COMMENTS_URL]: { comments: [comment("c1", "01-a.html")] } });
|
|
124
|
+
$(open, "gd-filter-resolved").dispatch("click");
|
|
125
|
+
await bothWays(open, () => empty(open)[1], "No resolved comments.", "No hay comentarios resueltos.");
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test("a switch keeps Send all disabled while its request is in flight, so a second click cannot send again", async () => {
|
|
129
|
+
const canvas = await loadLanguage({ [COMMENTS_URL]: COMMENTS, [SEND_ALL_URL]: { ok: true, sent: 1 } });
|
|
130
|
+
const sends = () => canvas.posts.filter((post) => post.url === SEND_ALL_URL).length;
|
|
131
|
+
$(canvas, "gd-send-all").dispatch("click");
|
|
132
|
+
assert.equal($(canvas, "gd-send-all").disabled, true, "disabled while sending");
|
|
133
|
+
choose(canvas, "Español");
|
|
134
|
+
assert.equal($(canvas, "gd-send-all").disabled, true, "still disabled after the switch, before the reply");
|
|
135
|
+
if (!$(canvas, "gd-send-all").disabled) $(canvas, "gd-send-all").dispatch("click");
|
|
136
|
+
await settle();
|
|
137
|
+
assert.equal(sends(), 1, "one request");
|
|
138
|
+
assert.equal($(canvas, "gd-send-all").textContent.startsWith("Enviar todo"), true, "and the button is in the new language once it settles");
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
test("in Spanish the status lines of Send all (one or two), Resolve and Comment mode, and the Save button in Collect", async () => {
|
|
142
|
+
const canvas = await loadLanguage({ [COMMENTS_URL]: COMMENTS, [SEND_ALL_URL]: { ok: true, sent: 1 } }, "es");
|
|
143
|
+
const status = () => $(canvas, "gd-status").textContent;
|
|
144
|
+
$(canvas, "gd-send-all").dispatch("click");
|
|
145
|
+
await settle();
|
|
146
|
+
assert.equal(status(), "Se envió 1 comentario a la sesión");
|
|
147
|
+
assert.deepEqual(canvas.posts.at(-1), { url: SEND_ALL_URL, body: {} });
|
|
148
|
+
canvas.replies[SEND_ALL_URL] = { ok: true, sent: 2 };
|
|
149
|
+
$(canvas, "gd-send-all").disabled = false;
|
|
150
|
+
$(canvas, "gd-send-all").dispatch("click");
|
|
151
|
+
await settle();
|
|
152
|
+
assert.equal(status(), "Se enviaron 2 comentarios a la sesión");
|
|
153
|
+
canvas.replies[`${COMMENTS_URL}/c1/status`] = { ok: true };
|
|
154
|
+
withClass($(canvas, "gd-comment-list"), "gd-comment-actions")[0].children[0].dispatch("click");
|
|
155
|
+
await settle();
|
|
156
|
+
assert.equal(status(), "Comentario resuelto");
|
|
157
|
+
$(canvas, "gd-comment").dispatch("click");
|
|
158
|
+
assert.equal(status(), "Modo Comentar: haz clic en un elemento de una propuesta");
|
|
159
|
+
|
|
160
|
+
$(canvas, "gd-mode-collect").dispatch("change");
|
|
161
|
+
assert.equal($(canvas, "gd-popover-send").textContent, "Guardar");
|
|
162
|
+
choose(canvas, "English");
|
|
163
|
+
assert.equal($(canvas, "gd-popover-send").textContent, "Save");
|
|
164
|
+
choose(canvas, "Español");
|
|
165
|
+
assert.equal($(canvas, "gd-popover-send").textContent, "Guardar");
|
|
166
|
+
$(canvas, "gd-mode-send").dispatch("change");
|
|
167
|
+
assert.equal($(canvas, "gd-popover-send").textContent, "Enviar");
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// ---- the comment box (canvas-popover.js, index.html)
|
|
171
|
+
|
|
172
|
+
function pick(canvas: Canvas, index = 0) {
|
|
173
|
+
if ($(canvas, "gd-comment").getAttribute("aria-pressed") !== "true") $(canvas, "gd-comment").dispatch("click");
|
|
174
|
+
const frame = canvas.frames()[index];
|
|
175
|
+
canvas.message(frame.contentWindow, inspectorPick(frame, { type: "gd:pick", selector: "nav.side", excerpt: "Home Tours", rect: { x: 1, y: 1, width: 10, height: 10 } }));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
test("the comment box in Spanish: its title, field, placeholder, screenshot controls, buttons and the limit message; the exact English again", async () => {
|
|
179
|
+
const canvas = await loadLanguage();
|
|
180
|
+
pick(canvas);
|
|
181
|
+
const box = () => {
|
|
182
|
+
$(canvas, "gd-popover-text").value = "";
|
|
183
|
+
$(canvas, "gd-popover-form").dispatch("submit");
|
|
184
|
+
return [
|
|
185
|
+
...marked(canvas, "commentOn"), $(canvas, "gd-popover-target").textContent, ...marked(canvas, "commentLabel"), ...markedAttribute(canvas, "placeholder", "placeholder"),
|
|
186
|
+
$(canvas, "gd-shot-attach").textContent, $(canvas, "gd-shot-attach").getAttribute("title"), $(canvas, "gd-shot-image").getAttribute("alt"), $(canvas, "gd-shot-remove").textContent,
|
|
187
|
+
$(canvas, "gd-popover-cancel").textContent, $(canvas, "gd-popover-part").textContent, $(canvas, "gd-popover-part").title, $(canvas, "gd-popover-send").textContent,
|
|
188
|
+
$(canvas, "gd-popover-message").textContent,
|
|
189
|
+
];
|
|
190
|
+
};
|
|
191
|
+
await bothWays(canvas, box, [
|
|
192
|
+
"Comment on", "01-a.html · nav.side", "Comment", "What should change?",
|
|
193
|
+
"Attach screenshot", "Or paste an image, or drop one here (PNG, JPEG, WebP or GIF, up to 5 MB)", "Attached screenshot", "Remove",
|
|
194
|
+
"Cancel", "Implement only this", "Build only this element in the project; the field is an optional note", "Send",
|
|
195
|
+
"Write a comment of 1 to 2000 characters.",
|
|
196
|
+
], [
|
|
197
|
+
"Comentar en", "01-a.html · nav.side", "Comentario", "¿Qué debería cambiar?",
|
|
198
|
+
"Adjuntar captura", "O pega una imagen, o suéltala aquí (PNG, JPEG, WebP o GIF, hasta 5 MB)", "Captura adjunta", "Quitar",
|
|
199
|
+
"Cancelar", "Implementar solo esto", "Construir solo este elemento en el proyecto; el campo es una nota opcional", "Enviar",
|
|
200
|
+
"Escribe un comentario de 1 a 2000 caracteres.",
|
|
201
|
+
]);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
test("a validation message already on screen is worded again when the language switches", async () => {
|
|
205
|
+
const canvas = await loadLanguage();
|
|
206
|
+
pick(canvas);
|
|
207
|
+
$(canvas, "gd-popover-text").value = "";
|
|
208
|
+
$(canvas, "gd-popover-form").dispatch("submit");
|
|
209
|
+
assert.equal($(canvas, "gd-popover-message").textContent, "Write a comment of 1 to 2000 characters.");
|
|
210
|
+
choose(canvas, "Español");
|
|
211
|
+
assert.equal($(canvas, "gd-popover-message").textContent, "Escribe un comentario de 1 a 2000 caracteres.", "the message follows the language");
|
|
212
|
+
assert.equal($(canvas, "gd-popover-message").classes.has("gd-error"), true, "and stays an error");
|
|
213
|
+
choose(canvas, "English");
|
|
214
|
+
assert.equal($(canvas, "gd-popover-message").textContent, "Write a comment of 1 to 2000 characters.");
|
|
215
|
+
// A message that is a server's own text (a failed send) is not the canvas's wording: it stays as it came.
|
|
216
|
+
$(canvas, "gd-popover-text").value = "x";
|
|
217
|
+
$(canvas, "gd-popover-form").dispatch("submit");
|
|
218
|
+
await settle();
|
|
219
|
+
choose(canvas, "Español");
|
|
220
|
+
assert.doesNotMatch($(canvas, "gd-popover-message").textContent, /^Escribe un comentario/, "a later message replaced the validation one");
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
test("a switch leaves Implement only this's own message alone, even after a comment-box message", async () => {
|
|
224
|
+
const canvas = await loadLanguage({ "/t/api/designs/alpha/implement-part": { __http: 409, error: "too-many-parts" } });
|
|
225
|
+
pick(canvas);
|
|
226
|
+
$(canvas, "gd-popover-text").value = "";
|
|
227
|
+
$(canvas, "gd-popover-form").dispatch("submit");
|
|
228
|
+
$(canvas, "gd-popover-text").value = "note";
|
|
229
|
+
$(canvas, "gd-popover-part").dispatch("click");
|
|
230
|
+
await settle();
|
|
231
|
+
const refusal = $(canvas, "gd-popover-message").textContent;
|
|
232
|
+
assert.notEqual(refusal, "Write a comment of 1 to 2000 characters.", "the refusal replaced the validation message");
|
|
233
|
+
choose(canvas, "Español");
|
|
234
|
+
assert.equal($(canvas, "gd-popover-message").textContent, refusal, "the parts message is not the comment box's to word again");
|
|
235
|
+
assert.doesNotMatch($(canvas, "gd-popover-message").textContent, /Escribe un comentario/);
|
|
236
|
+
assert.equal($(canvas, "gd-popover-message").title, "too-many-parts");
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
test("identical comment and Parts errors preserve display ownership across language switches", async () => {
|
|
240
|
+
const canvas = await loadLanguage({
|
|
241
|
+
"/t/api/comments": { __throw: "Failed to fetch" },
|
|
242
|
+
"/t/api/designs/alpha/implement-part": { __http: 500, error: "Failed to fetch" },
|
|
243
|
+
});
|
|
244
|
+
pick(canvas);
|
|
245
|
+
const content = " Keep my wording: más grande ";
|
|
246
|
+
$(canvas, "gd-popover-text").value = content;
|
|
247
|
+
const message = () => {
|
|
248
|
+
const line = $(canvas, "gd-popover-message");
|
|
249
|
+
return [line.textContent, line.title, line.classes.has("gd-error")];
|
|
250
|
+
};
|
|
251
|
+
const fetched = canvas.fetched.length;
|
|
252
|
+
$(canvas, "gd-popover-form").dispatch("submit");
|
|
253
|
+
await settle();
|
|
254
|
+
await bothWays(canvas, message, ["Not sent: Failed to fetch", "", true], ["No se envió: Failed to fetch", "", true]);
|
|
255
|
+
assert.equal($(canvas, "gd-popover-text").value, content, "a failed comment keeps the user's field");
|
|
256
|
+
|
|
257
|
+
$(canvas, "gd-popover-part").dispatch("click");
|
|
258
|
+
await settle();
|
|
259
|
+
await bothWays(canvas, message, ["Not sent: Failed to fetch", "Failed to fetch", true], ["Not sent: Failed to fetch", "Failed to fetch", true]);
|
|
260
|
+
assert.equal($(canvas, "gd-popover-text").value, content, "a failed part and both switches keep the user's field");
|
|
261
|
+
assert.equal(canvas.fetched.length, fetched + 2, "only the two submits fetch");
|
|
262
|
+
assert.deepEqual(canvas.posts, [
|
|
263
|
+
{ url: "/t/api/comments", body: { slug: "alpha", file: "01-a.html", selector: "nav.side", excerpt: "Home Tours", comment: content.trim(), mode: "send" } },
|
|
264
|
+
{ url: "/t/api/designs/alpha/implement-part", body: { file: "01-a.html", selector: "nav.side", excerpt: "Home Tours", note: content.trim() } },
|
|
265
|
+
]);
|
|
266
|
+
|
|
267
|
+
// A new comment validation takes the line back and drops the Parts refusal's raw-code tooltip.
|
|
268
|
+
$(canvas, "gd-popover-text").value = "";
|
|
269
|
+
$(canvas, "gd-popover-form").dispatch("submit");
|
|
270
|
+
await bothWays(canvas, message, ["Write a comment of 1 to 2000 characters.", "", true], ["Escribe un comentario de 1 a 2000 caracteres.", "", true]);
|
|
271
|
+
assert.equal(canvas.posts.length, 2, "validation sends nothing");
|
|
272
|
+
assert.equal(canvas.fetched.length, fetched + 2, "validation and switches fetch nothing");
|
|
273
|
+
assert.equal($(canvas, "gd-count-comments").textContent, "0", "failed submits add no comments");
|
|
274
|
+
assert.equal($(canvas, "gd-parts").hidden, true, "failed submits add no parts");
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
test("the offline note of Implement only this is in the stored language from the start, not only after a switch", async () => {
|
|
278
|
+
const storage = memoryStorage({ [LANGUAGE_KEY]: "es" });
|
|
279
|
+
const navigator = { languages: ["en-US"], language: "en-US" };
|
|
280
|
+
const canvas = await loadCanvas(300, {}, { delivery: {} }, { localStorage: storage.localStorage, navigator }, true);
|
|
281
|
+
for (const id of ["gd-popover", "gd-menu", "gd-device-menu", "gd-inspector", "gd-quality"]) canvas.document.getElementById(id).hidden = true;
|
|
282
|
+
canvas.boards.forEach((board, index) => { board.frame.rect = { left: 100 + index * 500, top: 120, width: 400, height: 300 }; });
|
|
283
|
+
pick(canvas as unknown as Canvas);
|
|
284
|
+
const note = () => findAll(canvas.document.getElementById("gd-popover-form"), (element) => element.id === "gd-popover-part-note")[0].textContent;
|
|
285
|
+
assert.equal(note(), "El canvas no está conectado a una sesión de Pi; ábrelo con /gentle:design open");
|
|
286
|
+
choose(canvas as unknown as Canvas, "English");
|
|
287
|
+
assert.equal(note(), "The canvas is not connected to a Pi session; open it with /gentle:design open");
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
test("in Spanish a comment is posted as written, with no word of the canvas in it, and the box says it was sent in Spanish", async () => {
|
|
291
|
+
const canvas = await loadLanguage({ "/t/api/comments": { __http: 202, ok: true } }, "es");
|
|
292
|
+
pick(canvas);
|
|
293
|
+
$(canvas, "gd-popover-text").value = " Hazlo más grande ";
|
|
294
|
+
$(canvas, "gd-popover-form").dispatch("submit");
|
|
295
|
+
assert.equal($(canvas, "gd-popover-message").textContent, "Enviando…");
|
|
296
|
+
await settle();
|
|
297
|
+
assert.deepEqual(canvas.posts.at(-1), { url: "/t/api/comments", body: { slug: "alpha", file: "01-a.html", selector: "nav.side", excerpt: "Home Tours", comment: "Hazlo más grande", mode: "send" } });
|
|
298
|
+
assert.deepEqual([$(canvas, "gd-popover-message").textContent, $(canvas, "gd-status").textContent], ["Enviado a la sesión", "Enviado a la sesión"]);
|
|
299
|
+
pick(canvas);
|
|
300
|
+
canvas.replies["/t/api/comments"] = { __http: 500, reason: "disk full" };
|
|
301
|
+
$(canvas, "gd-popover-text").value = "Otra";
|
|
302
|
+
$(canvas, "gd-popover-form").dispatch("submit");
|
|
303
|
+
await settle();
|
|
304
|
+
assert.equal($(canvas, "gd-popover-message").textContent, "No se envió: disk full");
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
// ---- the handoff row (canvas-handoffs.js)
|
|
308
|
+
|
|
309
|
+
test("the handoff row in Spanish: Chosen, Alternative, the state, the feature's tooltip and Compare; the exact English again", async () => {
|
|
310
|
+
const doc = handoffDoc("01-a.html", { "01-a.html": { status: "implemented", previewUrl: "http://localhost:5173/login", feature: "odd/tasks/login.md" } });
|
|
311
|
+
const canvas = await loadLanguage({ "/t/api/designs/alpha/handoffs": doc });
|
|
312
|
+
const row = () => canvas.boards.map(({ wrapper }) => {
|
|
313
|
+
const handoff = withClass(wrapper, "gd-handoff")[0];
|
|
314
|
+
const compare = withClass(handoff, "gd-compare-start")[0];
|
|
315
|
+
const feature = withClass(handoff, "gd-handoff-feature")[0];
|
|
316
|
+
return [...texts(handoff, "gd-choice"), ...texts(handoff, "gd-handoff-badge"), feature ? `${feature.textContent} | ${feature.title}` : "", compare ? `${compare.textContent} | ${compare.getAttribute("aria-label")}` : ""];
|
|
317
|
+
});
|
|
318
|
+
await bothWays(canvas, row, [
|
|
319
|
+
["Chosen", "Implemented ✓", "odd/tasks/login.md | Tracked in this ODD feature document", "Compare | Compare First with the running app"],
|
|
320
|
+
["Alternative", "", ""],
|
|
321
|
+
], [
|
|
322
|
+
["Elegida", "Implementada ✓", "odd/tasks/login.md | Seguido en este documento de funcionalidad de ODD", "Comparar | Comparar First con la app en marcha"],
|
|
323
|
+
["Alternativa", "", ""],
|
|
324
|
+
]);
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
// ---- Partial implementations (canvas-parts.js, index.html)
|
|
328
|
+
|
|
329
|
+
test("Partial implementations in Spanish: the title with its count, states, times with a Spanish date, Show and Remove; the exact English again", async () => {
|
|
330
|
+
const today = new Date();
|
|
331
|
+
today.setHours(9, 30, 0, 0);
|
|
332
|
+
const parts = { version: 1, parts: [
|
|
333
|
+
{ id: "p1", file: "01-a.html", selector: "nav.side", excerpt: "Home Tours", status: "sent", queued: false, sentAt: today.toISOString(), startedAt: null, implementedAt: null },
|
|
334
|
+
{ id: "p2", file: "02-b.html", selector: "#pay", excerpt: "", status: "implemented", queued: false, sentAt: "2020-03-01T08:00:00.000Z", startedAt: null, implementedAt: new Date(2020, 2, 4, 9, 5).toISOString(), note: "Done" },
|
|
335
|
+
] };
|
|
336
|
+
const canvas = await loadLanguage({ [PARTS_URL]: parts });
|
|
337
|
+
const list = () => [
|
|
338
|
+
...marked(canvas, "partsTitle"),
|
|
339
|
+
...withClass($(canvas, "gd-parts-list"), "gd-part").map((item) => [...["gd-part-title", "gd-part-state", "gd-part-excerpt", "gd-part-time", "gd-part-note"].map((name) => texts(item, name)[0] ?? ""), ...withClass(item, "gd-part-actions")[0].children.filter((child) => child.localName === "button").map((button) => `${button.textContent} | ${button.getAttribute("aria-label")}`)].join(" / ")),
|
|
340
|
+
texts($(canvas, "gd-parts-list"), "gd-part-question")[0],
|
|
341
|
+
];
|
|
342
|
+
await bothWays(canvas, list, [
|
|
343
|
+
"Partial implementations · 2",
|
|
344
|
+
"First / Sent / “Home Tours” / Sent at 09:30 / / Show | Show part 1 in 01-a.html / Remove | Remove part 1 in 01-a.html",
|
|
345
|
+
"Second / Implemented ✓ / / Implemented on Mar 4 2020, 09:05 / “Done” / Show | Show part 2 in 02-b.html",
|
|
346
|
+
"Remove this part? The agent can no longer report on it.",
|
|
347
|
+
], [
|
|
348
|
+
"Implementaciones parciales · 2",
|
|
349
|
+
"First / Enviada / «Home Tours» / Enviada a las 09:30 / / Mostrar | Mostrar la parte 1 en 01-a.html / Quitar | Quitar la parte 1 en 01-a.html",
|
|
350
|
+
"Second / Implementada ✓ / / Implementada el 4 mar 2020, 09:05 / «Done» / Mostrar | Mostrar la parte 2 en 02-b.html",
|
|
351
|
+
"¿Quitar esta parte? El agente ya no podrá informar sobre ella.",
|
|
352
|
+
]);
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// ---- the token inspector (canvas-tokens.js, index.html)
|
|
356
|
+
|
|
357
|
+
const TOKENS = { exists: true, tokens: [
|
|
358
|
+
{ name: "--text", value: "#f6eff3", section: "Colors", group: "color" },
|
|
359
|
+
{ name: "--paper", value: "#ffffff", section: "Colors", group: "color" },
|
|
360
|
+
{ name: "--font-sans", value: "Inter, sans-serif", section: "Typography", group: "font" },
|
|
361
|
+
{ name: "--radius-sm", value: "8px", section: "Radius", group: "radius" },
|
|
362
|
+
{ name: "--space-2", value: "8px", section: "Spacing", group: "spacing" },
|
|
363
|
+
] };
|
|
364
|
+
const MEASURE = {
|
|
365
|
+
selector: "main > p.or", label: "p.or", text: "or pay with card", hasText: true, rect: { x: 30, y: 40, width: 200, height: 20 },
|
|
366
|
+
color: { r: 150, g: 130, b: 140, a: 1 }, background: { r: 255, g: 255, b: 255 },
|
|
367
|
+
fontFamily: "Inter, sans-serif", fontSize: 14, fontWeight: 400, lineHeight: null,
|
|
368
|
+
margin: [8, 0, 8, 0], padding: [0, 0, 0, 0], radius: [10, 10, 10, 10],
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
async function inspecting(stored?: string) {
|
|
372
|
+
const canvas = await loadLanguage({ "/t/api/system/tokens": TOKENS }, stored, { [TECHNICAL_KEY]: "on" });
|
|
373
|
+
canvas.viewport.rect = { left: 0, top: 50, width: 1000, height: 1400 };
|
|
374
|
+
$(canvas, "gd-comment").dispatch("click");
|
|
375
|
+
const frame = canvas.boards[0].frame;
|
|
376
|
+
canvas.message(frame.contentWindow, { type: "gd:inspect", element: MEASURE, generation: heardGeneration(frame) });
|
|
377
|
+
return canvas;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
test("a switch in focus mode keeps the token panel open, translated and beside its element", async () => {
|
|
381
|
+
const canvas = await inspecting();
|
|
382
|
+
canvas.boards[0].shield!.dispatch("keydown", { key: "Enter" });
|
|
383
|
+
const frame = canvas.boards[0].frame;
|
|
384
|
+
canvas.message(frame.contentWindow, { type: "gd:inspect", element: MEASURE, generation: heardGeneration(frame) });
|
|
385
|
+
assert.equal($(canvas, "gd-inspector").hidden, false, "the panel shows in focus mode");
|
|
386
|
+
choose(canvas, "Español");
|
|
387
|
+
assert.equal($(canvas, "gd-inspector").hidden, false, "it stays open across the switch");
|
|
388
|
+
assert.equal($(canvas, "gd-inspector-copy").textContent, "Copiar", "and is translated");
|
|
389
|
+
choose(canvas, "English");
|
|
390
|
+
assert.equal($(canvas, "gd-inspector").hidden, false);
|
|
391
|
+
assert.equal($(canvas, "gd-inspector-copy").textContent, "Copy");
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
test("the token inspector in Spanish: each row's label and words, its buttons; the exact English again", async () => {
|
|
395
|
+
const canvas = await inspecting();
|
|
396
|
+
const all = (element: FakeElement): string => [element.textContent, ...element.children.map(all)].filter(Boolean).join(" ");
|
|
397
|
+
const inspector = () => [
|
|
398
|
+
...withClass($(canvas, "gd-inspector-list"), "gd-inspector-row").map((row) => `${texts(row, "gd-inspector-label")[0]}: ${all(withClass(row, "gd-inspector-value")[0])}`),
|
|
399
|
+
$(canvas, "gd-inspector-fix").textContent, $(canvas, "gd-inspector-copy").textContent,
|
|
400
|
+
];
|
|
401
|
+
await bothWays(canvas, inspector, [
|
|
402
|
+
"Color: #96828c ⚠ no token Nearest --text #f6eff3",
|
|
403
|
+
"Background: #ffffff ✓ --paper",
|
|
404
|
+
"Contrast: ⚠ 3.57 : 1 needs 4.5 : 1",
|
|
405
|
+
"Font: Inter ✓ --font-sans",
|
|
406
|
+
"Size: 14 px weight 400",
|
|
407
|
+
"Line height: normal",
|
|
408
|
+
"Spacing: margin 8 0 8 0 ✓ on scale",
|
|
409
|
+
"Radius: 10 px ⚠ no token Nearest --radius-sm 8px",
|
|
410
|
+
"Ask the agent to fix", "Copy",
|
|
411
|
+
], [
|
|
412
|
+
"Color: #96828c ⚠ sin token Más cercano: --text #f6eff3",
|
|
413
|
+
"Fondo: #ffffff ✓ --paper",
|
|
414
|
+
"Contraste: ⚠ 3.57 : 1 necesita 4.5 : 1",
|
|
415
|
+
"Fuente: Inter ✓ --font-sans",
|
|
416
|
+
"Tamaño: 14 px peso 400",
|
|
417
|
+
"Interlineado: normal",
|
|
418
|
+
"Espaciado: margen 8 0 8 0 ✓ en la escala",
|
|
419
|
+
"Radio: 10 px ⚠ sin token Más cercano: --radius-sm 8px",
|
|
420
|
+
"Pedir al agente que lo corrija", "Copiar",
|
|
421
|
+
]);
|
|
422
|
+
});
|
|
423
|
+
|
|
424
|
+
test("in Spanish Ask the agent to fix in the token inspector prefills the same English request", async () => {
|
|
425
|
+
const prefill = async (stored: string) => {
|
|
426
|
+
const canvas = await inspecting(stored);
|
|
427
|
+
$(canvas, "gd-inspector-fix").dispatch("click");
|
|
428
|
+
return $(canvas, "gd-popover-text").value;
|
|
429
|
+
};
|
|
430
|
+
const english = await prefill("en");
|
|
431
|
+
assert.match(english, /^Fix the values on main > p\.or that are off the design system \(design\/system\.md\):\n- Text color #96828c is not a token/);
|
|
432
|
+
assert.equal(await prefill("es"), english);
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
// ---- the Quality tab (canvas-checks.js, inspector.js findings, index.html)
|
|
436
|
+
|
|
437
|
+
const CHECK_IDS = ["contrast", "target", "alt", "label", "heading"];
|
|
438
|
+
const LOW = '"or pay with card" is 3.1 : 1 (#999999 on #ffffff); WCAG AA needs 4.5 : 1.';
|
|
439
|
+
const VARS = { text: "or pay with card", ratio: "3.1", foreground: "#999999", background: "#ffffff", needed: 4.5 };
|
|
440
|
+
const finding = (selector: string, extra: Record<string, unknown> = {}) => ({ check: "contrast", severity: "fail", title: "Low contrast", detail: LOW, key: "contrast", vars: VARS, selector, label: `p${selector}`, excerpt: "or pay with card", rect: { x: 30, y: 40, width: 200, height: 20 }, ...extra });
|
|
441
|
+
function report(canvas: Canvas, index: number, issues: Array<Record<string, unknown>>) {
|
|
442
|
+
const frame = canvas.boards[index].frame;
|
|
443
|
+
const checks = CHECK_IDS.map((id) => ({ id, label: id, count: issues.filter((issue) => issue.check === id && issue.severity === "fail").length, advice: issues.filter((issue) => issue.check === id && issue.severity === "advice").length }));
|
|
444
|
+
canvas.message(frame.contentWindow, { type: "gd:checks", checks, issues, generation: heardGeneration(frame) });
|
|
445
|
+
}
|
|
446
|
+
function quality(canvas: Canvas) {
|
|
447
|
+
return withClass($(canvas, "gd-quality"), "gd-check-group").map((group) => [
|
|
448
|
+
group.getAttribute("aria-label"), texts(group, "gd-check-summary")[0],
|
|
449
|
+
...withClass(group, "gd-check").map((card) => [texts(card, "gd-check-title")[0], texts(card, "gd-check-kind")[0], texts(card, "gd-check-detail")[0], withClass(card, "gd-check-show")[0].getAttribute("aria-label"), withClass(card, "gd-check-fix")[0].textContent].join(" | ")),
|
|
450
|
+
...texts(group, "gd-check-passed"),
|
|
451
|
+
]);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
test("Quality in Spanish: the tab, one problem or two, a contrast finding translated from its key and vars, Show and Ask the agent to fix; the exact English again", async () => {
|
|
455
|
+
const canvas = await loadLanguage();
|
|
456
|
+
$(canvas, "gd-tab-quality").dispatch("click");
|
|
457
|
+
report(canvas, 0, [finding("#a")]);
|
|
458
|
+
report(canvas, 1, [finding("#b"), finding("#c", { key: "contrastLarge", vars: { ...VARS, needed: 3 }, detail: LOW.replace("4.5 : 1.", "3 : 1 for large text.") })]);
|
|
459
|
+
const read = () => [...marked(canvas, "quality"), $(canvas, "gd-count-quality").textContent, ...quality(canvas).flat()];
|
|
460
|
+
await bothWays(canvas, read, [
|
|
461
|
+
"Quality", "3",
|
|
462
|
+
"Accessibility checks of 01 First", "1 check",
|
|
463
|
+
`Low contrast | Problem | ${LOW} | Show Low contrast on p#a in 01 First | Ask the agent to fix`,
|
|
464
|
+
"Passed: Target size · Images have alt text · Form fields have labels · Headings in order",
|
|
465
|
+
"Accessibility checks of 02 Second", "2 checks",
|
|
466
|
+
`Low contrast | Problem | ${LOW} | Show Low contrast on p#b in 02 Second | Ask the agent to fix`,
|
|
467
|
+
`Low contrast | Problem | ${LOW.replace("4.5 : 1.", "3 : 1 for large text.")} | Show Low contrast on p#c in 02 Second | Ask the agent to fix`,
|
|
468
|
+
"Passed: Target size · Images have alt text · Form fields have labels · Headings in order",
|
|
469
|
+
], [
|
|
470
|
+
"Calidad", "3",
|
|
471
|
+
"Comprobaciones de accesibilidad de 01 First", "1 problema",
|
|
472
|
+
"Contraste bajo | Problema | «or pay with card» tiene 3.1 : 1 (#999999 sobre #ffffff); WCAG AA pide 4.5 : 1. | Mostrar Contraste bajo en p#a de 01 First | Pedir al agente que lo corrija",
|
|
473
|
+
"Superadas: Tamaño de los objetivos · Las imágenes tienen texto alternativo · Los campos de formulario tienen etiqueta · Encabezados en orden",
|
|
474
|
+
"Comprobaciones de accesibilidad de 02 Second", "2 problemas",
|
|
475
|
+
"Contraste bajo | Problema | «or pay with card» tiene 3.1 : 1 (#999999 sobre #ffffff); WCAG AA pide 4.5 : 1. | Mostrar Contraste bajo en p#b de 02 Second | Pedir al agente que lo corrija",
|
|
476
|
+
"Contraste bajo | Problema | «or pay with card» tiene 3.1 : 1 (#999999 sobre #ffffff); WCAG AA pide 3 : 1 para texto grande. | Mostrar Contraste bajo en p#c de 02 Second | Pedir al agente que lo corrija",
|
|
477
|
+
"Superadas: Tamaño de los objetivos · Las imágenes tienen texto alternativo · Los campos de formulario tienen etiqueta · Encabezados en orden",
|
|
478
|
+
]);
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
test("in Spanish a finding without a known key or with vars that do not fit shows the English it was sent", async () => {
|
|
482
|
+
const canvas = await loadLanguage({}, "es");
|
|
483
|
+
$(canvas, "gd-tab-quality").dispatch("click");
|
|
484
|
+
const cases: Array<Record<string, unknown>> = [
|
|
485
|
+
{ key: undefined, vars: undefined },
|
|
486
|
+
{ key: "unknown" },
|
|
487
|
+
{ key: "toString" },
|
|
488
|
+
{ vars: { ...VARS, needed: undefined } },
|
|
489
|
+
{ vars: { ...VARS, extra: "x" } },
|
|
490
|
+
{ vars: { ...VARS, text: { nested: true } } },
|
|
491
|
+
{ vars: { ...VARS, text: "x".repeat(500) } },
|
|
492
|
+
{ vars: { ...VARS, needed: Number.NaN } },
|
|
493
|
+
{ vars: [] },
|
|
494
|
+
{ vars: "text" },
|
|
495
|
+
];
|
|
496
|
+
report(canvas, 0, cases.map((extra, index) => finding(`#f${index}`, extra)));
|
|
497
|
+
const shown = quality(canvas)[0].slice(2, 2 + cases.length).map((card) => (card as string).split(" | ").slice(0, 3).join(" | "));
|
|
498
|
+
assert.deepEqual(shown, cases.map(() => `Low contrast | Problema | ${LOW}`));
|
|
499
|
+
assert.equal(texts($(canvas, "gd-quality"), "gd-check-summary")[0], `${cases.length} problemas`, "the report itself is kept");
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
test("in Spanish Ask the agent to fix on a finding prefills the English request with the English title and detail", async () => {
|
|
503
|
+
const canvas = await loadLanguage({}, "es");
|
|
504
|
+
$(canvas, "gd-tab-quality").dispatch("click");
|
|
505
|
+
report(canvas, 0, [finding("#a")]);
|
|
506
|
+
withClass($(canvas, "gd-quality"), "gd-check-fix")[0].dispatch("click");
|
|
507
|
+
assert.equal($(canvas, "gd-popover-text").value, `Accessibility check on #a: Low contrast.\n${LOW}\nFix it so it meets WCAG 2.2 AA, keeping the design's tokens.`);
|
|
508
|
+
// What the canvas posts is that English, as the person leaves it.
|
|
509
|
+
canvas.replies["/t/api/comments"] = { __http: 202, ok: true };
|
|
510
|
+
$(canvas, "gd-popover-form").dispatch("submit");
|
|
511
|
+
await settle();
|
|
512
|
+
assert.equal((canvas.posts.at(-1)!.body as Record<string, unknown>).comment, `Accessibility check on #a: Low contrast.\n${LOW}\nFix it so it meets WCAG 2.2 AA, keeping the design's tokens.`);
|
|
513
|
+
});
|