diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 4e8545b..9d88605 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -28,7 +28,7 @@ jobs: - name: Update commit file run: | - echo "{ \"commit\": \"$COMMIT_HASH\" , \"version\": \"$CURRENT_VERSION\" }" > app/commit.json + echo "{ \"commit\": \"$COMMIT_HASH\", \"version\": \"$CURRENT_VERSION\" }" > app/commit.json - name: Commit and push the update run: | diff --git a/.github/workflows/update-stable.yml b/.github/workflows/update-stable.yml index d930fbd..bcb0ad9 100644 --- a/.github/workflows/update-stable.yml +++ b/.github/workflows/update-stable.yml @@ -161,12 +161,12 @@ jobs: - name: Get the latest commit hash and version tag run: | echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV - echo "CURRENT_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV + echo "NEW_VERSION=${{ steps.bump_version.outputs.new_version }}" >> $GITHUB_ENV - name: Commit and Tag Release run: | git pull - echo "{ \"commit\": \"$COMMIT_HASH\" , \"version\": \"$CURRENT_VERSION\" }" > app/commit.json + echo "{ \"commit\": \"$COMMIT_HASH\", \"version\": \"$NEW_VERSION\" }" > app/commit.json git add package.json pnpm-lock.yaml changelog.md app/commit.json git commit -m "chore: release version ${{ steps.bump_version.outputs.new_version }}" git tag "v${{ steps.bump_version.outputs.new_version }}" diff --git a/app/commit.json b/app/commit.json index d1a3033..d13671c 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "25e6bb3e848b67c9337f1cca2779f1af6ddc8fed" } +{ "commit": "8110c69eda7ae71914ef6b1e78dd51c3a6fd9f5b" } diff --git a/app/components/chat/Chat.client.tsx b/app/components/chat/Chat.client.tsx index cff4e36..d9e57f2 100644 --- a/app/components/chat/Chat.client.tsx +++ b/app/components/chat/Chat.client.tsx @@ -20,6 +20,7 @@ import Cookies from 'js-cookie'; import { debounce } from '~/utils/debounce'; import { useSettings } from '~/lib/hooks/useSettings'; import type { ProviderInfo } from '~/types/model'; +import { useSearchParams } from '@remix-run/react'; const toastAnimation = cssTransition({ enter: 'animated fadeInRight', @@ -92,6 +93,7 @@ export const ChatImpl = memo( const [chatStarted, setChatStarted] = useState(initialMessages.length > 0); const [uploadedFiles, setUploadedFiles] = useState([]); // Move here const [imageDataList, setImageDataList] = useState([]); // Move here + const [searchParams, setSearchParams] = useSearchParams(); const files = useStore(workbenchStore.files); const { activeProviders, promptId } = useSettings(); @@ -138,6 +140,24 @@ export const ChatImpl = memo( initialMessages, initialInput: Cookies.get(PROMPT_COOKIE_KEY) || '', }); + useEffect(() => { + const prompt = searchParams.get('prompt'); + console.log(prompt, searchParams, model, provider); + + if (prompt) { + setSearchParams({}); + runAnimation(); + append({ + role: 'user', + content: [ + { + type: 'text', + text: `[Model: ${model}]\n\n[Provider: ${provider.name}]\n\n${prompt}`, + }, + ] as any, // Type assertion to bypass compiler check + }); + } + }, [model, provider, searchParams]); const { enhancingPrompt, promptEnhanced, enhancePrompt, resetEnhancer } = usePromptEnhancer(); const { parsedMessages, parseMessages } = useMessageParser(); diff --git a/app/components/chat/CodeBlock.tsx b/app/components/chat/CodeBlock.tsx index e48913c..bc20dc2 100644 --- a/app/components/chat/CodeBlock.tsx +++ b/app/components/chat/CodeBlock.tsx @@ -53,7 +53,7 @@ export const CodeBlock = memo(
{ if (!gitReady && !historyReady) { @@ -109,9 +112,23 @@ ${file.content} return; } - importRepo(url); + importRepo(url).catch((error) => { + console.error('Error importing repo:', error); + toast.error('Failed to import repository'); + setLoading(false); + window.location.href = '/'; + }); setImported(true); }, [searchParams, historyReady, gitReady, imported]); - return }>{() => }; + return ( + }> + {() => ( + <> + + {loading && } + + )} + + ); } diff --git a/app/components/ui/LoadingOverlay.tsx b/app/components/ui/LoadingOverlay.tsx new file mode 100644 index 0000000..6c69798 --- /dev/null +++ b/app/components/ui/LoadingOverlay.tsx @@ -0,0 +1,14 @@ +export const LoadingOverlay = ({ message = 'Loading...' }) => { + return ( +
+ {/* Loading content */} +
+
+

{message}

+
+
+ ); +}; diff --git a/app/routes/git.tsx b/app/routes/git.tsx index aa1689a..5793e22 100644 --- a/app/routes/git.tsx +++ b/app/routes/git.tsx @@ -4,6 +4,7 @@ import { ClientOnly } from 'remix-utils/client-only'; import { BaseChat } from '~/components/chat/BaseChat'; import { GitUrlImport } from '~/components/git/GitUrlImport.client'; import { Header } from '~/components/header/Header'; +import BackgroundRays from '~/components/ui/BackgroundRays'; export const meta: MetaFunction = () => { return [{ title: 'Bolt' }, { name: 'description', content: 'Talk with Bolt, an AI assistant from StackBlitz' }]; @@ -15,7 +16,8 @@ export async function loader(args: LoaderFunctionArgs) { export default function Index() { return ( -
+
+
}>{() => }