From eb2bd8f10fff03bb724687b258310eae8ab91d8e Mon Sep 17 00:00:00 2001 From: syc0123 Date: Tue, 3 Mar 2026 14:54:41 +0900 Subject: [PATCH] feat: Enhance modal button behavior and validation feedback - Updated modal button handling to disable all buttons by default, with exceptions for specific button types (e.g., cancel, close, delete). - Introduced a new validation mechanism that visually indicates empty required fields with red borders and error messages after a delay. - Improved the `useDialogAutoValidation` hook to manage button states based on field validation, ensuring a smoother user experience. - Added CSS animations to prevent flickering during validation state changes. Made-with: Cursor --- .../ycshin-node/필수입력항목_자동검증_설계.md | 70 +++--- frontend/app/globals.css | 39 ++++ .../screen/InteractiveScreenViewerDynamic.tsx | 2 + frontend/components/ui/dialog.tsx | 10 +- frontend/components/v2/V2Select.tsx | 5 +- frontend/lib/hooks/useDialogAutoValidation.ts | 215 ++++++++++++------ .../ButtonPrimaryComponent.tsx | 1 + 7 files changed, 236 insertions(+), 106 deletions(-) diff --git a/docs/ycshin-node/필수입력항목_자동검증_설계.md b/docs/ycshin-node/필수입력항목_자동검증_설계.md index 3fc764eb..6f1fc6da 100644 --- a/docs/ycshin-node/필수입력항목_자동검증_설계.md +++ b/docs/ycshin-node/필수입력항목_자동검증_설계.md @@ -30,14 +30,20 @@ │ │ │ │ └─ 3단계: 버튼 비활성화 │ │ │ │ -│ ├─ 대상: data-variant="default" 인 버튼 │ -│ │ (저장, 등록, 수정, 확인 등 — variant 미지정 = default) │ +│ ├─ 기본: 모달 내 모든 ` (data-variant="default") | shadcn 기본 버튼 | +| `