mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-05-15 22:30:38 +08:00
feat: 图谱分区用酒馆 name1 兜底,误标为角色的用户 POV 归入用户区
Made-with: Cursor
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
// ST-BME: 消息级召回卡片 UI
|
||||
// 纯 DOM 构建模块,不含模块级 mutable state
|
||||
|
||||
import { getContext } from "../../../extensions.js";
|
||||
import { GraphRenderer } from "./graph-renderer.js";
|
||||
|
||||
function _hostUserPovAliasHintsForRecallCanvas() {
|
||||
try {
|
||||
const ctx = typeof getContext === "function" ? getContext() : null;
|
||||
const out = [];
|
||||
if (ctx?.name1 && String(ctx.name1).trim()) {
|
||||
out.push(String(ctx.name1).trim());
|
||||
}
|
||||
return out;
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 常量 ====================
|
||||
|
||||
export const RECALL_CARD_FORCE_CONFIG = {
|
||||
@@ -297,6 +311,7 @@ export function createRecallCardElement({
|
||||
renderer = new GraphRenderer(canvas, {
|
||||
theme: themeName,
|
||||
forceConfig: RECALL_CARD_FORCE_CONFIG,
|
||||
userPovAliases: _hostUserPovAliasHintsForRecallCanvas(),
|
||||
onNodeClick: (node) => {
|
||||
if (typeof activeCallbacks.onNodeClick === "function") {
|
||||
activeCallbacks.onNodeClick(messageIndex, node);
|
||||
@@ -308,7 +323,9 @@ export function createRecallCardElement({
|
||||
}
|
||||
},
|
||||
});
|
||||
renderer.loadGraph(resolvedSubGraph);
|
||||
renderer.loadGraph(resolvedSubGraph, {
|
||||
userPovAliases: _hostUserPovAliasHintsForRecallCanvas(),
|
||||
});
|
||||
}
|
||||
|
||||
// 元信息行
|
||||
|
||||
Reference in New Issue
Block a user