直聊的种子历史改成逐条真多轮,不再靠块头文本猜轮次。

一条一个角色下拉加一整句正文,换行原样保留;旧盘里的纯文本在读盘时迁移,切得出轮次的转成条目,切不出的挪进史前设定免得悄悄丢掉。历史编辑器做成共用控件,预设工作台的用例与假历史也用同一套。
This commit is contained in:
2026-10-26 01:09:34 +08:00
parent 860eff59b2
commit 98e51f9c6c
11 changed files with 686 additions and 17 deletions
+128
View File
@@ -0,0 +1,128 @@
/* 历史条目编辑器(web/history-editor.js):预设假历史 / 用例历史 / 直聊种子历史共用。
只依赖 settings.css 里的 --st-* 变量,所以预设置页与直聊页都能直接引。 */
.he {
display: flex;
flex-direction: column;
gap: 6px;
min-width: 0;
}
.he[data-disabled="1"] {
opacity: 0.55;
}
.he-row {
display: grid;
grid-template-columns: 18px 84px minmax(0, 1fr) auto;
align-items: start;
gap: 6px;
padding: 6px;
border: 1px solid var(--st-border);
border-radius: 8px;
background: var(--st-surface);
}
.he-row[data-drop="before"] {
box-shadow: inset 0 2px 0 var(--st-accent);
}
.he-row[data-drop="after"] {
box-shadow: inset 0 -2px 0 var(--st-accent);
}
.he-row-dragging {
opacity: 0.5;
}
.he-grip {
align-self: stretch;
padding: 0;
border: 1px solid transparent;
border-radius: 6px;
background: transparent;
color: var(--st-faint);
font-size: 13px;
line-height: 1;
cursor: grab;
}
.he-grip:hover:not(:disabled) {
border-color: var(--st-border-strong);
color: var(--st-text);
}
.he-grip:active:not(:disabled) {
cursor: grabbing;
}
.he-grip:disabled {
opacity: 0.4;
cursor: default;
}
.he-row[data-role="user"] {
border-left: 2px solid var(--st-border-strong);
}
.he-row[data-role="assistant"] {
border-left: 2px solid var(--st-accent);
}
.he-role {
width: 100%;
padding: 4px 6px;
border: 1px solid var(--st-border-strong);
border-radius: 6px;
background: var(--st-surface);
color: var(--st-text);
font-family: var(--st-font-ui);
font-size: 12px;
}
.he-role:focus-visible,
.he-text:focus-visible,
.he-btn:focus-visible {
outline: 2px solid color-mix(in srgb, var(--st-accent) 45%, transparent);
outline-offset: 1px;
}
.he-text {
width: 100%;
min-height: 38px;
padding: 5px 8px;
border: 1px solid var(--st-border-strong);
border-radius: 6px;
background: var(--st-surface);
color: var(--st-text);
font-family: inherit;
font-size: 12.5px;
line-height: 1.6;
resize: vertical;
}
.he-tools {
display: flex;
gap: 2px;
}
.he-actions {
display: flex;
align-items: center;
gap: 8px;
flex-wrap: wrap;
}
.he-hint {
font-size: 11.5px;
color: var(--st-faint);
}
.he-btn {
padding: 2px 6px;
border: 1px solid var(--st-border-strong);
border-radius: 6px;
background: var(--st-surface);
color: var(--st-text);
font-family: var(--st-font-ui);
font-size: 11.5px;
line-height: 1.5;
cursor: pointer;
}
.he-btn:hover:not(:disabled) {
border-color: var(--st-accent);
color: var(--st-accent);
}
.he-btn:disabled {
opacity: 0.45;
cursor: default;
}
.he-btn-danger:hover:not(:disabled) {
border-color: var(--st-danger);
color: var(--st-danger);
}
.he-btn-add {
padding: 3px 10px;
}