portal: 來源回溯 gitea:// 顯示為可點超連結(PORTAL_SOURCE_WEB_BASE) #62
Reference in New Issue
Block a user
Delete Branch "feat/portal-source-link"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
[總管雲端] 來源=leo RAG demo 客戶測試回饋(問題 4):搜到卡片下方「來源回溯 gitea://…」沒辦法點擊。
改動
PORTAL_SOURCE_WEB_BASE(types.ts 有完整註解)。gitea://<path>#n渲染成{base}/<path>超連結(新分頁、rel=noopener;chunk 錨點捨棄——Gitea 網頁無 chunk 概念)。esc()、路徑逐段encodeURIComponent、只認gitea://前綴。驗證
tsc --noEmit0 錯誤tests/portal-auth.test.ts+tests/portal-data.test.ts48/48 綠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)。
- 新增可選 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"- 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(鄰居/關聯顯示有誤)。