Skip to content

Commit 74b0ea8

Browse files
committed
fixed zip
1 parent cecc053 commit 74b0ea8

File tree

8 files changed

+55
-13
lines changed

8 files changed

+55
-13
lines changed

@/components/ui/popover.tsx

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import * as React from "react"
2+
import * as PopoverPrimitive from "@radix-ui/react-popover"
3+
4+
import { cn } from "@/lib/utils"
5+
6+
const Popover = PopoverPrimitive.Root
7+
8+
const PopoverTrigger = PopoverPrimitive.Trigger
9+
10+
const PopoverAnchor = PopoverPrimitive.Anchor
11+
12+
const PopoverContent = React.forwardRef<
13+
React.ElementRef<typeof PopoverPrimitive.Content>,
14+
React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
15+
>(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
16+
<PopoverPrimitive.Portal>
17+
<PopoverPrimitive.Content
18+
ref={ref}
19+
align={align}
20+
sideOffset={sideOffset}
21+
className={cn(
22+
"z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
23+
className
24+
)}
25+
{...props}
26+
/>
27+
</PopoverPrimitive.Portal>
28+
))
29+
PopoverContent.displayName = PopoverPrimitive.Content.displayName
30+
31+
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }

package-lock.json

-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/src/app/app.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ export default function App() {
9595
try {
9696
for (let i = 0; i < numFiles; i++) {
9797
const file = files[i];
98+
99+
// FIXME: hacky, use a better method to detect zips
98100
// Reject files that are not .zip
99-
if (file.type !== "application/zip") {
101+
if (!file.type.includes("zip")) {
100102
toast.error(`${file.name} is not a zip file, skipping...`);
101103
continue;
102104
}

src/renderer/src/app/settings/settings_chat.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function SettingsChat() {
5454
syncSettings();
5555
}, []);
5656

57-
/* Set the form's values to be the user's settings.json */
57+
// Set the form's values to be the user's settings.json
5858
const syncSettings = async () => {
5959
const res = await window.api.setting.get();
6060
if (res.kind === "err") {
@@ -134,6 +134,7 @@ export default function SettingsChat() {
134134
render={({ field }) => (
135135
<Combobox
136136
items={models.map((model) => ({ name: model, value: model }))}
137+
disabled={true}
137138
value={field.value}
138139
setValue={(value) => {
139140
setValue("model", value);

src/renderer/src/components/LogoButton.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ export default function LogoButton({ className, rest }: LogoButtonProps) {
2626
return (
2727
<DropdownMenu>
2828
<DropdownMenuTrigger>
29-
<button className={cn("h-9 w-16 rounded-full bg-logo-grad px-5 py-3", className)} {...rest}></button>
29+
<button
30+
className={cn("h-9 w-16 outline-none rounded-full bg-logo-grad px-5 py-3", className)}
31+
{...rest}
32+
></button>
3033
</DropdownMenuTrigger>
3134
<DropdownMenuContent align="end">
3235
<div>

src/renderer/src/components/ui/combobox.tsx

+10-4
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,28 @@ interface ComboBoxProps {
1111
setValue: (value: string) => void;
1212
placeholder?: string;
1313
emptyMessage?: string;
14+
disabled?: boolean;
15+
[key: string]: any;
1416
}
1517

1618
export default function Combobox({
1719
items,
1820
value,
1921
setValue,
2022
placeholder = "",
21-
emptyMessage = "No results found"
23+
emptyMessage = "No results found",
24+
disabled,
25+
...rest
2226
}: ComboBoxProps) {
2327
const [open, setOpen] = React.useState(false);
2428

2529
return (
2630
<Popover open={open} onOpenChange={setOpen}>
27-
<PopoverTrigger asChild>
28-
<button className="flex h-12 w-full items-center border border-line justify-between rounded-lg bg-input-primary px-3 py-2 text-tx-primary">
29-
<p className="line-clamp-1 text-ellipsis">
31+
<PopoverTrigger asChild disabled={disabled} {...rest}>
32+
<button
33+
className={` flex h-12 w-full items-center border border-line justify-between rounded-lg ${disabled ? "bg-muted border-none" : "bg-input-primary"} px-3 py-2 text-tx-primary `}
34+
>
35+
<p className="line-clamp-1 text-ellipsis" {...rest}>
3036
{value ? items.find((item) => item.value === value)?.name : placeholder}
3137
</p>
3238
<CaretSortIcon className="ml-2 h-4 w-4 shrink-0 opacity-50" />

src/renderer/src/styles/global.css

+3
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@
193193
--action-primary: hsl(340, 80%, 70%); /* Vibrant pink for primary action buttons */
194194
--action-secondary: hsl(340, 60%, 80%); /* Softer pink for secondary action buttons */
195195
--action-tertiary: hsl(340, 40%, 90%); /* Pale pink for tertiary action buttons */
196+
197+
--muted: hsl(0, 0%, 50%);
196198
}
197199

198200
/* Artic dark theme */
@@ -323,6 +325,7 @@
323325
--action-primary: hsl(345, 77%, 48%);
324326
--action-secondary: hsl(230, 25%, 55%);
325327
--action-tertiary: hsl(230, 25%, 25%);
328+
326329
}
327330

328331
/* Twilight dark theme */

tailwind.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ module.exports = {
6868
line: "var(--line)",
6969
accent: "var(--accent)",
7070
float: "var(--float)",
71+
muted: "var(--muted)",
72+
7173
popover: {
7274
DEFAULT: "var(--popover)",
7375
foreground: "var(--popover-foreground)"

0 commit comments

Comments
 (0)