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:
Cats Juice
2025-07-07 20:32:13 +08:00
committed by GitHub
parent ce679af7df
commit f8be0cc465
3 changed files with 42 additions and 1 deletions
@@ -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();
}
}