Skip to content

fix: 타입 에러 및 불필요한 import 정리#161

Merged
Yejiin21 merged 5 commits intodevelopfrom
fix/#160/build-errors
Jun 1, 2025
Merged

fix: 타입 에러 및 불필요한 import 정리#161
Yejiin21 merged 5 commits intodevelopfrom
fix/#160/build-errors

Conversation

@Yejiin21
Copy link
Copy Markdown
Contributor

@Yejiin21 Yejiin21 commented Jun 1, 2025

Summary by CodeRabbit

  • Refactor
    • 코드 내 열거형(enum) 및 상수 사용으로 가독성과 유지보수성이 향상되었습니다.
    • 불필요한 예시 데이터와 사용하지 않는 import가 제거되었습니다.
    • 일부 코드 스타일 및 포맷이 개선되었습니다.

@Yejiin21 Yejiin21 requested review from m3k0813 and xaexunxang June 1, 2025 12:52
@Yejiin21 Yejiin21 self-assigned this Jun 1, 2025
@Yejiin21 Yejiin21 added the 🛠️ BugFix 오류 해결 과정 기록 label Jun 1, 2025
@Yejiin21 Yejiin21 linked an issue Jun 1, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 1, 2025

Walkthrough

공유 타입 정의에 새로운 TicketOptionType enum이 추가되었고, 기존에 문자열로 사용되던 응답 형식 관련 값들이 이 enum을 사용하도록 일괄 교체되었습니다. 불필요한 예제 데이터와 상수들은 제거되었으며, 일부 import 경로 및 코드 스타일이 정리되었습니다. 주요 로직 변경은 없습니다.

Changes

파일/경로 요약 변경 내용 요약
src/shared/types/ticketType.ts TicketOptionType enum 신설 및 export
src/features/ticket/ui/TicketOptionFormSection.tsx 응답 형식 관련 문자열을 TicketOptionType enum으로 교체, 관련 import 추가, 타입 명시, 스타일 소폭 수정
src/shared/types/responseType.ts 예제 데이터(responsesInfo, options) 삭제, interface만 유지
src/pages/dashboard/ui/mail/EmailEditPage.tsx import 경로 수정, 구조분해 단순화, 스타일 및 포맷팅 변경
src/pages/payment/ui/PaymentPage.tsx 불필요한 import(Header, ticket SVG) 제거
src/widgets/dashboard/ui/ticket/TicketItem.tsx onDragEnd 핸들러의 첫 번째 파라미터를 _로 변경(미사용 명시)

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TicketOptionFormSection
    participant TicketOptionType(enum)

    User->>TicketOptionFormSection: 응답 형식 선택 (ChoiceChip)
    TicketOptionFormSection->>TicketOptionType: enum 값 사용(SINGLE, MULTIPLE, TEXT)
    TicketOptionFormSection-->>User: 선택 결과 반영
Loading

Possibly related PRs

Poem

🐇
Enum이 왔어요, 타입이 반짝,
문자열 대신, 안전하게 착착!
예제 데이터는 안녕, 간결한 코드만 남았네,
토끼는 깡총, 타입 정리 참 잘했네.
🎉

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

@Yejiin21 Yejiin21 removed the request for review from xaexunxang June 1, 2025 12:52
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jun 1, 2025

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: 0

🧹 Nitpick comments (1)
src/features/ticket/ui/TicketOptionFormSection.tsx (1)

53-53: selected 캐스팅 제거 제안
현재 selected as TicketOptionType로 캐스팅하고 있는데, ChoiceChip 컴포넌트에 제네릭 타입을 도입하면 불필요한 타입 단언을 제거할 수 있습니다.

예시:

- <ChoiceChip
+ <ChoiceChip<TicketOptionType>
   value={state.question.responseFormat}
   options={[ /* ... */ ]}
