feat: AI 추천 버튼도 비활성화 제거 + 인라인 검증으로 통일
기존: 제목 미입력 시 'AI 추천' 버튼 비활성화(canRequestAi) 변경: 제출 버튼과 동일 로직 — 버튼 상시 활성(분석 중 in-flight 만 disabled), 클릭 시 제목이 비어 있으면 titleError 로 인라인 안내(빨강 테두리+메시지) 후 중단. 사용 안 하게 된 canRequestAi computed 제거. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -161,11 +161,15 @@ function addItem() {
|
||||
const aiSuggesting = ref(false)
|
||||
const aiSuggestions = ref<ChecklistSuggestionGroup[] | null>(null)
|
||||
const aiError = ref<string | null>(null)
|
||||
const canRequestAi = computed(() => !aiSuggesting.value && title.value.trim().length > 0)
|
||||
|
||||
// 프로젝트 설명 + 제목/내용을 분석해 카테고리별 할 일 추천을 받는다
|
||||
async function requestAiSuggestions() {
|
||||
if (!canRequestAi.value) return
|
||||
if (aiSuggesting.value) return
|
||||
// AI 추천은 제목 기반 — 제목이 비면 인라인 에러로 안내
|
||||
if (title.value.trim().length === 0) {
|
||||
titleError.value = true
|
||||
return
|
||||
}
|
||||
aiSuggesting.value = true
|
||||
aiError.value = null
|
||||
aiSuggestions.value = null
|
||||
@@ -373,7 +377,7 @@ function goBack() {
|
||||
<button
|
||||
class="btn ai"
|
||||
type="button"
|
||||
:disabled="!canRequestAi"
|
||||
:disabled="aiSuggesting"
|
||||
title="프로젝트·업무 내용을 분석해 할 일을 추천합니다"
|
||||
@click="requestAiSuggestions"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user