mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
fix(core): ai message resending (#13359)
Close [AI-395](https://linear.app/affine-design/issue/AI-395) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved chat stability by resetting chat action signals after processing to prevent repeated triggers. * **New Features** * Added end-to-end tests for new chat session creation and chat pinning functionality to enhance reliability. * **Enhancements** * Enhanced chat toolbar with test identifiers and pinned state attributes for better accessibility and testing. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: fengmk2 <fengmk2@gmail.com>
This commit is contained in:
@@ -391,6 +391,7 @@ export class AIChatContent extends SignalWatcher(
|
||||
})
|
||||
.catch(console.error);
|
||||
}
|
||||
AIProvider.slots.requestOpenWithChat.next(null);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
@@ -405,6 +405,7 @@ export class AIChatInput extends SignalWatcher(
|
||||
this.send(input).catch(console.error);
|
||||
}, 0);
|
||||
}
|
||||
AIProvider.slots.requestSendWithChat.next(null);
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
@@ -92,14 +92,20 @@ export class AIChatToolbar extends WithDisposable(ShadowlessElement) {
|
||||
const pinned = this.session?.pinned;
|
||||
return html`
|
||||
<div class="ai-chat-toolbar">
|
||||
<div class="chat-toolbar-icon" @click=${this.onPlusClick}>
|
||||
<div
|
||||
class="chat-toolbar-icon"
|
||||
@click=${this.onPlusClick}
|
||||
data-testid="ai-panel-new-chat"
|
||||
>
|
||||
${PlusIcon()}
|
||||
<affine-tooltip>New Chat</affine-tooltip>
|
||||
</div>
|
||||
<div
|
||||
class="chat-toolbar-icon"
|
||||
@click=${this.onPinClick}
|
||||
data-pinned=${!!pinned}
|
||||
data-disabled=${this.isGenerating}
|
||||
data-testid="ai-panel-pin-chat"
|
||||
>
|
||||
${pinned ? PinedIcon() : PinIcon()}
|
||||
<affine-tooltip>
|
||||
|
||||
Reference in New Issue
Block a user