feat(web): 聊天背景渲染 + 思维链/工具卡富化
- persona.ts: 新增 personaChatBackground(p, orientation),只取本角色对应方向的图 - ChatShell.tsx: 按横/竖屏渲染角色聊天背景(衬底+scrim),null/无图回退纯 Miuix 面 - chat.tsx: 思维链块加图标 chip+spinner+收起预览;工具卡加状态色 chip+ok/fail Tag - 红线: 绝不 fallback 昔涟/其它角色;TemplateCard detail 折叠判定等行为不变
This commit is contained in:
1 parent
7455d09d05
commit
4ad1e465da
3 files changed
+139
-49
No files matched your search
@@ -8,3 +8,16 @@ const DEFAULT_AVATAR = "/images/User_Avatar/Default_Avatar.png";
|
||||
export function personaAvatar(p: PersonaRecord | null | undefined): string {
|
||||
return p?.avatar || DEFAULT_AVATAR;
|
||||
}
|
||||
|
||||
/** Orientation for a persona's chat wallpaper. */
|
||||
export type Orientation = "landscape" | "portrait";
|
||||
|
||||
/** Resolve the persona's own chat wallpaper for the given orientation. Returns
|
||||
* undefined when the persona has none (or is null) so callers keep the plain
|
||||
* Miuix surface. Never another role's image. */
|
||||
export function personaChatBackground(
|
||||
p: PersonaRecord | null | undefined,
|
||||
orientation: Orientation
|
||||
): string | undefined {
|
||||
return p?.chatBackground?.[orientation];
|
||||
}
|
||||
Reference in new issue
Block a user