Skip to content

Feat ck/lecture fix v1#188

Merged
play-ancora-gyungmin merged 3 commits intodevfrom
feat-ck/lecture-fix-v1
Feb 25, 2026
Merged

Feat ck/lecture fix v1#188
play-ancora-gyungmin merged 3 commits intodevfrom
feat-ck/lecture-fix-v1

Conversation

@p-changki
Copy link
Contributor

@p-changki p-changki commented Feb 25, 2026

🔗 관련 이슈

  • Closes [FE] [Phase 2] [Task ID: B0 ] features -fix #187
    ✨ 작업 단계 및 변경 사항

  • 작업 단계: Phase 1 (기능 안정화)

  • 변경 사항:

    • 강의 개설 mutation의 진행 상태(isPending)를 페이지 state로 노출
    • 개설하기 버튼에 제출 중 잠금 적용 (disabled={isSaved || isSubmitting})
    • 제출 중 버튼 라벨을 개설 중...으로 표시
    • 저장 핸들러 초입에 재진입 가드 추가 (if (createLecture.isPending) return;)
    • 페이지에서 헤더로 isSubmitting props 연결

🧪 테스트 방법
리뷰어 확인 핵심 포인트:

  • /educators/lectures/create 페이지가 정상 렌더링되는가?
  • 필수값 입력 후 개설하기를 빠르게 5~10회 연타해도 POST /lectures가 1회만 발생하는가?
  • 요청 진행 중 버튼이 비활성화되고 개설 중... 라벨이 노출되는가?
  • 요청 실패 후 재시도 시, 시도 1회당 요청 1회만 발생하는가?
  • 유효성 오류 상태에서는 기존 경고 모달이 정상 노출되고 요청이 발생하지 않는가?
    참고:
  • pre-push 훅에서 Jest 테스트 통과 (5 suites, 13 tests passed)

📸 스크린샷 (선택)

  • UI 텍스트 변경(개설 중...)이 포함되어 있어, 필요 시 버튼 상태(클릭 전/요청 중) 2장 첨부 예정

✅ 체크리스트

  • Phase에 맞는 이슈 체크리스트를 모두 완료했는가?
  • lint 통과 및 불필요한 console.log 제거
  • type-check 통과 (이번 작업에서 별도 실행은 하지 않음)
  • 머지 후 이 이슈가 [QA] 컬럼으로 이동함을 인지하고 있는가?

Summary by CodeRabbit

  • New Features
    • Save button now displays submission status and is disabled during form processing to prevent accidental duplicate submissions.

@coderabbitai
Copy link

coderabbitai bot commented Feb 25, 2026

Warning

Rate limit exceeded

@p-changki has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 0 minutes and 33 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 7f6a8da and 48e0dfb.

📒 Files selected for processing (1)
  • src/app/(dashboard)/educators/lectures/create/_hooks/useLectureCreateForm.ts
📝 Walkthrough

Walkthrough

This pull request prevents duplicate form submissions when creating lectures by introducing submission state management. The implementation adds an isSubmitting prop that flows through the component hierarchy, disables the save button during submission, updates the button label with a loading indicator, and adds a pending check to abort submissions when a mutation is already in progress.

Changes

Cohort / File(s) Summary
CreatePageHeader Component
src/app/(dashboard)/educators/lectures/create/_components/CreatePageHeader.tsx
Added isSubmitting prop to component signature. Modified Save button to disable when either isSaved or isSubmitting is true, and display "개설 중..." label during submission.
Custom Hooks
src/app/(dashboard)/educators/lectures/create/_hooks/useLectureCreateForm.ts, src/app/(dashboard)/educators/lectures/create/_hooks/useLectureCreatePage.ts
useLectureCreateForm adds early return guard to abort submission if createLecture.isPending is true. useLectureCreatePage exposes isSubmitting state derived from createLectureMutation.isPending.
Page Integration
src/app/(dashboard)/educators/lectures/create/page.tsx
Passes isSubmitting prop from state to CreatePageHeader component.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Feat ck/lecture qa v1 #141 — Modifies the same hooks and components affected by this PR's submission state management changes.
  • Feat ck/b1 page UI #41 — Introduces the CreatePageHeader component that is extended with the new isSubmitting prop in this PR.

Suggested labels

FE, Page

Suggested reviewers

  • play-ancora-gyungmin
  • rklpoi5678
  • yoorrll

Poem

🐰 A button that once would click and click again,
Now wisely waits when submission's in the pen,
With "개설 중..." glowing soft and true,
Double posts are banished—oh what we do! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feat ck/lecture fix v1' is vague and does not clearly convey the main purpose of the changes; it lacks specificity about the actual feature or fix being implemented. Consider using a more descriptive title that clearly summarizes the primary change, such as 'Prevent duplicate lecture creation requests by disabling submit button during submission'.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The pull request successfully addresses the core objective from #187 by preventing duplicate POST requests through button disabling and re-entrancy guards when the mutation is pending.
Out of Scope Changes check ✅ Passed All changes are directly scoped to preventing duplicate lecture creation requests; no unrelated modifications to other features or components were introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-ck/lecture-fix-v1

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

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/app/`(dashboard)/educators/lectures/create/_hooks/useLectureCreateForm.ts:
- Line 54: The create handler in useLectureCreateForm relies on the async
render-state check (createLecture.isPending) and can still double-submit; add a
synchronous in-handler lock using a ref (e.g. const submittingRef =
useRef(false)) that you set to true immediately before calling
createLecture.mutate() and check first to return early if true, then clear the
ref (set to false) inside createLecture's onSettled callback so the lock is
released; ensure all references use the same ref name and keep the isPending
check as a secondary guard.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da4032d and 7f6a8da.

📒 Files selected for processing (4)
  • src/app/(dashboard)/educators/lectures/create/_components/CreatePageHeader.tsx
  • src/app/(dashboard)/educators/lectures/create/_hooks/useLectureCreateForm.ts
  • src/app/(dashboard)/educators/lectures/create/_hooks/useLectureCreatePage.ts
  • src/app/(dashboard)/educators/lectures/create/page.tsx

@github-actions
Copy link

⚡️ Lighthouse Report

🏠 URL: http://localhost:3000/

Category Score
🔴 Performance 41
🟢 Accessibility 96
🟢 Best practices 93
🟢 SEO 100

상세 리포트는 하단의 lhci/url Checks 내 Details 링크를 확인해주세요! 🚀

Copy link
Contributor

@play-ancora-gyungmin play-ancora-gyungmin left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link

⚡️ Lighthouse Report

🏠 URL: http://localhost:3000/

Category Score
🔴 Performance 52
🟢 Accessibility 96
🟢 Best practices 93
🟢 SEO 100

상세 리포트는 하단의 lhci/url Checks 내 Details 링크를 확인해주세요! 🚀

@play-ancora-gyungmin play-ancora-gyungmin merged commit 545fc67 into dev Feb 25, 2026
4 checks passed
@play-ancora-gyungmin play-ancora-gyungmin deleted the feat-ck/lecture-fix-v1 branch February 25, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FIX 수정사항

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FE] [Phase 2] [Task ID: B0 ] features -fix

2 participants