Spaces:
Running
Running
fix stuffs
Browse files- src/components/ask-ai/ask-ai.tsx +1 -3
- src/components/deploy-button/deploy-button.tsx +2 -2
- src/components/footer/footer.tsx +1 -1
- src/components/history/history.tsx +2 -2
- src/components/loading/loading.tsx +1 -1
- src/components/preview/preview.tsx +11 -1
- src/components/settings/settings.tsx +1 -1
- src/views/App.tsx +4 -0
- utils/providers.js +1 -1
src/components/ask-ai/ask-ai.tsx
CHANGED
@@ -284,9 +284,7 @@ function AskAI({
|
|
284 |
type="text"
|
285 |
disabled={isAiWorking}
|
286 |
className="w-full bg-transparent max-lg:text-sm outline-none px-3 text-white placeholder:text-neutral-400 font-code"
|
287 |
-
placeholder={
|
288 |
-
hasAsked ? "What do you want to ask AI next?" : "Ask AI anything..."
|
289 |
-
}
|
290 |
value={prompt}
|
291 |
onChange={(e) => setPrompt(e.target.value)}
|
292 |
onKeyDown={(e) => {
|
|
|
284 |
type="text"
|
285 |
disabled={isAiWorking}
|
286 |
className="w-full bg-transparent max-lg:text-sm outline-none px-3 text-white placeholder:text-neutral-400 font-code"
|
287 |
+
placeholder={hasAsked ? "Ask AI for edits" : "Ask AI anything..."}
|
|
|
|
|
288 |
value={prompt}
|
289 |
onChange={(e) => setPrompt(e.target.value)}
|
290 |
onKeyDown={(e) => {
|
src/components/deploy-button/deploy-button.tsx
CHANGED
@@ -103,7 +103,7 @@ function DeployButton({
|
|
103 |
</Login>
|
104 |
) : (
|
105 |
<>
|
106 |
-
<header className="flex items-center text-sm px-4 py-
|
107 |
<span className="text-xs bg-pink-500/10 text-pink-500 rounded-full pl-1.5 pr-2.5 py-0.5 flex items-center justify-start gap-1.5">
|
108 |
<img src={SpaceIcon} alt="Space Icon" className="size-4" />
|
109 |
Space
|
@@ -130,7 +130,7 @@ function DeployButton({
|
|
130 |
</p>
|
131 |
{!path && (
|
132 |
<label className="block">
|
133 |
-
<p className="text-
|
134 |
Space Title
|
135 |
</p>
|
136 |
<input
|
|
|
103 |
</Login>
|
104 |
) : (
|
105 |
<>
|
106 |
+
<header className="flex items-center text-sm px-4 py-3 border-b gap-2 bg-neutral-950 border-neutral-800 font-semibold text-neutral-200">
|
107 |
<span className="text-xs bg-pink-500/10 text-pink-500 rounded-full pl-1.5 pr-2.5 py-0.5 flex items-center justify-start gap-1.5">
|
108 |
<img src={SpaceIcon} alt="Space Icon" className="size-4" />
|
109 |
Space
|
|
|
130 |
</p>
|
131 |
{!path && (
|
132 |
<label className="block">
|
133 |
+
<p className="text-muted-foreground text-sm mb-1.5">
|
134 |
Space Title
|
135 |
</p>
|
136 |
<input
|
src/components/footer/footer.tsx
CHANGED
@@ -72,7 +72,7 @@ function Footer({
|
|
72 |
<DropdownMenuTrigger asChild>
|
73 |
<p className="mr-3 text-xs lg:text-sm text-gray-300 flex items-center gap-1 cursor-pointer hover:brightness-110">
|
74 |
<ChevronDown className="size-4" />
|
75 |
-
<Avatar className="size-
|
76 |
<AvatarImage src={auth?.picture} alt="@shadcn" />
|
77 |
<AvatarFallback className="text-sm">
|
78 |
{auth?.preferred_username?.charAt(0).toUpperCase() ??
|
|
|
72 |
<DropdownMenuTrigger asChild>
|
73 |
<p className="mr-3 text-xs lg:text-sm text-gray-300 flex items-center gap-1 cursor-pointer hover:brightness-110">
|
74 |
<ChevronDown className="size-4" />
|
75 |
+
<Avatar className="size-6 mr-1">
|
76 |
<AvatarImage src={auth?.picture} alt="@shadcn" />
|
77 |
<AvatarFallback className="text-sm">
|
78 |
{auth?.preferred_username?.charAt(0).toUpperCase() ??
|
src/components/history/history.tsx
CHANGED
@@ -13,7 +13,7 @@ export default function History({
|
|
13 |
<Popover>
|
14 |
<PopoverTrigger asChild>
|
15 |
<Button variant="ghost" size="sm" className="max-lg:hidden">
|
16 |
-
{history?.length}
|
17 |
</Button>
|
18 |
</PopoverTrigger>
|
19 |
<PopoverContent
|
@@ -21,7 +21,7 @@ export default function History({
|
|
21 |
align="start"
|
22 |
>
|
23 |
<header className="text-sm px-4 py-3 border-b gap-2 bg-neutral-950 border-neutral-800 font-semibold text-neutral-200">
|
24 |
-
|
25 |
</header>
|
26 |
<main className="px-4 space-y-3">
|
27 |
<ul className="max-h-[250px] overflow-y-auto">
|
|
|
13 |
<Popover>
|
14 |
<PopoverTrigger asChild>
|
15 |
<Button variant="ghost" size="sm" className="max-lg:hidden">
|
16 |
+
{history?.length} edits
|
17 |
</Button>
|
18 |
</PopoverTrigger>
|
19 |
<PopoverContent
|
|
|
21 |
align="start"
|
22 |
>
|
23 |
<header className="text-sm px-4 py-3 border-b gap-2 bg-neutral-950 border-neutral-800 font-semibold text-neutral-200">
|
24 |
+
History
|
25 |
</header>
|
26 |
<main className="px-4 space-y-3">
|
27 |
<ul className="max-h-[250px] overflow-y-auto">
|
src/components/loading/loading.tsx
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
function Loading() {
|
2 |
return (
|
3 |
-
<div className="absolute left-0 top-0 h-full w-full flex items-center justify-center bg-
|
4 |
<svg
|
5 |
className="size-5 animate-spin text-white"
|
6 |
xmlns="http://www.w3.org/2000/svg"
|
|
|
1 |
function Loading() {
|
2 |
return (
|
3 |
+
<div className="absolute left-0 top-0 h-full w-full flex items-center justify-center z-20 bg-black/50 rounded-full">
|
4 |
<svg
|
5 |
className="size-5 animate-spin text-white"
|
6 |
xmlns="http://www.w3.org/2000/svg"
|
src/components/preview/preview.tsx
CHANGED
@@ -47,13 +47,14 @@ function Preview({
|
|
47 |
)}
|
48 |
/>
|
49 |
<iframe
|
|
|
50 |
ref={iframeRef}
|
51 |
title="output"
|
52 |
className={classNames(
|
53 |
"w-full select-none transition-all duration-200 bg-black max-lg:h-full",
|
54 |
{
|
55 |
"pointer-events-none": isResizing || isAiWorking,
|
56 |
-
"lg:max-w-md lg:mx-auto lg:h-[80dvh] lg:!rounded-[
|
57 |
device === "mobile",
|
58 |
"h-full": device === "desktop",
|
59 |
"lg:border-[8px] lg:border-neutral-700 lg:shadow-2xl lg:rounded-[44px]":
|
@@ -61,6 +62,15 @@ function Preview({
|
|
61 |
}
|
62 |
)}
|
63 |
srcDoc={html}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
/>
|
65 |
</div>
|
66 |
);
|
|
|
47 |
)}
|
48 |
/>
|
49 |
<iframe
|
50 |
+
id="preview-iframe"
|
51 |
ref={iframeRef}
|
52 |
title="output"
|
53 |
className={classNames(
|
54 |
"w-full select-none transition-all duration-200 bg-black max-lg:h-full",
|
55 |
{
|
56 |
"pointer-events-none": isResizing || isAiWorking,
|
57 |
+
"lg:max-w-md lg:mx-auto lg:h-[80dvh] lg:!rounded-[42px] lg:border-[8px] lg:border-neutral-700 lg:shadow-2xl":
|
58 |
device === "mobile",
|
59 |
"h-full": device === "desktop",
|
60 |
"lg:border-[8px] lg:border-neutral-700 lg:shadow-2xl lg:rounded-[44px]":
|
|
|
62 |
}
|
63 |
)}
|
64 |
srcDoc={html}
|
65 |
+
onLoad={() => {
|
66 |
+
if (iframeRef?.current?.contentWindow?.document?.body) {
|
67 |
+
iframeRef.current.contentWindow.document.body.scrollIntoView({
|
68 |
+
block: isAiWorking ? "end" : "start",
|
69 |
+
inline: "nearest",
|
70 |
+
behavior: isAiWorking ? "instant" : "smooth",
|
71 |
+
});
|
72 |
+
}
|
73 |
+
}}
|
74 |
/>
|
75 |
</div>
|
76 |
);
|
src/components/settings/settings.tsx
CHANGED
@@ -142,7 +142,7 @@ function Settings({
|
|
142 |
(m: { value: string }) => m.value === model
|
143 |
);
|
144 |
if (provider === "auto") {
|
145 |
-
onChange(foundModel.
|
146 |
} else {
|
147 |
onChange("auto");
|
148 |
}
|
|
|
142 |
(m: { value: string }) => m.value === model
|
143 |
);
|
144 |
if (provider === "auto") {
|
145 |
+
onChange(foundModel.autoProvider);
|
146 |
} else {
|
147 |
onChange("auto");
|
148 |
}
|
src/views/App.tsx
CHANGED
@@ -165,6 +165,10 @@ export default function App() {
|
|
165 |
if (currentTab === "chat") {
|
166 |
// Reset editor width when switching to reasoning tab
|
167 |
resetLayout();
|
|
|
|
|
|
|
|
|
168 |
} else {
|
169 |
if (preview.current) {
|
170 |
// Reset preview width when switching to preview tab
|
|
|
165 |
if (currentTab === "chat") {
|
166 |
// Reset editor width when switching to reasoning tab
|
167 |
resetLayout();
|
168 |
+
// re-add the event listener for resizing
|
169 |
+
if (resizer.current) {
|
170 |
+
resizer.current.addEventListener("mousedown", handleMouseDown);
|
171 |
+
}
|
172 |
} else {
|
173 |
if (preview.current) {
|
174 |
// Reset preview width when switching to preview tab
|
utils/providers.js
CHANGED
@@ -36,7 +36,7 @@ export const MODELS = [
|
|
36 |
value: "deepseek-ai/DeepSeek-V3-0324",
|
37 |
label: "DeepSeek V3 O324",
|
38 |
providers: ["fireworks-ai", "nebius", "sambanova", "novita", "hyperbolic"],
|
39 |
-
autoProvider: "
|
40 |
},
|
41 |
{
|
42 |
value: "deepseek-ai/DeepSeek-R1-0528",
|
|
|
36 |
value: "deepseek-ai/DeepSeek-V3-0324",
|
37 |
label: "DeepSeek V3 O324",
|
38 |
providers: ["fireworks-ai", "nebius", "sambanova", "novita", "hyperbolic"],
|
39 |
+
autoProvider: "sambanova",
|
40 |
},
|
41 |
{
|
42 |
value: "deepseek-ai/DeepSeek-R1-0528",
|