Skip to content

refactor(prompt): 모델을 create/detail/feed/shared로 재구성#24

Open
rabitis99 wants to merge 1 commit intodevfrom
feature/prompt-builder
Open

refactor(prompt): 모델을 create/detail/feed/shared로 재구성#24
rabitis99 wants to merge 1 commit intodevfrom
feature/prompt-builder

Conversation

@rabitis99
Copy link
Copy Markdown
Owner

@rabitis99 rabitis99 commented Mar 10, 2026

  • prompt model을 create, detail, feed, shared 하위 폴더로 분리
  • model/index.ts에서 기존 export 유지 (호환성)
  • CreatePromptView, HomeFeedView, PromptDetailView 및 create 스텝 import 경로 정리
  • prompt-builder: usePromptRecommendations, 타입, 페이지/패널 업데이트
  • prompt api, usePromptList, useSearchParamsSync 수정

Made-with: Cursor

Summary by CodeRabbit

릴리스 노트

  • 새로운 기능

    • 프롬프트 추천 시스템 개선으로 더 빠른 응답 제공
    • 의도, 역할, 행동, 톤, 스타일, 언어, 경험 등 다양한 의미론적 설정 옵션 추가
    • 프롬프트 생성 완료 후 성공 확인 화면 추가
  • 개선 사항

    • 더 나은 로딩 상태 관리로 사용 경험 향상
    • 한국어 로컬라이제이션 강화
    • 프롬프트 빌더 네비게이션 개선 (뒤로가기 버튼 추가)
    • 카테고리 선택 UI 개선

- prompt model을 create, detail, feed, shared 하위 폴더로 분리
- model/index.ts에서 기존 export 유지 (호환성)
- CreatePromptView, HomeFeedView, PromptDetailView 및 create 스텝 import 경로 정리
- prompt-builder: usePromptRecommendations, 타입, 페이지/패널 업데이트
- prompt api, usePromptList, useSearchParamsSync 수정

Made-with: Cursor
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
prompts-front Error Error Mar 10, 2026 3:04am

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 10, 2026

개요

프롬프트 빌더 기능의 권장사항 시스템을 강화하고, 의미론적 설정 UI를 개선하며, 모듈 구조를 재조직화했습니다. 레거시 API 제거, 타입 확장, 다국어화(한글) 지원, 그리고 광범위한 임포트 경로 업데이트를 포함합니다.

변경사항

