Skip to content

fix(university): 제출 버튼 중복 클릭 방지#600

Open
wibaek wants to merge 1 commit into
mainfrom
fix/prevent-score-submit-double-click
Open

fix(university): 제출 버튼 중복 클릭 방지#600
wibaek wants to merge 1 commit into
mainfrom
fix/prevent-score-submit-double-click

Conversation

@wibaek

@wibaek wibaek commented Jul 7, 2026

Copy link
Copy Markdown
Member

요약

  • 성적 제출과 지원서 최종 제출에서 요청 진행 중 버튼을 비활성화합니다.
  • 빠른 연속 클릭이 들어와도 handler-level lock으로 중복 mutation 호출을 막습니다.

변경 사항

  • 학점/어학 성적 제출 폼의 submit disabled 조건에 form submitting 상태와 mutation pending 상태를 포함했습니다.
  • 학점/어학 성적 제출 handler에 ref 기반 lock을 추가했습니다.
  • 지원서 확인 단계의 bottom action bar에 disabled 상태를 전달해 최종 제출 중 재클릭을 막았습니다.

검증

  • ../../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.json
  • git diff --check
  • 로컬 pnpm 기반 git hook은 Codex 런타임의 pnpm 11/Node 24가 의존성 purge를 시도해 실패하여, 위 명령으로 web ci:check 구성을 직접 검증했습니다.
  • production build는 apps/web/.env.production 자동 로드 위험 때문에 로컬에서 실행하지 않았습니다.

노트

  • 없음

@wibaek wibaek requested a review from manNomi as a code owner July 7, 2026 15:32
@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
solid-connect-university-web Ready Ready Preview, Comment Jul 7, 2026 4:25pm
solid-connection-web Ready Ready Preview, Comment Jul 7, 2026 4:25pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connect-web-admin Skipped Skipped Jul 7, 2026 4:25pm

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@wibaek, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 63ed196a-5442-4967-8652-6e8caa997fb2

📥 Commits

Reviewing files that changed from the base of the PR and between 6fd1458 and 1ede1a1.

📒 Files selected for processing (5)
  • apps/web/src/app/university/application/_components/ApplicationBottomActionBar.tsx
  • apps/web/src/app/university/application/apply/ApplyPageContent.tsx
  • apps/web/src/app/university/application/apply/ConfirmStep.tsx
  • apps/web/src/app/university/score/submit/gpa/GpaSubmitForm.tsx
  • apps/web/src/app/university/score/submit/language-test/LanguageTestSubmitForm.tsx

Walkthrough

이번 PR은 여러 제출 폼에서 "이중 클릭 방지"를 위한 잠금 로직을 도입합니다. 마치 엘리베이터 버튼을 여러 번 눌러도 한 번만 반응하게 만드는 느낌이죠! 아래처럼 정리했습니다.

  1. ApplicationBottomActionBardisabled prop을 새로 받아 BlockBtn에 전달하도록 확장했습니다.
  2. ApplyPageContentuseRef 기반 잠금(isSubmitLockedRef)과 isPending 상태를 도입해 handleSubmit이 중복 실행되지 않도록 가드를 걸고, 완료 시(onSettled) 잠금을 해제합니다.
  3. ConfirmStepisSubmitting prop을 추가로 받아 ApplicationBottomActionBardisabled에 연결합니다.
  4. GpaSubmitForm — 동일한 패턴으로 isSubmitLockedRefisSubmitDisabled를 도입해 onSubmittry/finally로 감싸고, 제출 버튼 상태를 갱신합니다.
  5. LanguageTestSubmitForm — 위와 동일한 잠금 및 isSubmitDisabled 계산 로직을 적용해 버튼 활성화 조건을 강화합니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: enunsnv, khwww

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 제출 버튼 중복 클릭 방지라는 제목이 GPA, 어학, 지원서 최종 제출의 중복 방지 변경과 정확히 맞습니다.
Description check ✅ Passed 관련 이슈 번호는 없지만 요약, 변경 사항, 검증, 특이점이 구체적으로 정리되어 있어 템플릿을 대부분 충족합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/prevent-score-submit-double-click

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 213318d and 6fd1458.

📒 Files selected for processing (5)
  • apps/web/src/app/university/application/_components/ApplicationBottomActionBar.tsx
  • apps/web/src/app/university/application/apply/ApplyPageContent.tsx
  • apps/web/src/app/university/application/apply/ConfirmStep.tsx
  • apps/web/src/app/university/score/submit/gpa/GpaSubmitForm.tsx
  • apps/web/src/app/university/score/submit/language-test/LanguageTestSubmitForm.tsx

Comment thread apps/web/src/app/university/score/submit/gpa/GpaSubmitForm.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant