fix(editor): Address chat UI feedback (no-changelog) (#22819)

This commit is contained in:
Suguru Inoue
2025-12-05 14:47:23 +01:00
committed by GitHub
parent 33a6aa665c
commit 367643025d
4 changed files with 10 additions and 2 deletions

View File

@@ -320,6 +320,7 @@ watch(
[sessionId, isNewSession],
async ([id, isNew]) => {
didSubmitInCurrentSession.value = false;
editingMessageId.value = undefined;
if (!isNew && !chatStore.getConversation(id)) {
try {
@@ -365,7 +366,7 @@ watch(
watch(
defaultAgent,
(agent, prevAgent) => {
if (defaultModel.value && agent && agent.name !== prevAgent?.name) {
if (defaultModel.value && agent?.name && agent.name !== prevAgent?.name) {
defaultModel.value = { ...defaultModel.value, cachedDisplayName: agent.name };
}

View File

@@ -114,6 +114,11 @@ function handleConfirmEdit() {
}
function handleKeydownTextarea(e: KeyboardEvent) {
if (e.key === 'Escape') {
emit('cancelEdit');
return;
}
const trimmed = editedText.value.trim();
if (e.key === 'Enter' && isCtrlKeyPressed(e) && !e.isComposing && trimmed) {

View File

@@ -125,6 +125,8 @@ function handleSubmitForm() {
function handleKeydownTextarea(e: KeyboardEvent) {
const trimmed = message.value.trim();
speechInput.stop();
if (e.key === 'Enter' && !e.shiftKey && !e.isComposing && trimmed) {
e.preventDefault();
speechInput.stop();

View File

@@ -108,9 +108,9 @@ defineSlots<{
.actionDropdown {
opacity: 0;
transition: opacity 0.2s;
flex-shrink: 0;
width: 0;
overflow: hidden;
.menuItem:has([aria-expanded='true']) &,
.menuItem:has(:focus) &,