fix(university): 제출 버튼 중복 클릭 방지#600
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Warning Review limit reached
Next review available in: 9 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
Walkthrough이번 PR은 여러 제출 폼에서 "이중 클릭 방지"를 위한 잠금 로직을 도입합니다. 마치 엘리베이터 버튼을 여러 번 눌러도 한 번만 반응하게 만드는 느낌이죠! 아래처럼 정리했습니다.
Estimated code review effort: 3 (Moderate) | ~25 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/web/src/app/university/application/apply/ApplyPageContent.tsx (1)
44-45: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win잠금 로직, 엘리베이터 버튼처럼 딱 한 번만 눌러지네요! 로직 자체는 이상 없습니다.
isSubmitLockedRef체크 → 유효성 검사 → 락 설정 →onSettled에서 해제, 이 흐름은 정확합니다. 다만 동일한 ref 락 + pending 체크 패턴이GpaSubmitForm,LanguageTestSubmitForm에도 거의 그대로 반복되고 있어요(제공된 관련 스니펫 기준). 세 곳에 흩어진 락 로직을 공용 훅(예:useSubmitLock)으로 뽑아내면 유지보수가 한결 편해질 것 같습니다.♻️ 공용 훅 추출 예시
// useSubmitLock.ts export function useSubmitLock() { const lockedRef = useRef(false); const guard = async (fn: () => void | Promise<void>) => { if (lockedRef.current) return; lockedRef.current = true; try { await fn(); } finally { lockedRef.current = false; } }; return { lockedRef, guard }; }지금 당장 급한 이슈는 아니니 여유 있을 때 검토해보셔도 좋을 것 같아요.
Also applies to: 73-111
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/web/src/app/university/application/apply/ApplyPageContent.tsx` around lines 44 - 45, The submit-lock pattern in ApplyPageContent is correct, but it is duplicated across ApplyPageContent, GpaSubmitForm, and LanguageTestSubmitForm. Extract the shared ref-lock/pending guard logic into a reusable hook such as useSubmitLock, and update these submit handlers to use that hook so the locking behavior stays consistent and easier to maintain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/web/src/app/university/score/submit/gpa/GpaSubmitForm.tsx`:
- Around line 57-75: The submit flow in GpaSubmitForm’s postGpaScore call needs
explicit failure handling so a rejected request does not leave React Hook Form’s
submitting state stuck. Update the async block in GpaSubmitForm to catch errors
around postGpaScore, mirroring the pattern used in LanguageTestSubmitForm, and
keep the existing finally lock reset so the “next” action can be retried after a
failure.
---
Nitpick comments:
In `@apps/web/src/app/university/application/apply/ApplyPageContent.tsx`:
- Around line 44-45: The submit-lock pattern in ApplyPageContent is correct, but
it is duplicated across ApplyPageContent, GpaSubmitForm, and
LanguageTestSubmitForm. Extract the shared ref-lock/pending guard logic into a
reusable hook such as useSubmitLock, and update these submit handlers to use
that hook so the locking behavior stays consistent and easier to maintain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0dd0f8b0-d5fd-46f0-a1d8-64b03706921d
📒 Files selected for processing (5)
apps/web/src/app/university/application/_components/ApplicationBottomActionBar.tsxapps/web/src/app/university/application/apply/ApplyPageContent.tsxapps/web/src/app/university/application/apply/ConfirmStep.tsxapps/web/src/app/university/score/submit/gpa/GpaSubmitForm.tsxapps/web/src/app/university/score/submit/language-test/LanguageTestSubmitForm.tsx
6fd1458 to
1ede1a1
Compare
요약
변경 사항
검증
../../node_modules/.bin/biome check --write src/app/university/score/submit/gpa/GpaSubmitForm.tsx src/app/university/score/submit/language-test/LanguageTestSubmitForm.tsx src/app/university/application/apply/ApplyPageContent.tsx src/app/university/application/apply/ConfirmStep.tsx src/app/university/application/_components/ApplicationBottomActionBar.tsx../../node_modules/.bin/biome check .node ../../scripts/check-university-zone-navigation.mjs../../node_modules/.bin/tsc --noEmit -p tsconfig.ci.jsongit diff --checkapps/web/.env.production자동 로드 위험 때문에 로컬에서 실행하지 않았습니다.노트