refactor(chat): improve UI layout, artifact handling, and template naming

- Restructured alert components in BaseChat for better layout organization
- Updated artifact component to display dynamic titles based on state
- Simplified template names in constants for better readability
- Enhanced snapshot restoration process by consolidating command actions into a single artifact
This commit is contained in:
KevIsDev
2025-04-28 14:03:58 +01:00
parent bf03b6f0fe
commit 42eaa2f5e1
8 changed files with 94 additions and 79 deletions

View File

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