mirror of
https://github.com/stackblitz-labs/bolt.diy
synced 2025-06-26 18:26:38 +00:00
Merge pull request #11 from vgcman16/codex/create--plan-project--button
Add project planning button
This commit is contained in:
commit
58006f7399
@ -87,7 +87,7 @@ project, please check the [project management guide](./PROJECT.md) to get starte
|
|||||||
- ✅ Deploy directly to Vercel
|
- ✅ Deploy directly to Vercel
|
||||||
- ✅ Deploy directly to Cloudflare Pages
|
- ✅ Deploy directly to Cloudflare Pages
|
||||||
- ✅ Supabase Integration (@xKevIsDev)
|
- ✅ Supabase Integration (@xKevIsDev)
|
||||||
- ⬜ Have LLM plan the project in a MD file for better results/transparency
|
- ✅ Have LLM plan the project in a MD file for better results/transparency
|
||||||
- ✅ VSCode Integration with git-like confirmations
|
- ✅ VSCode Integration with git-like confirmations
|
||||||
- ⬜ Upload documents for knowledge - UI design templates, a code base to reference coding style, etc.
|
- ⬜ Upload documents for knowledge - UI design templates, a code base to reference coding style, etc.
|
||||||
- ✅ Voice prompting
|
- ✅ Voice prompting
|
||||||
|
@ -316,6 +316,8 @@ export const ChatImpl = memo(
|
|||||||
|
|
||||||
let finalMessageContent = messageContent;
|
let finalMessageContent = messageContent;
|
||||||
|
|
||||||
|
let uploadArtifact = '';
|
||||||
|
|
||||||
if (selectedElement) {
|
if (selectedElement) {
|
||||||
console.log('Selected Element:', selectedElement);
|
console.log('Selected Element:', selectedElement);
|
||||||
|
|
||||||
@ -437,14 +439,13 @@ export const ChatImpl = memo(
|
|||||||
const uploadedMap: { [path: string]: string } = {};
|
const uploadedMap: { [path: string]: string } = {};
|
||||||
uploadedFiles.forEach((file, idx) => {
|
uploadedFiles.forEach((file, idx) => {
|
||||||
const text = textDataList[idx];
|
const text = textDataList[idx];
|
||||||
|
|
||||||
if (text) {
|
if (text) {
|
||||||
uploadedMap[file.name] = escapeBoltTags(text);
|
uploadedMap[file.name] = escapeBoltTags(text);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const uploadArtifact =
|
uploadArtifact =
|
||||||
Object.keys(uploadedMap).length > 0
|
Object.keys(uploadedMap).length > 0 ? uploadedFilesToArtifacts(uploadedMap, `uploaded-${Date.now()}`) : '';
|
||||||
? uploadedFilesToArtifacts(uploadedMap, `uploaded-${Date.now()}`)
|
|
||||||
: '';
|
|
||||||
|
|
||||||
if (modifiedFiles !== undefined) {
|
if (modifiedFiles !== undefined) {
|
||||||
const userUpdateArtifact = filesToArtifacts(modifiedFiles, `${Date.now()}`);
|
const userUpdateArtifact = filesToArtifacts(modifiedFiles, `${Date.now()}`);
|
||||||
|
@ -296,6 +296,19 @@ export const ChatBox: React.FC<ChatBoxProps> = (props) => {
|
|||||||
onStop={props.stopListening}
|
onStop={props.stopListening}
|
||||||
disabled={props.isStreaming}
|
disabled={props.isStreaming}
|
||||||
/>
|
/>
|
||||||
|
<IconButton
|
||||||
|
title="Plan project in MD file"
|
||||||
|
className="transition-all flex items-center gap-1 px-1.5"
|
||||||
|
onClick={(event) =>
|
||||||
|
props.handleSendMessage?.(
|
||||||
|
event,
|
||||||
|
'Plan the project in a plan.md file with sections: Files/components needed, Data flow, Deployment plan.',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className="i-ph:map-trifold text-xl" />
|
||||||
|
<span>Plan</span>
|
||||||
|
</IconButton>
|
||||||
{props.chatStarted && (
|
{props.chatStarted && (
|
||||||
<IconButton
|
<IconButton
|
||||||
title="Discuss"
|
title="Discuss"
|
||||||
|
@ -7,7 +7,7 @@ interface FilePreviewProps {
|
|||||||
onRemove: (index: number) => void;
|
onRemove: (index: number) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FilePreview: React.FC<FilePreviewProps> = ({ files, imageDataList, textDataList, onRemove }) => {
|
const FilePreview: React.FC<FilePreviewProps> = ({ files, imageDataList, textDataList: _textDataList, onRemove }) => {
|
||||||
if (!files || files.length === 0) {
|
if (!files || files.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
import {
|
import { isFileTargeted as isFileTargetedInternal, getTargetedFiles } from '~/lib/persistence/targetedFiles';
|
||||||
addTargetedFile,
|
|
||||||
removeTargetedFile,
|
|
||||||
isFileTargeted as isFileTargetedInternal,
|
|
||||||
getTargetedFiles,
|
|
||||||
} from '~/lib/persistence/targetedFiles';
|
|
||||||
import { createScopedLogger } from './logger';
|
import { createScopedLogger } from './logger';
|
||||||
|
|
||||||
const logger = createScopedLogger('TargetFiles');
|
const logger = createScopedLogger('TargetFiles');
|
||||||
@ -12,10 +7,12 @@ export function getCurrentChatId(): string {
|
|||||||
try {
|
try {
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
const match = window.location.pathname.match(/\/chat\/([^/]+)/);
|
const match = window.location.pathname.match(/\/chat\/([^/]+)/);
|
||||||
|
|
||||||
if (match && match[1]) {
|
if (match && match[1]) {
|
||||||
return match[1];
|
return match[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'default';
|
return 'default';
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Failed to get current chat ID', error);
|
logger.error('Failed to get current chat ID', error);
|
||||||
@ -37,6 +34,7 @@ export function hasTargetedFiles(chatId?: string): boolean {
|
|||||||
try {
|
try {
|
||||||
const currentChatId = chatId || getCurrentChatId();
|
const currentChatId = chatId || getCurrentChatId();
|
||||||
const files = getTargetedFiles();
|
const files = getTargetedFiles();
|
||||||
|
|
||||||
return files.some((f) => f.chatId === currentChatId);
|
return files.some((f) => f.chatId === currentChatId);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Failed to check for targeted files', error);
|
logger.error('Failed to check for targeted files', error);
|
||||||
|
3
types/external.d.ts
vendored
Normal file
3
types/external.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
declare module 'pdfjs-dist/build/pdf.mjs';
|
||||||
|
declare module 'pdfjs-dist/build/pdf.worker.mjs';
|
||||||
|
declare module 'mammoth/mammoth.browser';
|
Loading…
Reference in New Issue
Block a user