Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/features/experience-detail/config/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const EXPERIENCE_MESSAGES = {
SAVE_FAILED: "경험 저장에 실패했습니다. 다시 시도해주세요",
DELETE_FAILED: "경험 삭제에 실패했습니다. 다시 시도해주세요",
DEFAULT_SETTING_FAILED: "기본 경험 설정에 실패했습니다",
FETCH_FAILED: "경험 데이터를 불러오는데 실패했습니다.",
},

SUCCESS: {
Expand Down
3 changes: 3 additions & 0 deletions src/features/experience-detail/model/use-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ export const useExperienceSubmit = () => {
});

const submit = useCallback(async () => {
const { isSubmitting } = useExperienceDetailStore.getState();
if (isSubmitting) return;

const result = validateExperienceDraft(draft);

if (!result.ok) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
useExperienceHeaderActions,
} from "../../model/use-actions";
import { useExperienceDateField } from "../../model/use-experience-date-field";
import { useExperienceDetailStore } from "../../store/experience.store";
import {
useExperienceActions,
useExperienceDraft,
Expand All @@ -22,6 +23,7 @@ import type { TextfieldType } from "@/shared/ui/textfield/textfield";
const ExperienceForm = () => {
const draft = useExperienceDraft();
const isDraftDefault = useIsDraftDefault();
const isSubmitting = useExperienceDetailStore((s) => s.isSubmitting);
const { setDraftField } = useExperienceActions();

const { onToggleDefault } = useExperienceHeaderActions();
Expand All @@ -36,7 +38,7 @@ const ExperienceForm = () => {
isDefault={isDraftDefault}
onToggle={onToggleDefault}
rightSlot={
<Button variant="primary" size="small" onClick={submit}>
<Button variant="primary" size="small" onClick={submit} disabled={isSubmitting}>
작성완료
</Button>
}
Comment on lines 40 to 44

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

선택적 개선: 제출 중 상태를 사용자에게 더 명확히 전달할 수 있어요.

현재 버튼이 비활성화되지만, 사용자에게 "제출 중"임을 더 명확히 알려주면 UX가 향상될 수 있어요.

💡 제출 중 상태 표시 예시
 <Button variant="primary" size="small" onClick={submit} disabled={isSubmitting}>
-  작성완료
+  {isSubmitting ? "저장 중..." : "작성완료"}
 </Button>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rightSlot={
<Button variant="primary" size="small" onClick={submit}>
<Button variant="primary" size="small" onClick={submit} disabled={isSubmitting}>
작성완료
</Button>
}
rightSlot={
<Button variant="primary" size="small" onClick={submit} disabled={isSubmitting}>
{isSubmitting ? "저장 중..." : "작성완료"}
</Button>
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/experience-detail/ui/experience-form/experience-form.tsx` around
lines 40 - 44, The submit Button in the rightSlot currently only disables via
isSubmitting; update the Button render logic in experience-form.tsx (the
rightSlot block referencing Button, submit, and isSubmitting) to also provide an
explicit loading state/label so users know submission is in progress—e.g., when
isSubmitting is true render the Button with a loading prop or show a spinner and
change its text to something like "제출중…" (ensure onClick remains wired to submit
and button stays disabled while loading for accessibility).

Expand Down
3 changes: 2 additions & 1 deletion src/pages/experience-detail/experience-detail-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
useLeaveConfirm,
useGetExperienceDetail,
hydrateExperienceFromApi,
EXPERIENCE_MESSAGES,
} from "@/features/experience-detail";
import { ModalBasic } from "@/shared/ui/modal/modal-basic";

Expand Down Expand Up @@ -51,7 +52,7 @@ const ExperienceDetailPage = ({ mode }: ExperiencePageProps) => {
}

if (shouldFetch && isError) {
return <div>경험 데이터를 불러오는데 실패했습니다.</div>;
return <div>{EXPERIENCE_MESSAGES.API.FETCH_FAILED}</div>;
}

const content = (() => {
Expand Down
4 changes: 2 additions & 2 deletions src/shared/api/config/query-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const universityQueryKey = {

// 경험 관련 API (experience)
export const experienceQueryKey = {
all: () => ["experiene"],
all: () => ["experience"],
lists: () => [...experienceQueryKey.all(), "list"], // 모든 경험 리스트
list: (type: string, page: number) => [
...experienceQueryKey.lists(),
Expand All @@ -27,7 +27,7 @@ export const meQueryKey = {
export const aiReportsQueryKey = {
all: () => ["aiReports"],
list: (page: number, keyword?: string) => [
...experienceQueryKey.all(),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

오 맞아요 나도 여기 보면서 수정 필요하다고 생각했는데! 굿굿 ~

...aiReportsQueryKey.all(),
page,
keyword,
], // page, keyword에 따른 AI report 리스트
Expand Down
Loading