From b304749b21f340e03c94abc0cc91ccf82f559195 Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Sun, 8 Dec 2024 22:53:20 +0530 Subject: [PATCH 01/23] added backdrop and loading screen --- app/components/git/GitUrlImport.client.tsx | 21 +++++- app/components/ui/LoadingOverlay.tsx | 14 ++++ app/components/ui/Settings.tsx | 75 +++++++++++++--------- app/components/ui/SettingsSlider.tsx | 6 +- 4 files changed, 81 insertions(+), 35 deletions(-) create mode 100644 app/components/ui/LoadingOverlay.tsx diff --git a/app/components/git/GitUrlImport.client.tsx b/app/components/git/GitUrlImport.client.tsx index cbdeaa5c..c2c949ec 100644 --- a/app/components/git/GitUrlImport.client.tsx +++ b/app/components/git/GitUrlImport.client.tsx @@ -8,6 +8,8 @@ import { Chat } from '~/components/chat/Chat.client'; import { useGit } from '~/lib/hooks/useGit'; import { useChatHistory } from '~/lib/persistence'; import { createCommandsMessage, detectProjectCommands } from '~/utils/projectCommands'; +import { LoadingOverlay } from '~/components/ui/LoadingOverlay'; +import { toast } from 'react-toastify'; const IGNORE_PATTERNS = [ 'node_modules/**', @@ -38,6 +40,7 @@ export function GitUrlImport() { const { ready: historyReady, importChat } = useChatHistory(); const { ready: gitReady, gitClone } = useGit(); const [imported, setImported] = useState(false); + const [loading, setLoading] = useState(true); const importRepo = async (repoUrl?: string) => { 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 00000000..6c69798f --- /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/components/ui/Settings.tsx b/app/components/ui/Settings.tsx index 109163de..58295ebd 100644 --- a/app/components/ui/Settings.tsx +++ b/app/components/ui/Settings.tsx @@ -10,7 +10,6 @@ import { toast } from 'react-toastify'; import { useNavigate } from '@remix-run/react'; import commit from '~/commit.json'; import Cookies from 'js-cookie'; -import { SettingsSlider } from './SettingsSlider'; import '~/styles/components/SettingsSlider.scss'; import '~/styles/components/Settings.scss'; @@ -219,9 +218,7 @@ export const Settings = ({ open, onClose }: SettingsProps) => { +
+ {!isConnected ? ( + + ) : ( + + )} + {isConnected && ( + +
+ Connected to GitHub + + )}
); From 21bfcfcec4f4e3ad486f09bbe6b18744dcd1e0fa Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sun, 15 Dec 2024 16:34:08 -0500 Subject: [PATCH 09/23] quick fix --- app/components/settings/connections/ConnectionsTab.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/components/settings/connections/ConnectionsTab.tsx b/app/components/settings/connections/ConnectionsTab.tsx index 76043671..fb0dadf7 100644 --- a/app/components/settings/connections/ConnectionsTab.tsx +++ b/app/components/settings/connections/ConnectionsTab.tsx @@ -3,6 +3,12 @@ import { toast } from 'react-toastify'; import Cookies from 'js-cookie'; import { logStore } from '~/lib/stores/logs'; +interface GitHubUserResponse { + login: string; + id: number; + [key: string]: any; // for other properties we don't explicitly need +} + export default function ConnectionsTab() { const [githubUsername, setGithubUsername] = useState(Cookies.get('githubUsername') || ''); const [githubToken, setGithubToken] = useState(Cookies.get('githubToken') || ''); @@ -26,7 +32,7 @@ export default function ConnectionsTab() { }); if (response.ok) { - const data = await response.json(); + const data = (await response.json()) as GitHubUserResponse; if (data.login === githubUsername) { setIsConnected(true); return true; From 66cb2af6df07faea33fe3db86a962b82f2fef20a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Dec 2024 08:01:34 +0000 Subject: [PATCH 10/23] chore: update commit hash to 960f532f8234663d0b3630d18033c959fac6882c --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index d39a9804..f348318b 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "6ba93974a02a98c83badf2f0002ff4812b8f75a9" } +{ "commit": "960f532f8234663d0b3630d18033c959fac6882c" } From 00d871bacedf018866f0ff70aea2b4497e118684 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Dec 2024 16:18:25 +0000 Subject: [PATCH 11/23] chore: update commit hash to de2cb43d170033c43a6cf436af02e033f66a7e4d --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 54c81df7..d46475e3 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "bb941802094c6186e805f99a6c165431ae86d216" } +{ "commit": "de2cb43d170033c43a6cf436af02e033f66a7e4d" , "version": "" } From e601da9612e48a932139ee6bda394f534d1e6c13 Mon Sep 17 00:00:00 2001 From: Anirban Kar Date: Mon, 16 Dec 2024 22:04:33 +0530 Subject: [PATCH 12/23] updated workflow for commit and stable release --- .github/workflows/commit.yaml | 12 +++++------- .github/workflows/update-stable.yml | 5 ++++- app/commit.json | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/commit.yaml b/.github/workflows/commit.yaml index 150948ae..4e8545b0 100644 --- a/.github/workflows/commit.yaml +++ b/.github/workflows/commit.yaml @@ -17,19 +17,17 @@ jobs: - name: Checkout the code uses: actions/checkout@v3 - - name: Get the latest commit hash - run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV - - - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' - - + - name: Get the latest commit hash + run: | + echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV + echo "CURRENT_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV + - name: Update commit file run: | - echo "CURRENT_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV echo "{ \"commit\": \"$COMMIT_HASH\" , \"version\": \"$CURRENT_VERSION\" }" > app/commit.json - name: Commit and push the update diff --git a/.github/workflows/update-stable.yml b/.github/workflows/update-stable.yml index e6fc2e58..d930fbd1 100644 --- a/.github/workflows/update-stable.yml +++ b/.github/workflows/update-stable.yml @@ -158,10 +158,13 @@ jobs: echo "$CHANGELOG_CONTENT" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - - name: Commit and Tag Release + - 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 + + - name: Commit and Tag Release + run: | git pull echo "{ \"commit\": \"$COMMIT_HASH\" , \"version\": \"$CURRENT_VERSION\" }" > app/commit.json git add package.json pnpm-lock.yaml changelog.md app/commit.json diff --git a/app/commit.json b/app/commit.json index d46475e3..27b04a24 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "de2cb43d170033c43a6cf436af02e033f66a7e4d" , "version": "" } +{ "commit": "47a1def87778d223b21b8468fcfd974b9498be5a" } From 92476dd2d75d640296ca61382e1cb5170a443185 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 16 Dec 2024 16:55:53 +0000 Subject: [PATCH 13/23] chore: update commit hash to 49b02dd885919e24a201f07b1a7b0fd0371b4f85 --- app/commit.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/commit.json b/app/commit.json index 27b04a24..b3f011d2 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "47a1def87778d223b21b8468fcfd974b9498be5a" } +{ "commit": "49b02dd885919e24a201f07b1a7b0fd0371b4f85" , "version": "0.0.1" } From 5f144e6994ecbb80ec7d779090e4a7562793d26d Mon Sep 17 00:00:00 2001 From: Arne Durr Date: Mon, 16 Dec 2024 18:21:30 +0100 Subject: [PATCH 14/23] Fixed theming of Copy Code button --- app/components/chat/CodeBlock.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/chat/CodeBlock.tsx b/app/components/chat/CodeBlock.tsx index e48913ce..bc20dc2c 100644 --- a/app/components/chat/CodeBlock.tsx +++ b/app/components/chat/CodeBlock.tsx @@ -53,7 +53,7 @@ export const CodeBlock = memo(
Date: Mon, 16 Dec 2024 23:55:51 +0530 Subject: [PATCH 15/23] minor bugfix --- app/commit.json | 2 +- .../settings/features/FeaturesTab.tsx | 4 +- app/components/sidebar/HistoryItem.tsx | 51 +++++++++++-------- app/lib/runtime/action-runner.ts | 7 +-- 4 files changed, 37 insertions(+), 27 deletions(-) diff --git a/app/commit.json b/app/commit.json index b3f011d2..d1a30336 100644 --- a/app/commit.json +++ b/app/commit.json @@ -1 +1 @@ -{ "commit": "49b02dd885919e24a201f07b1a7b0fd0371b4f85" , "version": "0.0.1" } +{ "commit": "25e6bb3e848b67c9337f1cca2779f1af6ddc8fed" } diff --git a/app/components/settings/features/FeaturesTab.tsx b/app/components/settings/features/FeaturesTab.tsx index bad8850e..0af3d401 100644 --- a/app/components/settings/features/FeaturesTab.tsx +++ b/app/components/settings/features/FeaturesTab.tsx @@ -65,7 +65,9 @@ export default function FeaturesTab() { className="flex-1 p-2 ml-auto rounded-lg border border-bolt-elements-borderColor bg-bolt-elements-prompt-background text-bolt-elements-textPrimary focus:outline-none focus:ring-2 focus:ring-bolt-elements-focus transition-all text-sm min-w-[100px]" > {PromptLibrary.getList().map((x) => ( - + ))}
diff --git a/app/components/sidebar/HistoryItem.tsx b/app/components/sidebar/HistoryItem.tsx index b228edbb..cd5c8b16 100644 --- a/app/components/sidebar/HistoryItem.tsx +++ b/app/components/sidebar/HistoryItem.tsx @@ -4,6 +4,7 @@ import * as Dialog from '@radix-ui/react-dialog'; import { type ChatHistoryItem } from '~/lib/persistence'; import WithTooltip from '~/components/ui/Tooltip'; import { useEditChatDescription } from '~/lib/hooks'; +import { forwardRef, type ForwardedRef } from 'react'; interface HistoryItemProps { item: ChatHistoryItem; @@ -103,25 +104,31 @@ export function HistoryItem({ item, onDelete, onDuplicate, exportChat }: History ); } -const ChatActionButton = ({ - toolTipContent, - icon, - className, - onClick, -}: { - toolTipContent: string; - icon: string; - className?: string; - onClick: (event: React.MouseEvent) => void; - btnTitle?: string; -}) => { - return ( - -