From 1c1c2b20b1949713f0fd03a44b9b7381a15d9376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=81=D0=B5=D0=BB=D1=8C?= Date: Mon, 16 Nov 2026 10:52:56 +0500 Subject: [PATCH] =?UTF-8?q?PEP-146:=20a=20form=20button=20cannot=20be=20pr?= =?UTF-8?q?essed=20twice=20while=20its=20action=20runs;=20a=20repeated=20?= =?UTF-8?q?=C2=AB=D0=9F=D0=BE=D0=BA=D0=B0=D0=B7=D0=B0=D1=82=D1=8C=20=D0=B2?= =?UTF-8?q?=D1=81=D0=B5=D0=BC=C2=BB=20returns=20the=20running=20update=20i?= =?UTF-8?q?nstead=20of=20an=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.2 --- apps/web/components/ui/button.tsx | 3 ++- apps/web/components/ui/form-button.tsx | 16 ++++++++++++++++ packages/runner/src/deploy.ts | 4 +++- packages/shared/src/i18n/en/runner.ts | 1 - packages/shared/src/i18n/kk/runner.ts | 1 - packages/testkit/test/deploy.test.ts | 6 +++++- 6 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 apps/web/components/ui/form-button.tsx diff --git a/apps/web/components/ui/button.tsx b/apps/web/components/ui/button.tsx index 24b1aa75..d54c76a8 100644 --- a/apps/web/components/ui/button.tsx +++ b/apps/web/components/ui/button.tsx @@ -2,6 +2,7 @@ import * as React from "react"; import { Slot } from "@radix-ui/react-slot"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/lib/utils"; +import { FormButton } from "./form-button"; const buttonVariants = cva( "inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-md border border-transparent text-sm font-medium transition-colors outline-none hover:no-underline focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 cursor-pointer", @@ -35,7 +36,7 @@ function Button({ asChild = false, ...props }: React.ComponentProps<"button"> & VariantProps & { asChild?: boolean }) { - const Comp = asChild ? Slot : "button"; + const Comp = asChild ? Slot : FormButton; return ; } diff --git a/apps/web/components/ui/form-button.tsx b/apps/web/components/ui/form-button.tsx new file mode 100644 index 00000000..dbf35f47 --- /dev/null +++ b/apps/web/components/ui/form-button.tsx @@ -0,0 +1,16 @@ +"use client"; + +import * as React from "react"; +import { useFormStatus } from "react-dom"; + +/** + * PEP-146: the