feat(chat): add dynamic title support for bundled artifacts

Introduce dynamic titles for bundled artifacts based on their state and ID. This improves user experience by providing more context during project creation or restoration. Also, pass the `title` parameter to the `getTemplates` function to customize the artifact title.
This commit is contained in:
KevIsDev
2025-04-29 14:37:17 +01:00
parent 902166efee
commit 3a894d0516
3 changed files with 19 additions and 5 deletions

View File

@@ -129,7 +129,7 @@ const getGitHubRepoContent = async (repoName: string): Promise<{ name: string; p
}
};
export async function getTemplates(templateName: string) {
export async function getTemplates(templateName: string, title?: string) {
const template = STARTER_TEMPLATES.find((t) => t.name == templateName);
if (!template) {
@@ -183,7 +183,7 @@ export async function getTemplates(templateName: string) {
const assistantMessage = `
Bolt is initializing your project with the required files using the ${template.name} template.
<boltArtifact id="imported-files" title="Create initial files" type="bundled">
<boltArtifact id="imported-files" title="${title || 'Create initial files'}" type="bundled">
${filesToImport.files
.map(
(file) =>