[CLAUDE] Docs: chèn 12 ảnh khoanh-đỏ vào guide Word Duyệt NCC (em chụp prod) + gotcha #74 + closeout S90
- 12 ảnh prod khoanh-đỏ 1→2→3 vào docs/Huong-dan-Duyet-NCC.docx pipeline tự-chế: PowerShell CopyFromScreen + Win32 lọc-process-chrome.exe + DOM overlay element-based + python-docx (MCP save_to_disk KHÔNG ra file env này) - gotcha #74 (chụp-prod-vào-docx) + STATUS/HANDOFF S90 + session log - 0 production code, 0 prod mutation (xem-only), em-main solo Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -1268,6 +1268,22 @@ for h in resp.points: # ← .points không phải iterable trực tiếp
|
||||
|
||||
**References:** `src/Backend/SolutionErp.Application/PurchaseEvaluations/PurchaseEvaluationFeatures.cs:~282` (UpdatePeDraftHandler) · `fe-user/src/components/pe/PeHeaderForm.tsx:112` (PUT no-workflow) · bug-class S42 (BudgetPeriodAmount null-safe S61) · `tests/.../PeUpdateDraftWorkflowPreserveTests.cs`.
|
||||
|
||||
### 74. MCP `save_to_disk` (Chrome MCP + computer-use) KHÔNG tạo file truy-cập được trong env này → chụp ảnh prod cho docs bằng PowerShell `CopyFromScreen` (Session 90)
|
||||
|
||||
**Triệu chứng:** Cần chụp 12 màn prod (eoffice) khoanh-đỏ chèn vào Word guide. `mcp__Claude_in_Chrome__computer {action:screenshot, save_to_disk:true}` + `mcp__computer-use__screenshot {save_to_disk:true}` đều báo "Successfully captured" + ID nhưng **KHÔNG in path + KHÔNG tạo file nào tìm thấy được** (search TEMP/LOCALAPPDATA/APPDATA/Downloads/session-dir = rỗng) → PIL/python-docx không có file ảnh để chèn. `gif_creator` cũng vô-dụng (ảnh tĩnh = 0 frame).
|
||||
|
||||
**Cơ chế:** `save_to_disk` chỉ đính ảnh vào hội-thoại cho user xem, KHÔNG persist ra path mà lead truy-cập được (harness/env này).
|
||||
|
||||
**Fix — pipeline tự-chế (ra PNG thật):**
|
||||
1. **Chụp:** PowerShell .NET `[System.Drawing.Graphics]::CopyFromScreen` (sau `SetProcessDPIAware`) → PNG full-res (2560×1600, DPR=1). Đưa đúng cửa-sổ Chrome lên trước bằng Win32: `EnumWindows`+`GetWindowText`+`GetWindowThreadProcessId` lọc **process `chrome.exe`** + `SetForegroundWindow` + ALT-tap unlock-foreground. ⚠️ Lọc theo title "Solutions ERP" KHÔNG đủ — **app Claude Code (Electron) cùng class `Chrome_WidgetWin_1` + title chứa tên project** → khớp nhầm; PHẢI lọc process-name = `chrome`.
|
||||
2. **Khoanh đỏ:** inject DOM overlay `window.__ccA([{text|q, n, minLeft/maxLeft/minTop/maxTop, exact, up, nth}])` — **element-based** (bám `getBoundingClientRect`, miễn-nhiễm viewport đổi). Toạ-độ-cứng (rect px) KHÔNG ổn vì Chrome-screenshot render kích-thước thay-đổi (812↔833). Match **case-INSENSITIVE** (label CSS `text-transform:uppercase` → `textContent` mixed-case → exact-uppercase MISS).
|
||||
3. **Crop:** bỏ chrome trình-duyệt top + taskbar bottom (top=92/bottom=72). ⚠️ Banner CDP **"Claude started debugging this browser"** hiện sau mỗi `navigate` (CDP re-attach), tự ẩn sau vài giây → ảnh chụp ngay-sau-navigate cần crop top≈146; verify nhanh bằng **montage dải-trên 12 ảnh** đọc 1 lần.
|
||||
4. **Chèn:** `python-docx` `cell...add_picture(width=Inches(6.0))` — A4 content = **6.27"** nên 6.3" TRÀN; dùng ≤6.1".
|
||||
|
||||
**An toàn prod:** chỉ XEM/scroll/screenshot — KHÔNG bấm nút mutate (Gửi duyệt/Duyệt/Trả lại/Tạo HĐ). Mở `+ Thêm mới` (form `?mode=new`) KHÔNG tạo draft cho tới khi sửa field (auto-save on-edit).
|
||||
|
||||
**References:** `$env:TEMP\guideshots\capture.ps1` (session-scratch) · `docs/Huong-dan-Duyet-NCC.docx`. Pattern reusable → user-memory `pattern_prod_screenshot_to_docx`.
|
||||
|
||||
---
|
||||
|
||||
## Checklist debug bug mới
|
||||
|
||||
Reference in New Issue
Block a user