优化窗格显示

This commit is contained in:
yhy
2026-09-01 08:38:36 +08:00
parent af2ee38443
commit 3b07e2a3c1
11 changed files with 137 additions and 30 deletions
+14 -9
View File
@@ -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");