fix: chat history snapshot logic to use the same ID as chat and update prompt instructions

- Remove redundant `_chatId` parameter in `takeSnapshot` function
- Update prompt instructions for shell commands and artifact handling
This commit is contained in:
KevIsDev 2025-05-14 11:54:51 +01:00
parent dac37b4344
commit 62769b2fef
2 changed files with 6 additions and 31 deletions

View File

@ -45,14 +45,6 @@ The year is 2025.
</technology_preferences>
<running_shell_commands_info>
With each user request, you are provided with information about the shell command that is currently running.
Example:
<bolt_running_commands>
npm run dev
</bolt_running_commands>
CRITICAL:
- NEVER mention or reference the XML tags or structure of this process list in your responses
- DO NOT repeat or directly quote any part of the command information provided
@ -286,6 +278,7 @@ The year is 2025.
- Follow the guidelines for shell commands.
- Use the start action type over the shell type ONLY when the command is intended to start the project.
- IMPORTANT: Always execute the start command after executing a shell command.
- file: For creating new files or updating existing files. Add \`filePath\` and \`contentType\` attributes:
@ -317,7 +310,7 @@ The year is 2025.
11. Prioritize installing required dependencies by updating \`package.json\` first.
- If a \`package.json\` exists, dependencies should be auto-installed IMMEDIATELY as the first action using the shell action to install dependencies.
- If you need to update the \`package.json\` file make sure it's the FIRST action, so dependencies can install in parallel to the rest of the response being streamed.
- If you need to update the \`package.json\` file make sure it's the FIRST action, so dependencies can install in parallel to the rest of the response being streamed this should ALWAYS be done inside the artifact.
- \`npm install\` will not automatically run every time \`package.json\` is updated, so you need to include a shell action to install dependencies.
- Only proceed with other actions after the required dependencies have been added to the \`package.json\`.
@ -325,7 +318,7 @@ The year is 2025.
12. When running a dev server NEVER say something like "You can now view X by opening the provided local server URL in your browser". The preview will be opened automatically or by the user manually!
13. The start command should be the LAST action in the artifact, do not include this in the install command these should be seperate unless being run as the single last command.
13. Always include a start command in the artifact, The start command should be the LAST action in the artifact.
</artifact_instructions>
<design_instructions>
@ -647,7 +640,8 @@ function App() {
}
export default App;</boltAction>
<boltAction type="file" filePath="src/App.css" contentType="content">.container {
<boltAction type="file" filePath="src/App.css" contentType="content"> {
max-width: 800px;
margin: 0 auto;
padding: 20px;
@ -698,25 +692,6 @@ export default App;</boltAction>
npm run dev
</boltAction>
</boltArtifact>
I've created a demonstration of three different ways to center a div:
1. **Using Flexbox** - This is the most recommended modern approach:
- Set the parent container to \`display: flex\`
- Use \`justify-content: center\` for horizontal centering
- Use \`align-items: center\` for vertical centering
2. **Using CSS Grid** - Even simpler than flexbox in some cases:
- Set the parent container to \`display: grid\`
- Use \`place-items: center\` to center in both directions at once
3. **Using Position Absolute** - The traditional method:
- Set the parent to \`position: relative\`
- Set the child to \`position: absolute\`
- Use \`top: 50%; left: 50%\` to position at the center
- Use \`transform: translate(-50%, -50%)\` to adjust for the element's size
The flexbox method is generally the most versatile and recommended approach for most centering needs in modern web development.</assistant_response>
</example>
</examples>`;

View File

@ -199,7 +199,7 @@ ${value.content}
const takeSnapshot = useCallback(
async (chatIdx: string, files: FileMap, _chatId?: string | undefined, chatSummary?: string) => {
const id = _chatId || chatId.get();
const id = chatId.get();
if (!id || !db) {
return;