mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-18 13:23:33 +08:00
Element selection from the local preview should preserve the visual target the user picked and send the confirmed request directly to chat. The screenshot now captures the visible viewport before drawing the marker, and the selection event sends a model-facing prompt while the chat UI shows only the annotated image and compact element label. Constraint: No issue number was provided for this task. Constraint: Keep the preview-agent protocol shape unchanged. Rejected: Prefill the composer with the selection note | it keeps the old extra confirmation step and exposes implementation text in the input. Rejected: Full-document annotation coordinates | body-relative captures drift from the viewport selection users see. Confidence: high Scope-risk: moderate Directive: Do not route confirmed preview selections back through composer prefill without rechecking the Codex-style direct-send flow. Tested: cd desktop && bun run test --run src/preview-agent/screenshot.test.ts src/lib/previewEvents.test.ts src/lib/selectionComposer.test.ts src/components/chat/AttachmentGallery.test.tsx src/stores/chatStore.test.ts Tested: cd desktop && bun run lint Tested: cd desktop && bun run build:preview-agent Tested: bun run check:desktop Tested: git diff --check Not-tested: Real Tauri webview click-through smoke; in-app Browser automation timed out while local Vite HTTP smoke returned 200.