mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-08 04:36:13 +08:00
fix(core): chat history not show in independent page (#13069)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added the ability to reload the current AI chat session, clearing and reinitializing the chat context. * Introduced a function to close the chat history menu in the AI chat toolbar. * Enabled seamless opening of specific chat sessions from the chat toolbar, with improved loading state handling and error feedback. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -308,6 +308,11 @@ export class AIChatContent extends SignalWatcher(
|
||||
this.closePreviewPanel(true);
|
||||
}
|
||||
|
||||
public reloadSession() {
|
||||
this.reset();
|
||||
this.initChatContent().catch(console.error);
|
||||
}
|
||||
|
||||
public openPreviewPanel(content?: TemplateResult<1>) {
|
||||
this.showPreviewPanel = true;
|
||||
if (content) this.previewPanelContent = content;
|
||||
|
||||
@@ -186,4 +186,8 @@ export class AIChatToolbar extends WithDisposable(ShadowlessElement) {
|
||||
closeOnClickAway: true,
|
||||
});
|
||||
};
|
||||
|
||||
public closeHistoryMenu() {
|
||||
this.abortController?.abort();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user