portal: 來源回溯 gitea:// 顯示為可點超連結(PORTAL_SOURCE_WEB_BASE) #62

Merged
Leo merged 2 commits from feat/portal-source-link into main 2026-07-18 07:28:01 +00:00
Owner

[總管雲端] 來源=leo RAG demo 客戶測試回饋(問題 4):搜到卡片下方「來源回溯 gitea://…」沒辦法點擊。

改動

  • 新增可選 var PORTAL_SOURCE_WEB_BASE(types.ts 有完整註解)。
  • 有設時:Portal 卡片詳頁「來源回溯」與 AI 問答出處列,把 gitea://<path>#n 渲染成 {base}/<path> 超連結(新分頁、rel=noopener;chunk 錨點捨棄——Gitea 網頁無 chunk 概念)。
  • 未設時行為一字不變(Mira/leo21c 零影響)。
  • 安全:href 過 esc()、路徑逐段 encodeURIComponent、只認 gitea:// 前綴。

驗證

  • tsc --noEmit 0 錯誤
  • tests/portal-auth.test.ts + tests/portal-data.test.ts 48/48 綠
  • 渲染後 client JS 抽出 new Function 語法檢查通過(2 段 script)

部署(leo 閘)

uncle6 重部 cypher 時帶:
--var PORTAL_SOURCE_WEB_BASE:"https://git.uncle6.me/Leo/arcrun-rag-demo-knowledge/src/branch/main"
(demo 知識庫是 public repo,點了不用登入。)

SDD:portal-auth tasks.md 已加任務層條目(2026-07-18)。

**[總管雲端]** 來源=leo RAG demo 客戶測試回饋(問題 4):搜到卡片下方「來源回溯 gitea://…」沒辦法點擊。 ## 改動 - 新增**可選** var `PORTAL_SOURCE_WEB_BASE`(types.ts 有完整註解)。 - 有設時:Portal 卡片詳頁「來源回溯」與 AI 問答出處列,把 `gitea://<path>#n` 渲染成 `{base}/<path>` 超連結(新分頁、`rel=noopener`;chunk 錨點捨棄——Gitea 網頁無 chunk 概念)。 - **未設時行為一字不變**(Mira/leo21c 零影響)。 - 安全:href 過 `esc()`、路徑逐段 `encodeURIComponent`、只認 `gitea://` 前綴。 ## 驗證 - `tsc --noEmit` 0 錯誤 - `tests/portal-auth.test.ts` + `tests/portal-data.test.ts` 48/48 綠 - 渲染後 client JS 抽出 `new Function` 語法檢查通過(2 段 script) ## 部署(leo 閘) uncle6 重部 cypher 時帶: `--var PORTAL_SOURCE_WEB_BASE:"https://git.uncle6.me/Leo/arcrun-rag-demo-knowledge/src/branch/main"` (demo 知識庫是 public repo,點了不用登入。) SDD:portal-auth tasks.md 已加任務層條目(2026-07-18)。
Leo added 1 commit 2026-07-18 06:01:47 +00:00
- 新增可選 var PORTAL_SOURCE_WEB_BASE:設了之後 Portal 卡片詳頁「來源回溯」與
  AI 問答出處列把 gitea://<path>#n 渲染成 {base}/<path> 超連結(新分頁開啟);
  未設時行為一字不變(Mira 零影響)。
- 安全:href 過 esc()、路徑逐段 encodeURIComponent、rel=noopener;
  只認 gitea:// 前綴,其他 scheme 一律純文字。
- 驗證:tsc 0 錯誤;portal-auth/portal-data 測試 48/48 綠;
  渲染後 client JS 語法檢查通過。
- 來源:leo RAG demo 客戶測試回饋(2026-07-18)「來源回溯沒辦法點擊」。
- 部署(leo 閘):uncle6 重部 cypher 時帶
  --var PORTAL_SOURCE_WEB_BASE:"https://git.uncle6.me/Leo/arcrun-rag-demo-knowledge/src/branch/main"
Leo added 1 commit 2026-07-18 06:13:49 +00:00
- workflow 版 graph_neighbors 的 neighbors 是 {node,predicate,from,depth} 物件,
  renderGraph 期望字串 → 節點 chips 全變 [object Object];正規化成名字再渲染。
- workflow 版 edges 恆空 → 關聯永遠 0;neighbor 物件本身就是一條邊,導出成
  {subject,predicate,object} 餵關聯列(plugin 版行為不變)。
- 邊列 subject 比對改大小寫不敏感(graph 查詢端已正規化,搜 rag 命中節點 RAG)。
- 來源:leo RAG demo 客戶測試回饋問題 3(鄰居/關聯顯示有誤)。
Leo merged commit 6e0df065fd into main 2026-07-18 07:28:01 +00:00
Sign in to join this conversation.