From 81af9852a83a8d6ce88d54ce5f8bb282acbf331c Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Thu, 18 Sep 2025 17:02:32 -0300 Subject: [PATCH 1/3] feat: add eye to toggle visibility of passwords --- src/components/ui/password-input.tsx | 52 ++++++++++++++++++++++++++++ src/pages/AISettings.tsx | 10 +++--- 2 files changed, 56 insertions(+), 6 deletions(-) create mode 100644 src/components/ui/password-input.tsx diff --git a/src/components/ui/password-input.tsx b/src/components/ui/password-input.tsx new file mode 100644 index 00000000..b5b397d6 --- /dev/null +++ b/src/components/ui/password-input.tsx @@ -0,0 +1,52 @@ +import * as React from "react" +import { Eye, EyeOff } from "lucide-react" +import { cn } from "@/lib/utils" + +export interface PasswordInputProps + extends React.InputHTMLAttributes {} + +const PasswordInput = React.forwardRef( + ({ className, ...props }, ref) => { + const [showPassword, setShowPassword] = React.useState(false) + const [isFocused, setIsFocused] = React.useState(false) + + return ( +
+ { + setIsFocused(true) + props.onFocus?.(e) + }} + onBlur={(e) => { + setIsFocused(false) + props.onBlur?.(e) + }} + {...props} + /> + +
+ ) + } +) +PasswordInput.displayName = "PasswordInput" + +export { PasswordInput } diff --git a/src/pages/AISettings.tsx b/src/pages/AISettings.tsx index e7f7cabf..61810ad4 100644 --- a/src/pages/AISettings.tsx +++ b/src/pages/AISettings.tsx @@ -2,6 +2,7 @@ import { useState } from 'react'; import { Check, Bot, ArrowLeft, Trash2 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; +import { PasswordInput } from '@/components/ui/password-input'; import { Label } from '@/components/ui/label'; import { Separator } from '@/components/ui/separator'; import { Badge } from '@/components/ui/badge'; @@ -245,9 +246,8 @@ export function AISettings() { {!provider?.nostr && (
- handleUpdateProvider(providerId, { apiKey: e.target.value })} @@ -286,9 +286,8 @@ export function AISettings() {
{!preset.nostr && ( - setPresetApiKeys(prev => ({ @@ -368,9 +367,8 @@ export function AISettings() { {customAuthMethod === 'api-key' && (
- setCustomApiKey(e.target.value)} From 1aafb67cbdf58662b2f9be1142e8039994721fdb Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Thu, 18 Sep 2025 17:06:40 -0300 Subject: [PATCH 2/3] fix CI eslint complain --- src/components/ui/password-input.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/ui/password-input.tsx b/src/components/ui/password-input.tsx index b5b397d6..e2a50b0f 100644 --- a/src/components/ui/password-input.tsx +++ b/src/components/ui/password-input.tsx @@ -2,10 +2,7 @@ import * as React from "react" import { Eye, EyeOff } from "lucide-react" import { cn } from "@/lib/utils" -export interface PasswordInputProps - extends React.InputHTMLAttributes {} - -const PasswordInput = React.forwardRef( +const PasswordInput = React.forwardRef>( ({ className, ...props }, ref) => { const [showPassword, setShowPassword] = React.useState(false) const [isFocused, setIsFocused] = React.useState(false) From aac0d5d32004a5dba55aec65d424da17cb7f80bc Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Thu, 18 Sep 2025 17:28:51 -0300 Subject: [PATCH 3/3] fix test CI --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 14b7efa7..e210e0fe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,9 @@ stages: test: stage: test + variables: + VITE_GITHUB_OAUTH_CLIENT_ID: "********************" + VITE_GITHUB_OAUTH_CLIENT_SECRET: "****************************************" script: - npm run test