Skip to content

Conversation

@chominju02
Copy link
Contributor

@chominju02 chominju02 commented Oct 12, 2025

✅ Linked Issue

🔍 What I did

Before After

💡 Why I did it

🧠 What I learned

🧪 How to test

🔧 Additional context

🚧 TODO (if any)

  • [ ]

Summary by CodeRabbit

  • Bug Fixes
    • The "수험표 출력" (Print Exam Ticket) button now displays a disabled state when printing is unavailable, preventing unintended clicks and clarifying availability. This improves usability by signaling when the action cannot be performed. No other screens or actions are affected, and existing navigation and overlays continue to work as before.

@vercel
Copy link

vercel bot commented Oct 12, 2025

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

Project Deployment Preview Comments Updated (UTC)
mosu-client Ready Ready Preview Comment Oct 12, 2025 6:10pm

@coderabbitai
Copy link

coderabbitai bot commented Oct 12, 2025

Walkthrough

A disabled attribute was added to the "수험표 출력" button in RegisteredExamDetailCard.tsx, preventing user interaction. The onClick handler remains unchanged. No other UI, routing, or logic modifications were introduced.

Changes

Cohort / File(s) Summary
UI: Disable print ticket button
mosu-app/src/entities/exam/ui/RegisteredExamDetailCard.tsx
Added disabled state to the "수험표 출력" button; onClick handler retained but non-invocable due to disabled attribute. No other logic or UI changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I thump my paws—print dreams on hold,
A button sleeps, its story untold.
No clicks today, the ticket rests,
In patient queues of gentle tests.
I’ll nibble code and wait in place—
When flags flip true, we’ll print with grace. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely describes the primary change of disabling the exam ticket print button, matching the changeset without extra noise or unrelated details.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/examTicketButton

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.

@github-actions
Copy link

Warnings
⚠️ PR 제목에 #이슈넘버가 포함되어 있지 않습니다. 이슈 번호를 포함해주세요.
⚠️ PR에 Reviewers가 지정되어 있지 않습니다. 리뷰어를 지정해주세요.
⚠️ PR에 라벨이 지정되어 있지 않습니다. 적절한 라벨을 추가해주세요.
⚠️ PR에 Assignees가 지정되어 있지 않습니다. 적절한 Assignee를 추가해주세요.
⚠️ 브랜치 이름 'refactor/examTicketButton'이 컨벤션을 따르지 않습니다. # 형식으로 작성해주세요
Messages
📖 ✅ package.json에 변경사항이 없습니다.
📖 ✅ TypeScript 컴파일이 성공적으로 완료되었습니다.
📖 ✅ ESLint 검사 결과 문제가 없습니다.

📝 추가 및 변경된 파일

총 1개 파일 변경

└── 📂 mosu-app/
    └── 📂 src/
        └── 📂 entities/
            └── 📂 exam/
                └── 📂 ui/
                    └── ⚛️ RegisteredExamDetailCard.tsx

Generated by 🚫 dangerJS against 4dfd012

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca6ea54 and 4dfd012.

📒 Files selected for processing (1)
  • mosu-app/src/entities/exam/ui/RegisteredExamDetailCard.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Run DangerJS
  • GitHub Check: Run Unit & Integration Tests

Comment on lines 64 to 70
<button
className="flex-1 border-l-[0.5px] p-4 hover:cursor-pointer"
onClick={() => onPrintTicketButtonClick()}
disabled={true}
>
수험표 출력
</button>
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Implement conditional disabling based on exam date.

The button is permanently disabled with a hardcoded true value. Based on the overlay message (lines 80-81), the button should be conditionally disabled—enabled within 3 days of the exam date and disabled otherwise.

With the current implementation:

  • The onClick handler (line 66) is unreachable dead code
  • Users cannot access the informative overlay message
  • The button remains disabled even when the exam is within 3 days

Consider implementing date-based conditional logic:

+    const isWithinThreeDays = useCallback(() => {
+        const examDateObj = new Date(examDate);
+        const today = new Date();
+        const diffInDays = Math.ceil((examDateObj.getTime() - today.getTime()) / (1000 * 60 * 60 * 24));
+        return diffInDays <= 3;
+    }, [examDate]);
+
+    const canPrintTicket = isWithinThreeDays();
+
     const onPrintTicketButtonClick = useCallback(() => {
+        if (!canPrintTicket) {
+            overlay.open();
+            return;
+        }
-        overlay.open();
+        // TODO: Implement actual ticket printing logic
-    }, [overlay]);
+    }, [canPrintTicket, overlay]);

     // ... in the button:
     <button
         className="flex-1 border-l-[0.5px] p-4 hover:cursor-pointer"
         onClick={() => onPrintTicketButtonClick()}
-        disabled={true}
+        disabled={!canPrintTicket}
+        aria-label={canPrintTicket ? "수험표 출력" : "수험표 출력 불가 (시험 3일 전부터 가능)"}
     >
         수험표 출력
     </button>

This approach:

  • Shows the overlay message when users click while the button is enabled but before the 3-day window
  • Disables the button visually when outside the window
  • Adds ARIA attributes for accessibility
  • Preserves the onClick handler for future ticket printing implementation
📝 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
<button
className="flex-1 border-l-[0.5px] p-4 hover:cursor-pointer"
onClick={() => onPrintTicketButtonClick()}
disabled={true}
>
수험표 출력
</button>
<button
className="flex-1 border-l-[0.5px] p-4 hover:cursor-pointer"
onClick={() => onPrintTicketButtonClick()}
disabled={!canPrintTicket}
aria-label={canPrintTicket
? "수험표 출력"
: "수험표 출력 불가 (시험 3일 전부터 가능)"}
>
수험표 출력
</button>

@github-actions
Copy link

📚 Storybook이 Chromatic에 배포되었습니다!

@chominju02 chominju02 merged commit 4e83d74 into main Oct 12, 2025
11 checks passed
@chominju02 chominju02 deleted the refactor/examTicketButton branch October 12, 2025 18:59
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.

2 participants