-  onSelect={selected => {
+  onSelect={(selected: TicketOptionType) => {
     dispatch({ type: 'SET_RESPONSE_TOGGLE', payload: selected });
     /* ... */
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b3193b9 and 4663bd9.

📒 Files selected for processing (6)
  • src/features/ticket/ui/TicketOptionFormSection.tsx (3 hunks)
  • src/pages/dashboard/ui/mail/EmailEditPage.tsx (3 hunks)
  • src/pages/payment/ui/PaymentPage.tsx (0 hunks)
  • src/shared/types/responseType.ts (1 hunks)
  • src/shared/types/ticketType.ts (1 hunks)
  • src/widgets/dashboard/ui/ticket/TicketItem.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • src/pages/payment/ui/PaymentPage.tsx
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/features/ticket/ui/TicketOptionFormSection.tsx (1)
src/features/ticket/model/ticketOption.ts (1)
  • TicketOptionType (3-3)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: storybook
🔇 Additional comments (10)
src/shared/types/ticketType.ts (1)

1-5: 훌륭한 enum 정의입니다!

새로운 TicketOptionType enum이 올바르게 구현되었습니다. 문자열 리터럴을 사용하여 직렬화가 용이하고, 하드코딩된 문자열을 대체하여 타입 안전성을 크게 향상시킵니다.

src/pages/dashboard/ui/mail/EmailEditPage.tsx (4)

11-11: import 경로 개선이 좋습니다.

더 간결하고 명확한 import 경로로 변경되어 코드 가독성이 향상되었습니다.


19-20: 구조분해 할당 통합이 깔끔합니다.

여러 줄에 걸쳐 있던 구조분해 할당을 한 줄로 통합하여 코드가 더 간결해졌습니다.


30-30: 일관된 코딩 스타일 적용.

trailing comma 추가로 코드 스타일의 일관성이 향상되었습니다.


35-35: 코드 형식 개선이 우수합니다.

함수 호출과 이벤트 핸들러의 형식이 개선되어 가독성이 향상되었습니다.

Also applies to: 49-51

src/widgets/dashboard/ui/ticket/TicketItem.tsx (1)

18-24: 사용하지 않는 매개변수 처리가 우수합니다.

사용되지 않는 event 매개변수를 _로 변경하여 코드의 의도를 명확히 표현했습니다. 이는 코드 품질 도구의 권장사항을 잘 따른 개선입니다.

src/shared/types/responseType.ts (1)

1-14: 불필요한 코드 제거가 훌륭합니다.

샘플 데이터와 상수를 제거하고 타입 정의만 남겨두어 파일의 목적이 더욱 명확해졌습니다. 새로운 TicketOptionType enum 도입과 함께 코드베이스가 더 체계적으로 정리되었습니다.

src/features/ticket/ui/TicketOptionFormSection.tsx (3)

5-5: TicketOptionType enum 가져오기 확인
src/shared/types/ticketType에서 올바르게 TicketOptionType을 import 하여 하드코딩된 문자열을 대체했습니다. 타입 안전성이 확보되어 좋습니다.


35-35: Null 병합 연산자 주변 공백 정리
state.question.description ?? '' 구문에 불필요했던 공백을 일관성 있게 정리했습니다. 스타일 개선으로 가독성이 소폭 향상되었습니다.


48-50: 하드코딩 문자열 → TicketOptionType enum 사용
ChoiceChipoptions에서 직접 쓰이던 '객관식', '여러개 선택', '자유로운 텍스트' 값을 enum 멤버로 교체하여 중복 문자열 관리 이슈를 제거했고, 타입 안정성을 높였습니다.

Copy link
Copy Markdown
Member

@m3k0813 m3k0813 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~

@Yejiin21 Yejiin21 merged commit 7f1213d into develop Jun 1, 2025
2 checks passed
@Yejiin21 Yejiin21 deleted the fix/#160/build-errors branch June 1, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ BugFix 오류 해결 과정 기록

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix] 타입 에러 및 불필요한 import 정리

2 participants