Skip to content

Commit

Permalink
feat: disable VS Code button until runtime is ready
Browse files Browse the repository at this point in the history
- Add disabled state when AgentState is INIT or LOADING
- Show grayed out button with not-allowed cursor when disabled
- Keep standard blue styling when enabled
  • Loading branch information
openhands-agent committed Nov 9, 2024
1 parent e16f250 commit 0fddc96
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion frontend/src/components/file-explorer/FileExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,17 @@ function FileExplorer({ error, isOpen, onToggle }: FileExplorerProps) {
<button
type="button"
onClick={handleVSCodeClick}
className="mt-auto mb-2 w-full h-10 bg-[#4465DB] hover:bg-[#3451C7] text-white rounded flex items-center justify-center gap-2 transition-colors"
disabled={
curAgentState === AgentState.INIT ||
curAgentState === AgentState.LOADING
}
className={twMerge(
"mt-auto mb-2 w-full h-10 text-white rounded flex items-center justify-center gap-2 transition-colors",
curAgentState === AgentState.INIT ||
curAgentState === AgentState.LOADING
? "bg-neutral-600 cursor-not-allowed"
: "bg-[#4465DB] hover:bg-[#3451C7]",
)}
aria-label="Open in VS Code"
>
<VSCodeIcon width={20} height={20} />
Expand Down

0 comments on commit 0fddc96

Please sign in to comment.