fix: implement copilot suggestions

This commit is contained in:
Kacper
2025-12-11 02:07:15 +01:00
parent 085f5d5d39
commit 43c90adbc0
7 changed files with 35 additions and 17 deletions

View File

@@ -181,7 +181,6 @@ export function KeyboardMap({ onKeySelect, selectedKey, className }: KeyboardMap
const isModified = shortcuts.some(
(s) => keyboardShortcuts[s] !== DEFAULT_KEYBOARD_SHORTCUTS[s]
);
const hasModifierShortcuts = shortcutInfos.some(s => s.hasModifiers);
// Get category for coloring (use first shortcut's category if multiple)
const category = shortcuts.length > 0 ? SHORTCUT_CATEGORIES[shortcuts[0]] : null;
@@ -193,7 +192,7 @@ export function KeyboardMap({ onKeySelect, selectedKey, className }: KeyboardMap
onClick={() => onKeySelect?.(keyDef.key)}
className={cn(
"relative flex flex-col items-center justify-center rounded-lg border transition-all",
"h-12 min-w-[2.75rem] py-1",
"h-12 min-w-11 py-1",
keyDef.width > 1 && `w-[${keyDef.width * 2.75}rem]`,
// Base styles
!isBound && "bg-sidebar-accent/10 border-sidebar-border hover:bg-sidebar-accent/20",

View File

@@ -1,5 +1,4 @@
import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
import { Settings2, Keyboard } from "lucide-react";
interface KeyboardShortcutsSectionProps {

View File

@@ -780,6 +780,22 @@ function CodexSetupStep({
const [apiKey, setApiKey] = useState("");
const [isSavingKey, setIsSavingKey] = useState(false);
// Normalize CLI auth method strings to our store-friendly values
const mapAuthMethod = (method?: string): CodexAuthStatus["method"] => {
switch (method) {
case "cli_verified":
return "cli_verified";
case "cli_tokens":
return "cli_tokens";
case "auth_file":
return "api_key";
case "env_var":
return "env";
default:
return "none";
}
};
const checkStatus = useCallback(async () => {
console.log("[Codex Setup] Starting status check...");
setIsChecking(true);
@@ -805,13 +821,7 @@ function CodexSetupStep({
setCodexCliStatus(cliStatus);
if (result.auth) {
const method = result.auth.method === "cli_verified" || result.auth.method === "cli_tokens"
? (result.auth.method === "cli_verified" ? "cli_verified" : "cli_tokens")
: result.auth.method === "auth_file"
? "api_key"
: result.auth.method === "env_var"
? "env"
: "none";
const method = mapAuthMethod(result.auth.method);
const authStatus: CodexAuthStatus = {
authenticated: result.auth.authenticated,