feat(ui): 排队消息可撤回输入框重新编辑

运行中发出的消息排在待发送条幅里,原来只有一个 ×:点掉就从服务端队列删了,正文跟着蒸发。
现在拆成两支:笔(撤回编辑)删队列项并把正文回填输入框、光标停在撤回段末尾;垃圾桶直接丢弃。
两者都走 DELETE /pending/:qid,区别只在要不要把正文带回来。撤回文本必须在请求前取,
DELETE 的响应里这条已经没了。

回填拼在已有草稿之前,与发送失败的兜底同序;之后 autosize / updateSendBtn 同步,
focus 带 preventScroll,免得浏览器为了露出输入框把页面滚一下。

条幅占位会改 chat-view 的 clientHeight,浏览器不会替你补滚动,最后一条消息因此被裁在视口外。
renderSendQueue 改成改动前先记 isNearBottom,贴底就在本帧与下一帧各补一次 scrollBottom;
条幅自己限高 100px、超出内部滚动,sq-item 加 flex:none 防止被压扁。

顺带清掉复制与删除消息两处成功提示(按钮变勾、消息已消失,都不需要再说一遍)。
This commit is contained in:
2026-11-13 15:12:01 +08:00
parent 793be29331
commit 7b1ef9a479
2 changed files with 37 additions and 14 deletions
+4 -3
View File
@@ -1919,8 +1919,9 @@ body.pv-resizing #pv-pane iframe { pointer-events: none; }
/* ================= 待发送条幅(运行中排队 / 干预 / 立即发送) ================= */
/* 输入卡上方一行小条:正文单行省略 + 动作按钮。多条时逐条堆叠,每条仍是一行。
配色刻意与「编辑提示条」的蓝色区分:排队是“稍后执行”的提示态,不是输入态。 */
.send-queue { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.send-queue { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; max-height: 100px; overflow-y: auto; }
.sq-item {
flex: none; /* 多条时容器限高滚动,别把条目压扁 */
display: flex; align-items: center; gap: 6px;
padding: 5px 5px 5px 11px;
border-radius: 12px; background: #fff4dc; color: #a06a00; font-size: 12.5px;
@@ -1933,9 +1934,9 @@ body.pv-resizing #pv-pane iframe { pointer-events: none; }
}
.sq-item button:active { background: rgba(160, 106, 0, 0.12); }
.sq-item button:disabled { opacity: .45; }
.sq-item .sq-x { padding: 2px 7px; font-weight: 500; }
.sq-item .sq-act { padding: 0; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 7px; }
/* 已升级为「干预/立即发送」但还没到边界:按钮置灰,显示“等待当前步骤” */
.sq-item.sq-busy button:not(.sq-x) { opacity: .45; }
.sq-item.sq-busy button:not(.sq-act) { opacity: .45; }
/* ================= 编辑已发送消息提示条 ================= */
/* 覆盖式重发:输入框内部的浅蓝提示条(嵌在 .input-shell 顶端,间距由 shell 的 gap 提供)。 */