Skip to content

Unified Listbox + Typescript version fix #4792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Mar 25, 2025
177 changes: 161 additions & 16 deletions gui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@continuedev/config-yaml": "^1.0.63",
"@headlessui/react": "^1.7.17",
"@headlessui/react": "^2.2.0",
"@heroicons/react": "^2.0.18",
"@reduxjs/toolkit": "^2.3.0",
"@tiptap/core": "^2.3.2",
Expand All @@ -34,6 +34,7 @@
"@tiptap/suggestion": "^2.1.13",
"@types/uuid": "^10.0.0",
"@types/vscode-webview": "^1.57.1",
"clsx": "^2.1.1",
"core": "file:../core",
"dompurify": "^3.0.6",
"downshift": "^7.6.0",
Expand Down Expand Up @@ -67,6 +68,7 @@
"socket.io-client": "^4.7.2",
"styled-components": "^5.3.6",
"table": "^6.8.1",
"tailwind-merge": "^3.0.2",
"tippy.js": "^6.3.7",
"unist-util-visit": "^5.0.0",
"uuid": "^9.0.1",
Expand Down
28 changes: 14 additions & 14 deletions gui/src/components/CodeToEditCard/AddFileButton.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline";
import { useContext, useRef } from "react";
import { IdeMessengerContext } from "../../context/IdeMessenger";
import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline";
import { Listbox } from "@headlessui/react";
import { addCodeToEdit } from "../../redux/slices/sessionSlice";
import { useAppDispatch } from "../../redux/hooks";
import { addCodeToEdit } from "../../redux/slices/sessionSlice";
import {
Listbox,
ListboxButton,
ListboxOption,
ListboxOptions,
} from "../ui/Listbox";

export interface AddFileButtonProps {
onClick: () => void;
Expand All @@ -29,9 +34,9 @@ export default function AddFileButton({ onClick }: AddFileButtonProps) {
return (
<Listbox onChange={handleAddAllOpenFiles}>
<div className="relative">
<Listbox.Button
<ListboxButton
ref={buttonRef}
className="bg-vsc-editor-background border-lightgray/50 flex h-5 cursor-pointer items-center justify-between rounded-md border border-solid px-0 shadow-sm transition-colors"
className="bg-vsc-editor-background m-0 rounded-md p-0"
>
<div
className="flex h-5 w-14 items-center justify-center gap-1 hover:brightness-125"
Expand All @@ -50,16 +55,11 @@ export default function AddFileButton({ onClick }: AddFileButtonProps) {
<div className="border-lightgray/50 h-4 w-[1px] border-y-0 border-l-0 border-r border-solid" />

<ChevronDownIcon className="text-vsc-foreground h-2.5 w-2.5 cursor-pointer px-1 brightness-75 hover:brightness-125" />
</Listbox.Button>
</ListboxButton>

<Listbox.Options className="bg-vsc-editor-background border-lightgray/50 absolute right-0 top-full z-50 mt-1 min-w-fit whitespace-nowrap rounded-md border border-solid px-1 py-0 shadow-lg">
<Listbox.Option
value="addAllFiles"
className="text-vsc-foreground block w-full cursor-pointer px-2 py-1 text-left text-[10px] brightness-75 hover:brightness-125"
>
Add all open files
</Listbox.Option>
</Listbox.Options>
<ListboxOptions className="bg-vsc-editor-background" anchor="top end">
<ListboxOption value="addAllFiles">Add all open files</ListboxOption>
</ListboxOptions>
</div>
</Listbox>
);
Expand Down
Loading
Loading