mirror of
https://github.com/stackblitz/bolt.new
synced 2025-02-06 04:48:04 +00:00
Merge branch 'minor-bugfix' into bugfix-for-stable
This commit is contained in:
commit
8110c69eda
@ -1 +1 @@
|
|||||||
{ "commit": "49b02dd885919e24a201f07b1a7b0fd0371b4f85" , "version": "0.0.1" }
|
{ "commit": "25e6bb3e848b67c9337f1cca2779f1af6ddc8fed" }
|
||||||
|
@ -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]"
|
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) => (
|
{PromptLibrary.getList().map((x) => (
|
||||||
<option value={x.id}>{x.label}</option>
|
<option key={x.id} value={x.id}>
|
||||||
|
{x.label}
|
||||||
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,6 +4,7 @@ import * as Dialog from '@radix-ui/react-dialog';
|
|||||||
import { type ChatHistoryItem } from '~/lib/persistence';
|
import { type ChatHistoryItem } from '~/lib/persistence';
|
||||||
import WithTooltip from '~/components/ui/Tooltip';
|
import WithTooltip from '~/components/ui/Tooltip';
|
||||||
import { useEditChatDescription } from '~/lib/hooks';
|
import { useEditChatDescription } from '~/lib/hooks';
|
||||||
|
import { forwardRef, type ForwardedRef } from 'react';
|
||||||
|
|
||||||
interface HistoryItemProps {
|
interface HistoryItemProps {
|
||||||
item: ChatHistoryItem;
|
item: ChatHistoryItem;
|
||||||
@ -103,25 +104,31 @@ export function HistoryItem({ item, onDelete, onDuplicate, exportChat }: History
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ChatActionButton = ({
|
const ChatActionButton = forwardRef(
|
||||||
|
(
|
||||||
|
{
|
||||||
toolTipContent,
|
toolTipContent,
|
||||||
icon,
|
icon,
|
||||||
className,
|
className,
|
||||||
onClick,
|
onClick,
|
||||||
}: {
|
}: {
|
||||||
toolTipContent: string;
|
toolTipContent: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
||||||
btnTitle?: string;
|
btnTitle?: string;
|
||||||
}) => {
|
},
|
||||||
|
ref: ForwardedRef<HTMLButtonElement>,
|
||||||
|
) => {
|
||||||
return (
|
return (
|
||||||
<WithTooltip tooltip={toolTipContent}>
|
<WithTooltip tooltip={toolTipContent}>
|
||||||
<button
|
<button
|
||||||
|
ref={ref}
|
||||||
type="button"
|
type="button"
|
||||||
className={`scale-110 mr-2 hover:text-bolt-elements-item-contentAccent ${icon} ${className ? className : ''}`}
|
className={`scale-110 mr-2 hover:text-bolt-elements-item-contentAccent ${icon} ${className ? className : ''}`}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
/>
|
/>
|
||||||
</WithTooltip>
|
</WithTooltip>
|
||||||
);
|
);
|
||||||
};
|
},
|
||||||
|
);
|
||||||
|
@ -202,8 +202,9 @@ export class ActionRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const webcontainer = await this.#webcontainer;
|
const webcontainer = await this.#webcontainer;
|
||||||
|
const relativePath = nodePath.relative(webcontainer.workdir, action.filePath);
|
||||||
|
|
||||||
let folder = nodePath.dirname(action.filePath);
|
let folder = nodePath.dirname(relativePath);
|
||||||
|
|
||||||
// remove trailing slashes
|
// remove trailing slashes
|
||||||
folder = folder.replace(/\/+$/g, '');
|
folder = folder.replace(/\/+$/g, '');
|
||||||
@ -218,8 +219,8 @@ export class ActionRunner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await webcontainer.fs.writeFile(action.filePath, action.content);
|
await webcontainer.fs.writeFile(relativePath, action.content);
|
||||||
logger.debug(`File written ${action.filePath}`);
|
logger.debug(`File written ${relativePath}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error('Failed to write file\n\n', error);
|
logger.error('Failed to write file\n\n', error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user