优化窗格显示
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
isAbortError,
|
||||
type AbortHandle,
|
||||
} from "../../utils/abort";
|
||||
import { isItemPaneSectionBody } from "./itemPaneSection";
|
||||
|
||||
export class ChatView {
|
||||
private body: HTMLElement;
|
||||
@@ -60,15 +61,19 @@ export class ChatView {
|
||||
const preset = cfg.provider ? getProviderPreset(cfg.provider) : undefined;
|
||||
const providerLabel = preset?.label || cfg.provider || "未配置";
|
||||
|
||||
const inItemPane = isItemPaneSectionBody(this.body);
|
||||
const header = this.el("div", "chatpapers-header");
|
||||
const brand = this.el("div", "chatpapers-brand");
|
||||
brand.append(
|
||||
createLucideIcon(this.doc, MessageSquareText, {
|
||||
size: 18,
|
||||
className: "chatpapers-brand-icon",
|
||||
}),
|
||||
this.el("div", "chatpapers-brand-text", "ChatPapers"),
|
||||
);
|
||||
if (!inItemPane) {
|
||||
const brand = this.el("div", "chatpapers-brand");
|
||||
brand.append(
|
||||
createLucideIcon(this.doc, MessageSquareText, {
|
||||
size: 18,
|
||||
className: "chatpapers-brand-icon",
|
||||
}),
|
||||
this.el("div", "chatpapers-brand-text", "ChatPapers"),
|
||||
);
|
||||
header.append(brand);
|
||||
}
|
||||
const titleRow = this.el("div", "chatpapers-title-row");
|
||||
titleRow.append(
|
||||
this.el(
|
||||
@@ -82,7 +87,7 @@ export class ChatView {
|
||||
createLucideIcon(this.doc, Cpu, { size: 13, className: "chatpapers-meta-icon" }),
|
||||
this.el("span", undefined, `${providerLabel} · ${cfg.model || "无模型"}`),
|
||||
);
|
||||
header.append(brand, titleRow, meta);
|
||||
header.append(titleRow, meta);
|
||||
|
||||
this.messagesEl = this.el("div", "chatpapers-messages");
|
||||
this.emptyEl = this.el("div", "chatpapers-empty");
|
||||
|
||||
Reference in New Issue
Block a user