Skip to content

refactor: 호스트 생성 및 대시보드 리팩토링#180

Merged
xaexunxang merged 13 commits intodevelopfrom
refact/#174/host-dashboard-refactoring
Jun 17, 2025
Merged

refactor: 호스트 생성 및 대시보드 리팩토링#180
xaexunxang merged 13 commits intodevelopfrom
refact/#174/host-dashboard-refactoring

Conversation

@xaexunxang
Copy link
Copy Markdown
Contributor

@xaexunxang xaexunxang commented Jun 17, 2025

호스트 생성

  • 미 로그인 시 에러 문구 : alert -> 텍스트 (색상: 빨간색, 관심 페이지와 동일한 색상)
image
  • 호스트 삭제 실패 에러 핸들링
image

대시보드

  • 판매 금액 글씨 크기 조절 (천만 단위 기준)
image
  • 티켓 옵션 : 드래그앤드랍 오류 해결
default.mov
  • 구매/참가자 관리 : 확인하기 버튼 alert(에러핸들링)
구매참가자에러핸들링

대신 이곳에서는 정상적인 불러오기 동작에 "!"를 작성함으로써 에러 핸들링을 구현했고, 추후 수정해야하는 부분에 대해서 주석을 남겨놓았습니다.

Summary by CodeRabbit

  • 버그 수정

    • 참가자 카드에서 필수 응답 데이터가 없을 때 안내 메시지를 표시하고, 확인 버튼 동작을 제한하도록 개선되었습니다.
    • 티켓 옵션 드래그 앤 드롭 시, 유효한 ID가 모두 있을 때만 옵션 연결이 동작하도록 수정되었습니다.
    • 참가자 목록에서 컴포넌트 이름 오타로 인한 불러오기 오류가 수정되었습니다.
  • UI/스타일

    • 티켓 매출 금액의 폰트 크기가 기본 및 중간 화면에서 더 세밀하게 조정되었습니다.
    • Tailwind CSS에 17px, 18px 폰트 크기가 추가되어 글꼴 크기 선택 폭이 넓어졌습니다.
  • 신규 기능 및 개선

    • 이벤트 퍼널 페이지에서 첫 단계로 초기화 및 URL 동기화가 자동으로 이루어지도록 개선되었습니다.
    • 호스트 선택 페이지에서 로그인하지 않은 사용자는 버튼 대신 로그인 안내 메시지가 표시됩니다. 호스트 삭제 실패 시 에러 메시지 팝업이 추가되었습니다.
  • 개발 도구

    • 개발 환경에서 React Query Devtools가 기본적으로 열려 표시됩니다.
  • 코드 스타일

    • 일부 레이아웃 및 코드 들여쓰기가 정돈되었습니다.

@xaexunxang xaexunxang linked an issue Jun 17, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 17, 2025

Error: Could not generate a valid Mermaid diagram after multiple attempts.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 515d6d0 and 4b09450.

📒 Files selected for processing (9)
  • src/app/Layout.tsx (1 hunks)
  • src/features/dashboard/ui/PariticipantsList.tsx (1 hunks)
  • src/features/dashboard/ui/ParticipantCard.tsx (3 hunks)
  • src/features/ticket/hooks/useTicketOptionDnD.ts (1 hunks)
  • src/main.tsx (1 hunks)
  • src/pages/event/ui/create-event/FunnelPage.tsx (3 hunks)
  • src/pages/event/ui/host/HostSelectionPage.tsx (2 hunks)
  • src/widgets/dashboard/ui/main/TicketRevenue.tsx (1 hunks)
  • tailwind.config.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • src/app/Layout.tsx
  • src/features/dashboard/ui/PariticipantsList.tsx
  • tailwind.config.js
  • src/main.tsx
  • src/features/ticket/hooks/useTicketOptionDnD.ts
  • src/widgets/dashboard/ui/main/TicketRevenue.tsx
  • src/pages/event/ui/create-event/FunnelPage.tsx
  • src/pages/event/ui/host/HostSelectionPage.tsx
  • src/features/dashboard/ui/ParticipantCard.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: storybook
✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

@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: 2

🔭 Outside diff range comments (2)
src/pages/event/ui/create-event/FunnelPage.tsx (2)

14-21: previousStep 갱신 시 불안정한 클로저 사용

setPreviousStep([...previousStep, currentStep]) 는 기존 상태를 직접 캡처해 업데이트하므로 연속 클릭 시 값이 유실될 수 있습니다. 함수형 업데이트로 안전하게 처리하세요.

-setPreviousStep([...previousStep, currentStep]);
+setPreviousStep(prev => [...prev, currentStep]);

25-35: previousStep.pop() 으로 상태 직접 변형

pop() 은 배열을 mutate 하므로 React 상태 관리 원칙에 어긋납니다. 불변 복사본을 만든 뒤 갱신하고 setPreviousStep 으로 상태를 동기화하세요.

-const prevStep = previousStep.pop();
-if (prevStep !== undefined) {
-  setStep(prevStep);
-  navigate(`${location.pathname}?step=${steps[prevStep]}`);
-}
+setPreviousStep(prev => {
+  const copy = [...prev];
+  const prevStep = copy.pop();
+  if (prevStep !== undefined) {
+    setStep(prevStep);
+    navigate(`${location.pathname}?step=${steps[prevStep]}`);
+  }
+  return copy;
+});
🧹 Nitpick comments (7)
tailwind.config.js (1)

54-56: px 대신 rem 사용 고려

고정 px 단위는 사용자 브라우저 기본 폰트 크기 설정을 무시하여 접근성에 불리할 수 있습니다.
17px, 18px를 등록할 때 다음과 같이 rem 기반으로 선언하면 유연성이 높아집니다.

