chore: commit local changes

This commit is contained in:
Douglasymlai 2025-10-17 10:44:45 +01:00
parent 132d6a20c5
commit fd87f1f11c
5 changed files with 43 additions and 8 deletions

View file

@ -292,10 +292,11 @@ function HeaderWin() {
<Button
onClick={exportLog}
variant="ghost"
size="icon"
className="no-drag leading-tight"
size="xs"
className="no-drag"
>
<FileDown className="w-4 h-4" />
{t("layout.report-bug")}
</Button>
</TooltipSimple>
</>
@ -304,7 +305,7 @@ function HeaderWin() {
<Button
onClick={getReferFriendsLink}
variant="ghost"
size="icon"
size="xs"
className="no-drag"
>
<img
@ -312,6 +313,7 @@ function HeaderWin() {
alt="gift-icon"
className="w-4 h-4"
/>
{t("layout.refer-friends")}
</Button>
</TooltipSimple>
{chatStore.activeTaskId &&
@ -338,10 +340,11 @@ function HeaderWin() {
<Button
onClick={() => setEndDialogOpen(true)}
variant="outline"
size="icon"
size="xs"
className="no-drag !text-text-cuation w-10 justify-center"
>
<Power />
{t("layout.end-project")}
</Button>
</TooltipSimple>
)}

View file

@ -374,7 +374,7 @@ export function Node({ id, data }: NodeProps) {
<Button
variant="ghost"
size="sm"
className="w-full justify-start gap-2 bg-specialty-menutabs-default group hover:bg-surface-cuation text-text-primary hover:text-text-cuation-default"
className="w-full justify-start gap-2"
onClick={(e) => {
e.stopPropagation();
const newWorkerList = workerList.filter(

View file

@ -19,6 +19,7 @@ type BaseInputProps = Omit<React.ComponentProps<"input">, "size"> & {
backIcon?: React.ReactNode
onBackIconClick?: () => void
trailingButton?: React.ReactNode
onEnter?: () => void
}
const sizeClasses: Record<InputSize, string> = {
@ -92,10 +93,12 @@ const Input = React.forwardRef<HTMLInputElement, BaseInputProps>(
trailingButton,
disabled,
placeholder,
onEnter,
...props
},
ref
) => {
const { onKeyDown, ...inputProps } = props
const stateCls = resolveStateClasses(disabled ? "disabled" : state)
const hasLeft = Boolean(leadingIcon)
const hasRight = Boolean(backIcon) || Boolean(trailingButton)
@ -142,7 +145,13 @@ const Input = React.forwardRef<HTMLInputElement, BaseInputProps>(
hasRight ? "pr-9" : "pr-3",
className
)}
{...props}
onKeyDown={(e) => {
if (e.key === "Enter") {
onEnter?.()
}
onKeyDown?.(e)
}}
{...inputProps}
/>
{backIcon ? (

View file

@ -21,6 +21,7 @@ type BaseTextareaProps = Omit<React.ComponentProps<"textarea">, "size"> & {
backIcon?: React.ReactNode
onBackIconClick?: () => void
trailingButton?: React.ReactNode
onEnter?: () => void
}
const sizeClasses: Record<TextareaSize, string> = {
@ -95,10 +96,12 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, BaseTextareaProps>(
disabled,
placeholder,
style,
onEnter,
...props
},
ref
) => {
const { onKeyDown, ...textareaProps } = props
// Original "none" variant - keep the original styling
if (variant === "none") {
return (
@ -111,7 +114,16 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, BaseTextareaProps>(
)}
style={{ paddingRight: "4px", ...(style as React.CSSProperties) }}
ref={ref}
{...props}
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
if (onEnter) {
e.preventDefault()
onEnter()
}
}
onKeyDown?.(e)
}}
{...textareaProps}
/>
<style>{`
/* Firefox */
@ -177,7 +189,16 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, BaseTextareaProps>(
className
)}
style={{ paddingRight: "4px", ...(style as React.CSSProperties) }}
{...props}
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
if (onEnter) {
e.preventDefault()
onEnter()
}
}
onKeyDown?.(e)
}}
{...textareaProps}
/>
{backIcon ? (

View file

@ -277,6 +277,7 @@ export default function Login() {
onChange={(e) => handleInputChange("email", e.target.value)}
state={errors.email ? "error" : undefined}
note={errors.email}
onEnter={handleLogin}
/>
<Input
@ -294,6 +295,7 @@ export default function Login() {
note={errors.password}
backIcon={<img src={hidePassword ? eye : eyeOff} />}
onBackIconClick={() => setHidePassword(!hidePassword)}
onEnter={handleLogin}
/>
</div>
</div>