코호트 / 파일(들) 요약
프롬프트 빌더 권장사항 로직
sharedPrompts/my-app/src/features/prompt-builder/model/usePromptRecommendations.ts, sharedPrompts/my-app/src/features/prompt-builder/types/prompt-builder.types.ts
쿼리에 keepPreviousData 추가, 디바운스 입력 조건을 > 0 으로 변경, axis_sources 병합 로직 개선, 권장사항 적용 시 처리 강화. RecommendPromptRequestaction_type, tone, style, language, experience 필드 추가. 새로운 RecommendPromptResponse 인터페이스 추가.
프롬프트 빌더 UI
sharedPrompts/my-app/src/features/prompt-builder/ui/PromptBuilderPage.tsx, sharedPrompts/my-app/src/features/prompt-builder/ui/PromptInputPanel.tsx, sharedPrompts/my-app/src/features/prompt-builder/ui/SemanticSettingsPanel.tsx
한글 다국어화, 백 네비게이션 추가, CreatePromptSuccess 통합, 저장 상태 관리. 카테고리 드롭다운 동적화, 추천 후보 폴백 로직 추가. 의도/역할/액션 표시 이름 매핑 및 지역화 레이어 추가.
프롬프트 API 및 타입
sharedPrompts/my-app/src/features/prompt/api/prompt.api.ts, sharedPrompts/my-app/src/features/prompt/types/prompt.types.ts
레거시 createPromptLegacy() 메서드 및 PromptRequestDto 제거. ActionIntent 확장(CREATION, BRAINSTORM, EDIT 등 새 키 추가). UnifiedGeneratePromptResponse 재설계: intentresolved_intent, 필드명 정규화, 메타데이터 필드 추가(semantic_profiles_applied, validation_warnings 등).
모듈 경로 재조직화
sharedPrompts/my-app/src/features/prompt/hooks/usePromptList.ts, sharedPrompts/my-app/src/features/prompt/hooks/useSearchParamsSync.ts, sharedPrompts/my-app/src/features/prompt/ui/CreatePromptView.tsx, sharedPrompts/my-app/src/features/prompt/ui/HomeFeedView.tsx, sharedPrompts/my-app/src/features/prompt/ui/PromptDetailView.tsx, sharedPrompts/my-app/src/features/prompt/ui/create/*
임포트 경로 업데이트: useCreatePromptView, createPrompt.constantscreate/ 경로로 이동. 공유 모듈들 → shared/ 경로로 이동. feed/ 하위디렉토리 구조 도입.
모듈 재정리 및 인덱싱
sharedPrompts/my-app/src/features/prompt/model/index.ts, sharedPrompts/my-app/src/features/prompt/model/shared/actionRoleDisplayNames.ts, sharedPrompts/my-app/src/features/prompt/model/feed/homeFeed.constants.ts
새로운 중앙 인덱스 파일로 create/detail/feed/shared 모듈들의 내보내기 통합. 불필요한 인라인 주석 제거(기능 변화 없음).
레거시 정리 및 포매팅
sharedPrompts/my-app/src/features/prompt/model/detail/useComments.ts, sharedPrompts/my-app/src/features/prompt/model/detail/usePromptActions.ts, sharedPrompts/my-app/src/features/prompt/model/detail/usePromptDetailView.ts, sharedPrompts/my-app/src/features/prompt/model/detail/useRelatedPrompts.ts, sharedPrompts/my-app/src/features/prompt/model/detail/usePromptDetail.ts, sharedPrompts/my-app/src/features/prompt/model/create/useCreatePromptView.ts, sharedPrompts/my-app/src/features/prompt/model/shared/enumDisplayNames.ts, sharedPrompts/my-app/src/features/prompt/model/shared/enumGuidelines.ts, sharedPrompts/my-app/src/features/prompt/model/feed/useHomeFeedView.ts
후행 공백 제거, 주석 정리, 불필요한 useEffect 블록 제거(URL 동기화 스캐폴딩 제거).
페이지 컴포넌트 업데이트
sharedPrompts/my-app/src/pages/CreatePromptPage.tsx
CreatePromptViewPromptBuilderPage로 렌더링 대상 변경, 한글 설명 주석 추가.

관련 PR 목록

  • PR #23: 동일한 프롬프트 빌더 코드(usePromptRecommendations, 프롬프트 빌더 타입, UI 컴포넌트)를 수정하는 겹치는 변경사항 포함.
  • PR #2: 프롬프트 기능의 타입 및 API 모듈(prompt.types.ts, prompt.api.ts)을 동일하게 수정.
  • PR #21: 프롬프트 타입 표면 및 액션/역할 표시 이름 매핑, 추가 의미론적 옵션 지원을 동일하게 추가.

예상 코드 리뷰 노력

🎯 4 (복잡함) | ⏱️ ~45분

🐰 추천과 설정이 새로운 옷을 입었네,
한글이 불러주고 모듈들이 줄을 섰네,
레거시는 멀리 가고, 경로들은 정렬되고,
빌더 페이지가 무대에 올랐네!
의미론적 향기가 코드 숲에 피었어요.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 변경 사항의 주요 내용을 정확하게 요약하고 있습니다. 'refactor(prompt): 모델을 create/detail/feed/shared로 재구성'은 전체 PR의 핵심 목표인 prompt 모델 구조 재정렬을 명확하게 설명하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/prompt-builder

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
sharedPrompts/my-app/src/features/prompt/model/detail/useRelatedPrompts.ts (1)

16-35: ⚠️ Potential issue | 🟡 Minor

새 프롬프트로 이동하거나 요청이 실패할 때 이전 연관 프롬프트 데이터가 남아있습니다.

현재 코드는 prompt가 유효한 경우 fetch를 시작해도 기존 relatedPrompts 상태를 초기화하지 않아서, 프롬프트 전환 시 이전 데이터가 새 요청이 완료될 때까지 표시됩니다. 또한 요청 실패 시에도 상태를 초기화하지 않아 오래된 데이터가 계속 노출될 수 있습니다. 요청 시작 시점과 에러 발생 시 상태를 초기화해 두는 편이 안전합니다.

🔧 제안 수정안
   useEffect(() => {
     if (!prompt?.prompt_category || prompt?.id == null) {
       setRelatedPrompts([]);
       return;
     }

     let cancelled = false;
+    setRelatedPrompts([]);

     const fetchRelatedPrompts = async () => {
       try {
         const response = await promptApi.getPrompts({
           page: 0,
@@
         if (!cancelled) {
           setRelatedPrompts(related);
         }
       } catch (err) {
         if (!cancelled) {
+          setRelatedPrompts([]);
           console.error('Failed to fetch related prompts:', err);
         }
       }
     };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sharedPrompts/my-app/src/features/prompt/model/detail/useRelatedPrompts.ts`
around lines 16 - 35, The fetchRelatedPrompts function leaves previous
relatedPrompts visible while a new request runs or when a request fails; to fix
this, call setRelatedPrompts([]) at the start of fetchRelatedPrompts (before the
API call) to clear old data and also call setRelatedPrompts([]) in the catch
block when !cancelled to clear state on error; ensure you still respect the
cancelled flag and only update state when cancelled is false, and keep
references to prompt.prompt_category and prompt.id as in the existing
fetchRelatedPrompts logic.
sharedPrompts/my-app/src/features/prompt/model/detail/useComments.ts (1)

34-104: ⚠️ Potential issue | 🟠 Major

promptId가 바뀔 때 이전 댓글 응답이 현재 화면 상태를 덮어쓸 수 있습니다.

이 effect는 fetchComments()와 내부 checkCommentLikes() 모두에 취소 가드가 없어서, 상세 페이지를 빠르게 이동하면 늦게 도착한 이전 요청이 comments/likedComments를 새 프롬프트 기준 상태로 잘못 덮어쓸 수 있습니다. promptId 변경 시 상태 초기화와 cleanup guard를 같이 두는 편이 안전합니다. (같은 패턴이 useRelatedPrompts.ts에서 이미 적용되어 있습니다.)

🔧 제안 수정안
   useEffect(() => {
-    if (!promptId) return;
+    if (!promptId) {
+      setComments([]);
+      setLikedComments([]);
+      return;
+    }
+
+    let cancelled = false;
+    setComments([]);
+    setLikedComments([]);

     const fetchComments = async () => {
       try {
         const response = await commentApi.getComments(promptId);
         const commentsData = response.data.data;
@@
-        setComments(structuredComments);
+        if (cancelled) return;
+        setComments(structuredComments);
@@
-            setLikedComments(likedIds);
+            if (!cancelled) {
+              setLikedComments(likedIds);
+            }
           } catch (err) {
             console.error('Failed to check comment like statuses:', err);
-            setLikedComments([]);
+            if (!cancelled) {
+              setLikedComments([]);
+            }
           }
         };

         checkCommentLikes();
       } catch (err) {
-        console.error('Failed to fetch comments:', err);
+        if (!cancelled) {
+          console.error('Failed to fetch comments:', err);
+        }
       }
     };

     fetchComments();
+    return () => {
+      cancelled = true;
+    };
   }, [promptId]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sharedPrompts/my-app/src/features/prompt/model/detail/useComments.ts` around
lines 34 - 104, When promptId changes the async fetchComments and its inner
checkCommentLikes can resolve after a newer promptId is active and overwrite
state; update the useEffect around fetchComments to (1) reset comments and
likedComments immediately when promptId changes, (2) add a cancellation guard
(e.g., let cancelled = false or an AbortController) that you check before
calling setComments and setLikedComments inside fetchComments and
checkCommentLikes, and (3) return a cleanup function that sets cancelled = true
(or aborts the controller) so late responses are ignored; modify the existing
functions fetchComments and checkCommentLikes to bail out when cancelled before
calling setComments/setLikedComments.
sharedPrompts/my-app/src/features/prompt-builder/ui/SemanticSettingsPanel.tsx (1)

85-91: ⚠️ Potential issue | 🟡 Minor

overrides prop이 destructure되지 않음

overrides가 인터페이스에서 required prop으로 선언되어 있고 PromptBuilderPage에서 전달하지만, 컴포넌트에서 destructure되지 않아 사용되지 않습니다. 사용자가 직접 선택한 값을 시각적으로 표시하는 데 사용해야 할 것 같습니다.

🔧 수정 제안
 export const SemanticSettingsPanel: React.FC<SemanticSettingsPanelProps> = ({
   selectedAxes,
+  overrides,
   axisSources,
   candidates = {},
   onUpdateField,
   isLoading,
 }) => {

그 후 overrides[id]를 사용하여 사용자가 직접 수정한 필드를 시각적으로 구분할 수 있습니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@sharedPrompts/my-app/src/features/prompt-builder/ui/SemanticSettingsPanel.tsx`
around lines 85 - 91, The SemanticSettingsPanel component currently accepts an
overrides prop in its SemanticSettingsPanelProps but does not destructure or use
it; update the component signature to destructure overrides alongside
selectedAxes, axisSources, candidates, onUpdateField, and isLoading, then use
overrides (e.g. overrides[id]) where fields are rendered to visually indicate
user-modified values (for example, apply a special class or marker when
overrides[id] exists) so PromptBuilderPage-provided overrides are respected and
shown in the UI.
🧹 Nitpick comments (6)
sharedPrompts/my-app/src/features/prompt-builder/ui/PromptInputPanel.tsx (1)

2-2: 미사용 import: PromptCategory

PromptCategory 타입이 import되었지만 컴포넌트 내에서 사용되지 않습니다. PROMPT_CATEGORY_DISPLAY_NAMES만 사용됩니다.

♻️ 제안
-import { PromptCategory, PROMPT_CATEGORY_DISPLAY_NAMES } from '@/features/prompt/types/prompt.types';
+import { PROMPT_CATEGORY_DISPLAY_NAMES } from '@/features/prompt/types/prompt.types';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sharedPrompts/my-app/src/features/prompt-builder/ui/PromptInputPanel.tsx` at
line 2, The import statement brings in an unused type PromptCategory; remove
PromptCategory from the import so only PROMPT_CATEGORY_DISPLAY_NAMES is imported
(update the import in PromptInputPanel.tsx to import
PROMPT_CATEGORY_DISPLAY_NAMES from '@/features/prompt/types/prompt.types' and
ensure no other references to PromptCategory remain).
sharedPrompts/my-app/src/features/prompt/model/feed/useHomeFeedView.ts (1)

69-79: 선택 사항: 중복된 useEffect 블록 통합 고려

두 개의 useEffect가 동일한 작업(페이지네이션 리셋)을 수행합니다. 의미적으로 분리된 트리거(필터 변경 vs 검색어 변경)이지만, 하나로 통합할 수 있습니다.

♻️ 통합 제안
-  useEffect(() => {
-    setPage(0);
-    setPrompts([]);
-    setLikedIds([]);
-  }, [selectedDomain, sortBy, setPrompts, setLikedIds]);
-
-  useEffect(() => {
-    setPage(0);
-    setPrompts([]);
-    setLikedIds([]);
-  }, [debouncedSearchQuery, setPrompts, setLikedIds]);
+  useEffect(() => {
+    setPage(0);
+    setPrompts([]);
+    setLikedIds([]);
+  }, [selectedDomain, sortBy, debouncedSearchQuery, setPrompts, setLikedIds]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sharedPrompts/my-app/src/features/prompt/model/feed/useHomeFeedView.ts`
around lines 69 - 79, The two useEffect blocks that reset pagination (calling
setPage, setPrompts, setLikedIds) are duplicated; consolidate them into a single
useEffect so the same reset logic runs when any trigger changes—include
selectedDomain, sortBy, and debouncedSearchQuery (and the setter functions
setPrompts, setLikedIds) in the dependency array; update the existing
useEffect(s) referencing those symbols so there is one unified reset handler
instead of two nearly identical effects.
sharedPrompts/my-app/src/features/prompt-builder/ui/PromptBuilderPage.tsx (2)

108-109: 언어 일관성 확인

헤더 제목 "AI Prompt Builder"와 설명이 영어로 작성되어 있으나, 다른 UI 요소들은 한국어입니다. 의도적인 브랜딩이라면 괜찮지만, 일관성이 필요하다면 한국어로 변경을 고려해주세요.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sharedPrompts/my-app/src/features/prompt-builder/ui/PromptBuilderPage.tsx`
around lines 108 - 109, The header text in PromptBuilderPage ("AI Prompt
Builder" and the following <p> description) is in English while the rest of the
UI is Korean; update the literal strings in the PromptBuilderPage component (the
<h1> with text "AI Prompt Builder" and the <p> with the English description) to
Korean for consistency (e.g., "AI 프롬프트 빌더" or "AI 프롬프트 생성기" and a matching
Korean sentence), or if the English is intentional as branding, add a comment
documenting that choice and keep both strings as-is; locate these literals in
the PromptBuilderPage component and change only the displayed text (no logic
changes).

44-44: Deprecated intent 필터링 - 상수로 추출 권장

ActionIntent 열거형에서 DEBUG, DESIGN, CODE는 명시적으로 "DEPRECATED (FOR FALLBACK)"로 표시되어 있습니다. 현재 필터링은 의도적이고 적절하며, 이 값들의 목적이 명확하게 문서화되어 있습니다.

다만 유지보수 명확성을 위해 이 3개 값을 별도 상수로 추출하는 것을 선택적으로 권장합니다:

const DEPRECATED_INTENTS = ['DEBUG', 'DESIGN', 'CODE'];
const fallbackIntents = Object.values(ActionIntent).filter(i => !DEPRECATED_INTENTS.includes(i));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@sharedPrompts/my-app/src/features/prompt-builder/ui/PromptBuilderPage.tsx` at
line 44, Extract the three deprecated intent strings into a named constant and
use it in the filter to improve clarity and maintainability: create a constant
(e.g., DEPRECATED_INTENTS) containing 'DEBUG', 'DESIGN', 'CODE' and update the
existing fallbackIntents declaration to filter Object.values(ActionIntent) by
checking !DEPRECATED_INTENTS.includes(i). Reference ActionIntent and
fallbackIntents when making the change so the intent set and filtering remain
consistent.
sharedPrompts/my-app/src/features/prompt-builder/ui/SemanticSettingsPanel.tsx (1)

74-83: as any 타입 단언에 대한 선택적 개선

as any 단언이 타입 안전성을 우회합니다. 동적 id 문자열을 처리하기 위한 현실적인 접근이지만, 타입 안전성을 원한다면 다음과 같이 개선할 수 있습니다.

♻️ 타입 안전한 대안
const DISPLAY_NAME_MAPS: Record<string, Record<string, string>> = {
  intent: INTENT_DISPLAY_NAMES_KO,
  actionType: ACTION_TYPE_DISPLAY_NAMES_KO,
  roleType: ROLE_TYPE_DISPLAY_NAMES_KO,
  tone: TONE_DISPLAY_NAMES,
  style: STYLE_DISPLAY_NAMES,
  language: LANGUAGE_DISPLAY_NAMES,
  experience: EXPERIENCE_DISPLAY_NAMES,
};

const getDisplayLabel = (id: string, opt: string): string => {
  return DISPLAY_NAME_MAPS[id]?.[opt] || opt;
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@sharedPrompts/my-app/src/features/prompt-builder/ui/SemanticSettingsPanel.tsx`
around lines 74 - 83, Replace the ad-hoc "as any" assertions in getDisplayLabel
with a typed lookup map: define a DISPLAY_NAME_MAPS constant typed as
Record<string, Record<string, string>> that maps the ids (intent, actionType,
roleType, tone, style, language, experience) to their respective display-name
objects, then update getDisplayLabel to return DISPLAY_NAME_MAPS[id]?.[opt] ||
opt and give getDisplayLabel an explicit string return type; remove all "as any"
casts (refer to getDisplayLabel and the new DISPLAY_NAME_MAPS symbol).
sharedPrompts/my-app/src/features/prompt-builder/types/prompt-builder.types.ts (1)

2-13: 요청 DTO는 공용 enum/union을 재사용해서 계약을 좁혀주세요.

지금처럼 request_mode, category, intent, tone, style, language, experience를 전부 string으로 두면 잘못된 값도 컴파일을 통과해서 prompt.types.ts와 쉽게 드리프트합니다. 이미 있는 RequestTypeValue, PromptCategory, ActionIntent, ToneType, StyleType, LanguageType, ExperienceLevel를 그대로 재사용하는 편이 안전합니다.

타입 정렬 예시
+import type {
+  ActionIntent,
+  ExperienceLevel,
+  LanguageType,
+  PromptCategory,
+  RequestTypeValue,
+  StyleType,
+  ToneType,
+} from '@/features/prompt/types/prompt.types';
+
 export interface RecommendPromptRequest {
-  request_mode: string; // RequestMode: SIMPLE | EXTRACTION | ADVANCED
-  category?: string;
-  intent?: string;
+  request_mode: RequestTypeValue;
+  category?: PromptCategory;
+  intent?: ActionIntent;
   role_type?: string;
   action_type?: string;
-  tone?: string;
-  style?: string;
-  language?: string;
-  experience?: string;
+  tone?: ToneType;
+  style?: StyleType;
+  language?: LanguageType;
+  experience?: ExperienceLevel;
   raw_input: string;
 }
 
 export interface ConfirmedGeneratePromptRequest {
-  request_mode: string;
-  category: string;
-  intent: string;
+  request_mode: RequestTypeValue;
+  category: PromptCategory;
+  intent: ActionIntent;
   role_type?: string;
   action_type?: string;
-  tone?: string;
-  style?: string;
-  language?: string;
-  experience?: string;
+  tone?: ToneType;
+  style?: StyleType;
+  language?: LanguageType;
+  experience?: ExperienceLevel;
   input: string;
   json_schema?: string;
   title?: string;

Also applies to: 35-49

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@sharedPrompts/my-app/src/features/prompt-builder/types/prompt-builder.types.ts`
around lines 2 - 13, Update the RecommendPromptRequest DTO to tighten types by
replacing loose string types with the existing shared unions/enums: use
RequestTypeValue for request_mode, PromptCategory for category, ActionIntent for
intent, ToneType for tone, StyleType for style, LanguageType for language, and
ExperienceLevel for experience; keep raw_input as string and ensure the same
replacements are applied to the other similar DTO block referenced (the one that
corresponds to lines 35-49) so the interface names and property names
(RecommendPromptRequest, request_mode, category, intent, tone, style, language,
experience) reference the centralized types rather than plain string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@sharedPrompts/my-app/src/features/prompt-builder/ui/SemanticSettingsPanel.tsx`:
- Around line 85-91: The SemanticSettingsPanel component currently accepts an
overrides prop in its SemanticSettingsPanelProps but does not destructure or use
it; update the component signature to destructure overrides alongside
selectedAxes, axisSources, candidates, onUpdateField, and isLoading, then use
overrides (e.g. overrides[id]) where fields are rendered to visually indicate
user-modified values (for example, apply a special class or marker when
overrides[id] exists) so PromptBuilderPage-provided overrides are respected and
shown in the UI.

In `@sharedPrompts/my-app/src/features/prompt/model/detail/useComments.ts`:
- Around line 34-104: When promptId changes the async fetchComments and its
inner checkCommentLikes can resolve after a newer promptId is active and
overwrite state; update the useEffect around fetchComments to (1) reset comments
and likedComments immediately when promptId changes, (2) add a cancellation
guard (e.g., let cancelled = false or an AbortController) that you check before
calling setComments and setLikedComments inside fetchComments and
checkCommentLikes, and (3) return a cleanup function that sets cancelled = true
(or aborts the controller) so late responses are ignored; modify the existing
functions fetchComments and checkCommentLikes to bail out when cancelled before
calling setComments/setLikedComments.

In `@sharedPrompts/my-app/src/features/prompt/model/detail/useRelatedPrompts.ts`:
- Around line 16-35: The fetchRelatedPrompts function leaves previous
relatedPrompts visible while a new request runs or when a request fails; to fix
this, call setRelatedPrompts([]) at the start of fetchRelatedPrompts (before the
API call) to clear old data and also call setRelatedPrompts([]) in the catch
block when !cancelled to clear state on error; ensure you still respect the
cancelled flag and only update state when cancelled is false, and keep
references to prompt.prompt_category and prompt.id as in the existing
fetchRelatedPrompts logic.

---

Nitpick comments:
In
`@sharedPrompts/my-app/src/features/prompt-builder/types/prompt-builder.types.ts`:
- Around line 2-13: Update the RecommendPromptRequest DTO to tighten types by
replacing loose string types with the existing shared unions/enums: use
RequestTypeValue for request_mode, PromptCategory for category, ActionIntent for
intent, ToneType for tone, StyleType for style, LanguageType for language, and
ExperienceLevel for experience; keep raw_input as string and ensure the same
replacements are applied to the other similar DTO block referenced (the one that
corresponds to lines 35-49) so the interface names and property names
(RecommendPromptRequest, request_mode, category, intent, tone, style, language,
experience) reference the centralized types rather than plain string.

In `@sharedPrompts/my-app/src/features/prompt-builder/ui/PromptBuilderPage.tsx`:
- Around line 108-109: The header text in PromptBuilderPage ("AI Prompt Builder"
and the following <p> description) is in English while the rest of the UI is
Korean; update the literal strings in the PromptBuilderPage component (the <h1>
with text "AI Prompt Builder" and the <p> with the English description) to
Korean for consistency (e.g., "AI 프롬프트 빌더" or "AI 프롬프트 생성기" and a matching
Korean sentence), or if the English is intentional as branding, add a comment
documenting that choice and keep both strings as-is; locate these literals in
the PromptBuilderPage component and change only the displayed text (no logic
changes).
- Line 44: Extract the three deprecated intent strings into a named constant and
use it in the filter to improve clarity and maintainability: create a constant
(e.g., DEPRECATED_INTENTS) containing 'DEBUG', 'DESIGN', 'CODE' and update the
existing fallbackIntents declaration to filter Object.values(ActionIntent) by
checking !DEPRECATED_INTENTS.includes(i). Reference ActionIntent and
fallbackIntents when making the change so the intent set and filtering remain
consistent.

In `@sharedPrompts/my-app/src/features/prompt-builder/ui/PromptInputPanel.tsx`:
- Line 2: The import statement brings in an unused type PromptCategory; remove
PromptCategory from the import so only PROMPT_CATEGORY_DISPLAY_NAMES is imported
(update the import in PromptInputPanel.tsx to import
PROMPT_CATEGORY_DISPLAY_NAMES from '@/features/prompt/types/prompt.types' and
ensure no other references to PromptCategory remain).

In
`@sharedPrompts/my-app/src/features/prompt-builder/ui/SemanticSettingsPanel.tsx`:
- Around line 74-83: Replace the ad-hoc "as any" assertions in getDisplayLabel
with a typed lookup map: define a DISPLAY_NAME_MAPS constant typed as
Record<string, Record<string, string>> that maps the ids (intent, actionType,
roleType, tone, style, language, experience) to their respective display-name
objects, then update getDisplayLabel to return DISPLAY_NAME_MAPS[id]?.[opt] ||
opt and give getDisplayLabel an explicit string return type; remove all "as any"
casts (refer to getDisplayLabel and the new DISPLAY_NAME_MAPS symbol).

In `@sharedPrompts/my-app/src/features/prompt/model/feed/useHomeFeedView.ts`:
- Around line 69-79: The two useEffect blocks that reset pagination (calling
setPage, setPrompts, setLikedIds) are duplicated; consolidate them into a single
useEffect so the same reset logic runs when any trigger changes—include
selectedDomain, sortBy, and debouncedSearchQuery (and the setter functions
setPrompts, setLikedIds) in the dependency array; update the existing
useEffect(s) referencing those symbols so there is one unified reset handler
instead of two nearly identical effects.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7c060b80-52d8-42bb-9b21-43773fd35c0a

📥 Commits

Reviewing files that changed from the base of the PR and between 235250e and 6696f75.

⛔ Files ignored due to path filters (1)
  • sharedPrompts/my-app/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (36)
  • sharedPrompts/my-app/src/features/prompt-builder/model/usePromptRecommendations.ts
  • sharedPrompts/my-app/src/features/prompt-builder/types/prompt-builder.types.ts
  • sharedPrompts/my-app/src/features/prompt-builder/ui/PromptBuilderPage.tsx
  • sharedPrompts/my-app/src/features/prompt-builder/ui/PromptInputPanel.tsx
  • sharedPrompts/my-app/src/features/prompt-builder/ui/SemanticSettingsPanel.tsx
  • sharedPrompts/my-app/src/features/prompt/api/prompt.api.ts
  • sharedPrompts/my-app/src/features/prompt/hooks/usePromptList.ts
  • sharedPrompts/my-app/src/features/prompt/hooks/useSearchParamsSync.ts
  • sharedPrompts/my-app/src/features/prompt/model/create/createPrompt.constants.ts
  • sharedPrompts/my-app/src/features/prompt/model/create/useCreatePromptView.ts
  • sharedPrompts/my-app/src/features/prompt/model/detail/useComments.ts
  • sharedPrompts/my-app/src/features/prompt/model/detail/usePromptActions.ts
  • sharedPrompts/my-app/src/features/prompt/model/detail/usePromptDetail.ts
  • sharedPrompts/my-app/src/features/prompt/model/detail/usePromptDetailView.ts
  • sharedPrompts/my-app/src/features/prompt/model/detail/useRelatedPrompts.ts
  • sharedPrompts/my-app/src/features/prompt/model/feed/homeFeed.constants.ts
  • sharedPrompts/my-app/src/features/prompt/model/feed/useHomeFeedView.ts
  • sharedPrompts/my-app/src/features/prompt/model/index.ts
  • sharedPrompts/my-app/src/features/prompt/model/shared/actionRoleDisplayNames.ts
  • sharedPrompts/my-app/src/features/prompt/model/shared/enumDisplayNames.ts
  • sharedPrompts/my-app/src/features/prompt/model/shared/enumGuidelines.ts
  • sharedPrompts/my-app/src/features/prompt/types/prompt.types.ts
  • sharedPrompts/my-app/src/features/prompt/ui/CreatePromptView.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/HomeFeedView.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/PromptDetailView.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/AdvancedOptionsStep.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/BodyStep.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/DomainStep.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/InputStep.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/JsonSchemaStep.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/LanguageStep.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/PublicStep.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/RequestTypeStep.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/TagsStep.tsx
  • sharedPrompts/my-app/src/features/prompt/ui/create/TitleStep.tsx
  • sharedPrompts/my-app/src/pages/CreatePromptPage.tsx
💤 Files with no reviewable changes (8)
  • sharedPrompts/my-app/src/features/prompt/model/detail/usePromptDetail.ts
  • sharedPrompts/my-app/src/features/prompt/model/create/useCreatePromptView.ts
  • sharedPrompts/my-app/src/features/prompt/model/shared/enumGuidelines.ts
  • sharedPrompts/my-app/src/features/prompt/model/shared/enumDisplayNames.ts
  • sharedPrompts/my-app/src/features/prompt/api/prompt.api.ts
  • sharedPrompts/my-app/src/features/prompt/model/create/createPrompt.constants.ts
  • sharedPrompts/my-app/src/features/prompt/model/detail/usePromptDetailView.ts
  • sharedPrompts/my-app/src/features/prompt/model/shared/actionRoleDisplayNames.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant