feat: allow using chat to modify page titles

This commit is contained in:
LIlGG
2025-10-11 16:36:20 +08:00
parent a672fcad1c
commit 7acc4949fb
8 changed files with 88 additions and 23 deletions

View File

@@ -96,7 +96,7 @@ export class ChatStore {
});
}
addArtifact({ messageId, name, title, id }: ArtifactCallbackData) {
async addArtifact({ messageId, name, title, id }: ArtifactCallbackData) {
const artifact = this.getArtifact(messageId, name);
if (artifact) {
return;
@@ -129,6 +129,8 @@ export class ChatStore {
artifactsByPageName.set(name, newArtifact);
this.artifacts.set(artifactsByMessageId);
const bridge = await editorBridge;
bridge.updatePageAttributes(name, { title });
}
updateArtifact({ messageId, name }: ArtifactCallbackData, state: Partial<ArtifactUpdateState>) {