src/main.tsx (1)

15-15: Devtools 기본 오픈 여부 재검토

initialIsOpen={true}로 두면 로컬 개발 시 항상 패널이 열려 UI를 가리는 경우가 잦습니다.
다음과 같이 ENV 플래그로 제어하거나 기본값을 false로 유지하는 방안을 고려해 주세요.

-{import.meta.env.DEV && <ReactQueryDevtools initialIsOpen={true} position="left" />}
+{import.meta.env.DEV && (
+  <ReactQueryDevtools
+    initialIsOpen={import.meta.env.VITE_RQ_DEVTOOLS_OPEN === 'true'}
+    position="left"
+  />
+)}
src/shared/ui/EventCard.tsx (1)

132-133: alert 사용은 사용자 경험 저해

window.alert는 모달을 강제 block 하며 모바일 환경에서 화면 비율이 깨질 수 있습니다.
비동기 알림용 토스트(예: react-toastify 또는 자체 Snackbar)를 사용하면 UX가 향상됩니다.

- alert('이벤트 삭제에 성공했습니다.');
+ toast.success('이벤트 삭제에 성공했습니다.'); // 예시

또한 다국어 지원을 고려해 i18n 메시지로 분리해 주세요.

src/pages/event/ui/host/HostSelectionPage.tsx (1)

41-45: 알림 메시지의 사용자 경험 개선 제안

alert(${error.message}) 는 개발용 내부 에러 메시지를 그대로 노출할 가능성이 있습니다.
공통 Toast/Modal 컴포넌트를 사용해 사용자 친화적인 문구로 보여주면 UX 가 향상됩니다.

src/pages/event/ui/create-event/FunnelPage.tsx (1)

49-56: useEffect 의 의존성 누락

setStep, navigate, location.pathname, steps 등을 사용하지만 의존성 배열이 비어 있습니다. ESLint 규칙을 따른다면 경고가 발생합니다. 의도적으로 최초 1회만 실행하려면 주석으로 lint 무시 또는 // eslint-disable-next-line react-hooks/exhaustive-deps 를 추가해 의도를 명시하세요.

src/features/dashboard/ui/ParticipantCard.tsx (2)

18-29: 에러 핸들링 👍 & 잔여 TODO 정리 필요

usePersonalTicketOptionAnswers 로 에러를 확인한 뒤 alert 처리한 점은 👍
다만 코드 주석(// 에러 핸들링 여기도 수정해야함)과 불필요한 주석은 정리하고,
추후 Toast 컴포넌트로 통일하는 것이 좋겠습니다.


8-15: 미사용 prop 제거 또는 활용

checked, onChange prop 이 인터페이스에는 존재하지만 컴포넌트에서 사용되지 않습니다. 호출부(ParticipantsList)는 여전히 전달하고 있어 혼동을 줄 수 있습니다. 필요 없다면 인터페이스와 호출부를 함께 정리하세요.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b2eaaa and ae15023.

📒 Files selected for processing (10)
  • src/app/Layout.tsx (1 hunks)
  • src/features/dashboard/ui/PariticipantsList.tsx (1 hunks)
  • src/features/dashboard/ui/ParticipantCard.tsx (3 hunks)
  • src/features/ticket/hooks/useTicketOptionDnD.ts (1 hunks)
  • src/main.tsx (1 hunks)
  • src/pages/event/ui/create-event/FunnelPage.tsx (3 hunks)
  • src/pages/event/ui/host/HostSelectionPage.tsx (2 hunks)
  • src/shared/ui/EventCard.tsx (1 hunks)
  • src/widgets/dashboard/ui/main/TicketRevenue.tsx (1 hunks)
  • tailwind.config.js (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/features/dashboard/ui/ParticipantCard.tsx (1)
src/features/ticket/hooks/useTicketOptionHook.ts (1)
  • usePersonalTicketOptionAnswers (65-76)
🔇 Additional comments (3)
src/app/Layout.tsx (1)

3-8: 들여쓰기 수정 확인 완료

들여쓰기만 정리된 변경으로, 렌더 결과나 접근성에 영향을 주지 않습니다. 유지해도 무방합니다.

src/widgets/dashboard/ui/main/TicketRevenue.tsx (1)

13-13: 타이포그래피 클래스 변경 확인

text-15, text-17tailwind.config.js에 새로 정의된 값과 일치합니다. 빌드 오류 위험 없음으로 보이며 가독성도 개선됩니다.

src/features/dashboard/ui/PariticipantsList.tsx (1)

2-2: 타이포 수정 👍

ParticipantCard 경로 오타가 해결되어 모듈 해석 문제가 사라집니다. 별다른 추가 이슈 없습니다.

@xaexunxang xaexunxang requested review from Yejiin21 and hyeeuncho June 17, 2025 12:45
@xaexunxang xaexunxang self-assigned this Jun 17, 2025
@xaexunxang xaexunxang added the 🪄 Refactoring 코드 리팩토링 label Jun 17, 2025
@xaexunxang xaexunxang force-pushed the refact/#174/host-dashboard-refactoring branch from 515d6d0 to 4b09450 Compare June 17, 2025 13:44
@github-actions
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@Yejiin21 Yejiin21 left a comment

Choose a reason for hiding this comment

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

수정사항 모두 잘 반영해주셨네요! 수고하셨습니당

@xaexunxang xaexunxang merged commit 19f3666 into develop Jun 17, 2025
2 checks passed
@xaexunxang xaexunxang deleted the refact/#174/host-dashboard-refactoring branch June 17, 2025 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪄 Refactoring 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[refactor] 호스트 생성 및 대시보드 리팩토링

2 participants