v9.2.1: re-enable ms-word on all platforms + real filenames in URLs

User clarified: with the new open-link URLs (https + no query string +
ending .docx), pressing the button DID open the file in Word 16.101+
on their Mac — only the OLD URL forms (http, query strings) were
ignored. The previous disable-on-Mac was based on terminal tests that
hit the old forms / cold-start races, so it removed working behavior.

- useVersionOpen: fireWordScheme = openInWord !== 'off' (default ''
  and 'on' fire on ALL platforms; only explicit 'off' is download-only)
- Notice updated: "กำลังเปิดไฟล์ใน Word ให้อัตโนมัติ — หากไม่เปิด
  ไฟล์อยู่ที่โฟลเดอร์ Downloads แล้ว" (covers cold-start drop)
- Docs corrected with v9.2.1 header (old forms were the broken ones;
  new form confirmed working via real usage) + correction markers on
  the v9.2 test record + CLAUDE.md rule 13 rewritten
- web 60/60 + build; QA reviewer FAIL round 1 (5 doc/comment minors,
  all fixed) → PASS round 2

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
Suphonchai Phoonsawat 2026-09-10 14:33:12 +07:00
parent f4b2ff9d28
commit 4f54af4e24
7 changed files with 30 additions and 29 deletions

View file

@ -38,7 +38,7 @@ Infra ทั้งหมดรันผ่าน `docker-compose.yml`: PostgreSQ
10. **ทุก Office.js call ต้อง catch** — ห้ามปล่อย unhandled promise rejection
11. **Dev: ทุก service ที่ task pane (หน้า https) เรียกต้องเป็น HTTPS ด้วย cert ของ `office-addin-dev-certs`** — Keycloak = `https://localhost:8443` (Office Dialog API ปฏิเสธ http:// โดยสมบูรณ์), backend = `https://localhost:7232` + `http://localhost:5075` (WKWebView บล็อก mixed content → "Load failed") — รัน `npx office-addin-dev-certs install` ก่อน `docker compose up`
12. **ดาวน์โหลดไฟล์จาก add-in ใช้ลิงก์เปิดอายุสั้นจาก download-link (open-link ของ backend) + `Office.context.ui.openBrowserWindow` เท่านั้น** — webview ของ Word ทิ้ง blob download (`a[download]`) แบบเงียบๆ ไฟล์ไม่ถูกเขียนที่ไหนเลย; และ**ห้าม `cp` ทับ manifest ใน wef folder** (`npm start` ใช้ symlink — ทับแล้วครั้งหน้า EEXIST, ให้แก้ที่ `addin/manifest.xml` ต้นทาง)
13. **`ms-word:ofe` ใช้เป็น best-effort เท่านั้น — ห้ามพึ่งเป็นกลไกหลัก** (v9.2): Word for Mac 16.101+ (ก.ย. 2026) เมิน URL ทุกรูปแบบ (http/https/query/ไม่มี query/file://) โดยเด้งหน้าเลือกไฟล์และไม่ยิง request ถึง server เลย — การเปิดไฟล์จากเว็บต้อง **download-first** (ดาวน์โหลดทันที + ยิง ms-word ควบคู่) · ลิงก์เปิดไฟล์ใช้ **open-link ของ backend** (`/api/open/{t}/{e}/...` HMAC ใน path ไม่มี query string — ฝั่ง MinIO presigned เป็น http ใช้กับ Word ไม่ได้) · prod ต้องตั้ง `OpenLinks__Secret`/`OpenLinks__BaseUrl` (https)
13. **URL สำหรับ `ms-word:ofe` ต้องเป็น https + ไม่มี query string + จบ .docx/.pdf** (v9.2.1): Word for Mac 16.101+ (ก.ย. 2026) เมิน URL แบบเก่า (http เช่น presigned ของ MinIO, หรือมี query string) — แต่ open-link ของ backend แบบ `/api/open/{t}/{e}/.../{fileName}` ใช้ได้จริงแม้ Word 16.101+ (ยืนยันจากการใช้งานจริง) · เว็บยิง ms-word ให้ Word เปิดไฟล์ + ดาวน์โหลดสำรองทันทีทุกครั้ง (`NUXT_PUBLIC_OPEN_IN_WORD=off` ปิดได้) · cold-start ครั้งแรกของ Word URL event อาจหลุด (เด้งหน้าเลือกไฟล์) — ไฟล์สำรองอยู่ Downloads แล้วเสมอ · prod ต้องตั้ง `OpenLinks__Secret`/`OpenLinks__BaseUrl` (https)
14. **`slice.data` จาก `getSliceAsync` มีหลายรูปแบบตาม host** (ArrayBuffer / view / base64 string / `number[]`) — ต้องผ่าน `fileService.sliceDataToBytes()` เสมอ ห้าม assume รูปเดียว
15. **`@nuxtjs/tailwindcss` บน Nuxt 4 ต้องระบุ `cssPath: '~/assets/css/tailwind.css'` ใน nuxt.config.ts เสมอ** — default แบบ relative resolve ต่อ rootDir แล้ว fallback ไปไฟล์ default ของ tailwindcss package **แบบเงียบ** (token/component classes ทั้งหมดหายจาก build โดยไม่มี error) · แก้ `tailwind.config.ts` แล้วต้อง restart dev server · สีทั้งหมดเป็น CSS variables RGB triplet ใน tailwind.css — ห้ามใส่ hex (break `/opacity` utilities เงียบๆ)