Merge pull request #776 from thecodacus/bugfix-for-stable #release
Browse files- .github/workflows/commit.yaml +1 -1
- .github/workflows/update-stable.yml +2 -2
- app/commit.json +1 -1
- app/components/settings/connections/ConnectionsTab.tsx +7 -1
- app/components/settings/features/FeaturesTab.tsx +3 -1
- app/components/sidebar/HistoryItem.tsx +29 -22
- app/lib/runtime/action-runner.ts +4 -3
.github/workflows/commit.yaml
CHANGED
@@ -28,7 +28,7 @@ jobs:
|
|
28 |
|
29 |
- name: Update commit file
|
30 |
run: |
|
31 |
-
echo "{ \"commit\": \"$COMMIT_HASH\"
|
32 |
|
33 |
- name: Commit and push the update
|
34 |
run: |
|
|
|
28 |
|
29 |
- name: Update commit file
|
30 |
run: |
|
31 |
+
echo "{ \"commit\": \"$COMMIT_HASH\", \"version\": \"$CURRENT_VERSION\" }" > app/commit.json
|
32 |
|
33 |
- name: Commit and push the update
|
34 |
run: |
|
.github/workflows/update-stable.yml
CHANGED
@@ -161,12 +161,12 @@ jobs:
|
|
161 |
- name: Get the latest commit hash and version tag
|
162 |
run: |
|
163 |
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
164 |
-
echo "
|
165 |
|
166 |
- name: Commit and Tag Release
|
167 |
run: |
|
168 |
git pull
|
169 |
-
echo "{ \"commit\": \"$COMMIT_HASH\"
|
170 |
git add package.json pnpm-lock.yaml changelog.md app/commit.json
|
171 |
git commit -m "chore: release version ${{ steps.bump_version.outputs.new_version }}"
|
172 |
git tag "v${{ steps.bump_version.outputs.new_version }}"
|
|
|
161 |
- name: Get the latest commit hash and version tag
|
162 |
run: |
|
163 |
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
164 |
+
echo "NEW_VERSION=${{ steps.bump_version.outputs.new_version }}" >> $GITHUB_ENV
|
165 |
|
166 |
- name: Commit and Tag Release
|
167 |
run: |
|
168 |
git pull
|
169 |
+
echo "{ \"commit\": \"$COMMIT_HASH\", \"version\": \"$NEW_VERSION\" }" > app/commit.json
|
170 |
git add package.json pnpm-lock.yaml changelog.md app/commit.json
|
171 |
git commit -m "chore: release version ${{ steps.bump_version.outputs.new_version }}"
|
172 |
git tag "v${{ steps.bump_version.outputs.new_version }}"
|
app/commit.json
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{ "commit": "
|
|
|
1 |
+
{ "commit": "016488998ddd5d21157854246daa7b8224aa8989" }
|
app/components/settings/connections/ConnectionsTab.tsx
CHANGED
@@ -6,7 +6,7 @@ import { logStore } from '~/lib/stores/logs';
|
|
6 |
interface GitHubUserResponse {
|
7 |
login: string;
|
8 |
id: number;
|
9 |
-
[key: string]: any;
|
10 |
}
|
11 |
|
12 |
export default function ConnectionsTab() {
|
@@ -24,6 +24,7 @@ export default function ConnectionsTab() {
|
|
24 |
|
25 |
const verifyGitHubCredentials = async () => {
|
26 |
setIsVerifying(true);
|
|
|
27 |
try {
|
28 |
const response = await fetch('https://api.github.com/user', {
|
29 |
headers: {
|
@@ -33,16 +34,20 @@ export default function ConnectionsTab() {
|
|
33 |
|
34 |
if (response.ok) {
|
35 |
const data = (await response.json()) as GitHubUserResponse;
|
|
|
36 |
if (data.login === githubUsername) {
|
37 |
setIsConnected(true);
|
38 |
return true;
|
39 |
}
|
40 |
}
|
|
|
41 |
setIsConnected(false);
|
|
|
42 |
return false;
|
43 |
} catch (error) {
|
44 |
console.error('Error verifying GitHub credentials:', error);
|
45 |
setIsConnected(false);
|
|
|
46 |
return false;
|
47 |
} finally {
|
48 |
setIsVerifying(false);
|
@@ -56,6 +61,7 @@ export default function ConnectionsTab() {
|
|
56 |
}
|
57 |
|
58 |
setIsVerifying(true);
|
|
|
59 |
const isValid = await verifyGitHubCredentials();
|
60 |
|
61 |
if (isValid) {
|
|
|
6 |
interface GitHubUserResponse {
|
7 |
login: string;
|
8 |
id: number;
|
9 |
+
[key: string]: any; // for other properties we don't explicitly need
|
10 |
}
|
11 |
|
12 |
export default function ConnectionsTab() {
|
|
|
24 |
|
25 |
const verifyGitHubCredentials = async () => {
|
26 |
setIsVerifying(true);
|
27 |
+
|
28 |
try {
|
29 |
const response = await fetch('https://api.github.com/user', {
|
30 |
headers: {
|
|
|
34 |
|
35 |
if (response.ok) {
|
36 |
const data = (await response.json()) as GitHubUserResponse;
|
37 |
+
|
38 |
if (data.login === githubUsername) {
|
39 |
setIsConnected(true);
|
40 |
return true;
|
41 |
}
|
42 |
}
|
43 |
+
|
44 |
setIsConnected(false);
|
45 |
+
|
46 |
return false;
|
47 |
} catch (error) {
|
48 |
console.error('Error verifying GitHub credentials:', error);
|
49 |
setIsConnected(false);
|
50 |
+
|
51 |
return false;
|
52 |
} finally {
|
53 |
setIsVerifying(false);
|
|
|
61 |
}
|
62 |
|
63 |
setIsVerifying(true);
|
64 |
+
|
65 |
const isValid = await verifyGitHubCredentials();
|
66 |
|
67 |
if (isValid) {
|
app/components/settings/features/FeaturesTab.tsx
CHANGED
@@ -65,7 +65,9 @@ export default function FeaturesTab() {
|
|
65 |
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]"
|
66 |
>
|
67 |
{PromptLibrary.getList().map((x) => (
|
68 |
-
<option
|
|
|
|
|
69 |
))}
|
70 |
</select>
|
71 |
</div>
|
|
|
65 |
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]"
|
66 |
>
|
67 |
{PromptLibrary.getList().map((x) => (
|
68 |
+
<option key={x.id} value={x.id}>
|
69 |
+
{x.label}
|
70 |
+
</option>
|
71 |
))}
|
72 |
</select>
|
73 |
</div>
|
app/components/sidebar/HistoryItem.tsx
CHANGED
@@ -4,6 +4,7 @@ import * as Dialog from '@radix-ui/react-dialog';
|
|
4 |
import { type ChatHistoryItem } from '~/lib/persistence';
|
5 |
import WithTooltip from '~/components/ui/Tooltip';
|
6 |
import { useEditChatDescription } from '~/lib/hooks';
|
|
|
7 |
|
8 |
interface HistoryItemProps {
|
9 |
item: ChatHistoryItem;
|
@@ -103,25 +104,31 @@ export function HistoryItem({ item, onDelete, onDuplicate, exportChat }: History
|
|
103 |
);
|
104 |
}
|
105 |
|
106 |
-
const ChatActionButton = (
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
import { type ChatHistoryItem } from '~/lib/persistence';
|
5 |
import WithTooltip from '~/components/ui/Tooltip';
|
6 |
import { useEditChatDescription } from '~/lib/hooks';
|
7 |
+
import { forwardRef, type ForwardedRef } from 'react';
|
8 |
|
9 |
interface HistoryItemProps {
|
10 |
item: ChatHistoryItem;
|
|
|
104 |
);
|
105 |
}
|
106 |
|
107 |
+
const ChatActionButton = forwardRef(
|
108 |
+
(
|
109 |
+
{
|
110 |
+
toolTipContent,
|
111 |
+
icon,
|
112 |
+
className,
|
113 |
+
onClick,
|
114 |
+
}: {
|
115 |
+
toolTipContent: string;
|
116 |
+
icon: string;
|
117 |
+
className?: string;
|
118 |
+
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
119 |
+
btnTitle?: string;
|
120 |
+
},
|
121 |
+
ref: ForwardedRef<HTMLButtonElement>,
|
122 |
+
) => {
|
123 |
+
return (
|
124 |
+
<WithTooltip tooltip={toolTipContent}>
|
125 |
+
<button
|
126 |
+
ref={ref}
|
127 |
+
type="button"
|
128 |
+
className={`scale-110 mr-2 hover:text-bolt-elements-item-contentAccent ${icon} ${className ? className : ''}`}
|
129 |
+
onClick={onClick}
|
130 |
+
/>
|
131 |
+
</WithTooltip>
|
132 |
+
);
|
133 |
+
},
|
134 |
+
);
|
app/lib/runtime/action-runner.ts
CHANGED
@@ -202,8 +202,9 @@ export class ActionRunner {
|
|
202 |
}
|
203 |
|
204 |
const webcontainer = await this.#webcontainer;
|
|
|
205 |
|
206 |
-
let folder = nodePath.dirname(
|
207 |
|
208 |
// remove trailing slashes
|
209 |
folder = folder.replace(/\/+$/g, '');
|
@@ -218,8 +219,8 @@ export class ActionRunner {
|
|
218 |
}
|
219 |
|
220 |
try {
|
221 |
-
await webcontainer.fs.writeFile(
|
222 |
-
logger.debug(`File written ${
|
223 |
} catch (error) {
|
224 |
logger.error('Failed to write file\n\n', error);
|
225 |
}
|
|
|
202 |
}
|
203 |
|
204 |
const webcontainer = await this.#webcontainer;
|
205 |
+
const relativePath = nodePath.relative(webcontainer.workdir, action.filePath);
|
206 |
|
207 |
+
let folder = nodePath.dirname(relativePath);
|
208 |
|
209 |
// remove trailing slashes
|
210 |
folder = folder.replace(/\/+$/g, '');
|
|
|
219 |
}
|
220 |
|
221 |
try {
|
222 |
+
await webcontainer.fs.writeFile(relativePath, action.content);
|
223 |
+
logger.debug(`File written ${relativePath}`);
|
224 |
} catch (error) {
|
225 |
logger.error('Failed to write file\n\n', error);
|
226 |
}
|