Skip to content

Conversation

@JinUng41
Copy link
Collaborator

@JinUng41 JinUng41 commented Jul 7, 2025

👻 PULL REQUEST

📄 작업 내용

  • 경기 일정에서 해외 경기 일정 시 (MSI, Worlds 등) LCK 이외 팀에도 대응이 가능하도록 수정하였습니다.
구현 내용 iPhone 13 mini
반영된 경기 일정 화면

💻 주요 코드 설명

📍 LCKTeam을 수정하지 않은 이유

  • 해외의 다른 팀들에 대응하기 위해서 기존의 LCKTeam을 수정하는 것으로 말씀드렸었습니다.
  • 하지만, 그렇게 하지 않은 이유는 게임 일정과 관련해서만 해외의 다른 팀들이 필요하기 때문입니다.
  • 그렇기 때문에 Game 구조체의 내용만 수정하여, 변화는 최소화 하였습니다.

✅ 이번 PR에서 이런 부분을 중점적으로 체크해주세요!

잠깐 확인하고 갈까요?
  • 들여쓰기를 5번 이하로 준수했는지, 코드 가독성이 적절한지 확인해주세요.

  • 한 줄당 120자 제한을 준수했는지 확인해주세요.

  • MARK 주석이 정해진 순서와 형식에 맞게 작성되었는지 확인해주세요.

  • 반복되는 상수 값이 있는지, 있다면 Constant enum으로 분리되어 있는지 확인해주세요.

  • 삼항 연산자가 길어질 경우 적절히 개행되어 있는지 확인해주세요.

  • 조건문에서 중괄호가 올바르게 사용되었는지 확인해주세요.

  • 라이브러리 import가 퍼스트파티와 서드파티로 구분되고 알파벳순으로 정렬되었는지 확인해주세요.

  • 용량이 큰 리소스나 호출되지 않을 가능성이 있는 프로퍼티에 lazy var가 적절히 사용되었는지 확인해주세요.

  • 메모리 누수 방지를 위한 weak 참조가 필요한 곳에 적용되었는지 확인해주세요.

  • 도메인 로직과 UI 로직이 적절히 분리되어 있는지 확인해주세요.

🔗 연결된 이슈

Summary by CodeRabbit

  • 신규 기능

    • 경기 일정에서 홈팀과 원정팀 이름이 이제 문자열로 표시됩니다.
    • 팀 로고가 없을 경우 기본 이미지로 대체되어 표시됩니다.
  • 버그 수정

    • 팀 이름이 없을 때 "TBD"로 표시되던 현상이 개선되었습니다.

@JinUng41 JinUng41 requested a review from youz2me July 7, 2025 14:59
@JinUng41 JinUng41 self-assigned this Jul 7, 2025
@JinUng41 JinUng41 added 🛠️ fix 기능적 버그나 오류 해결 시 사용 ♻️ refactor 기존 코드를 리팩토링하거나 수정하는 등 사용 (생산적인 경우) 🍻 진웅 술 한잔 가온나~ labels Jul 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 7, 2025

Walkthrough

이번 변경에서는 Game 엔티티의 homeTeamawayTeam 속성 타입을 LCKTeam?에서 String으로 변경하고, 관련 매핑 및 표시 로직에서 enum 변환을 제거하여 팀 이름을 문자열로 직접 처리하도록 수정했습니다. 이에 따라 팀 로고 처리 및 목 데이터 생성 코드도 함께 조정되었습니다.

Changes

파일/경로 변경 요약
Wable-iOS/Data/Mapper/InformationMapper.swift LCKTeam enum 변환 제거, 팀 이름을 문자열로 직접 매핑
Wable-iOS/Domain/Entity/GameSchedule.swift Game.homeTeam, Game.awayTeam 타입을 LCKTeam?String 변경
Wable-iOS/Domain/UseCase/Overview/OverviewUseCase.swift 목 데이터 생성 시 팀 이름을 문자열로 할당, 반환값 수정
Wable-iOS/Presentation/Overview/GameSchedule/View/GameScheduleListViewController.swift 셀 구성 시 팀 이름을 문자열로 처리, 로고 이미지 fallback 로직 추가

Sequence Diagram(s)

sequenceDiagram
    participant DataLayer as InformationMapper
    participant Domain as GameSchedule
    participant Presentation as GameScheduleListViewController

    DataLayer->>Domain: gameDTO.aTeamName, bTeamName (String) → Game(homeTeam, awayTeam)
    Domain-->>Presentation: Game(homeTeam: String, awayTeam: String)
    Presentation->>Presentation: 팀 이름을 그대로 표시, 이미지 로딩 실패 시 fallback 이미지 사용
Loading

Assessment against linked issues

Objective Addressed Explanation
LCK 이외의 팀에 대응하는 코드 구현 (#262)

Assessment against linked issues: Out-of-scope changes

(해당 변경 내역에서는 linked issue의 목적과 무관한 변경사항이 발견되지 않았습니다.)

✨ 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 or `` 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

@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)
Wable-iOS/Presentation/Overview/GameSchedule/View/GameScheduleListViewController.swift (1)

137-141: 팀 이미지 로딩 로직을 개선하여 국제 대회 팀들을 더 안정적으로 지원하세요.

현재 구현은 기본적인 기능은 제공하지만, 국제 대회 팀 이름이 이미지 에셋 이름과 일치하지 않거나 공백/특수문자가 포함된 경우 문제가 발생할 수 있습니다.

다음과 같은 개선을 제안합니다:

-let homeTeamName = game.homeTeam
-let homeTeamLogoImage = UIImage(named: homeTeamName.lowercased()) ?? .tbd
+let homeTeamName = game.homeTeam
+let homeTeamLogoImage = loadTeamLogoImage(for: homeTeamName)

-let awayTeamName = game.awayTeam
-let awayTeamLogoImage = UIImage(named: awayTeamName.lowercased()) ?? .tbd
+let awayTeamName = game.awayTeam
+let awayTeamLogoImage = loadTeamLogoImage(for: awayTeamName)

그리고 헬퍼 메서드를 추가하세요:

private func loadTeamLogoImage(for teamName: String) -> UIImage {
    // 팀 이름을 이미지 에셋 이름으로 변환 (공백 제거, 소문자 변환 등)
    let imageName = teamName.lowercased()
        .replacingOccurrences(of: " ", with: "_")
        .replacingOccurrences(of: ".", with: "")
    
    return UIImage(named: imageName) ?? .tbd
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5725466 and f91ca6e.

📒 Files selected for processing (4)
  • Wable-iOS/Data/Mapper/InformationMapper.swift (1 hunks)
  • Wable-iOS/Domain/Entity/GameSchedule.swift (1 hunks)
  • Wable-iOS/Domain/UseCase/Overview/OverviewUseCase.swift (2 hunks)
  • Wable-iOS/Presentation/Overview/GameSchedule/View/GameScheduleListViewController.swift (1 hunks)
🔇 Additional comments (4)
Wable-iOS/Domain/UseCase/Overview/OverviewUseCase.swift (2)

115-117: 팀 이름 변환 로직이 올바르게 구현되었습니다.

LCKTeam enum의 rawValue를 사용하여 String으로 변환하는 방식이 도메인 모델 변경에 맞게 적절히 구현되었습니다.


127-127: 모크 데이터 반환 로직이 올바르게 수정되었습니다.

빈 배열을 반환하던 것을 실제 생성된 mockGameSchedules를 반환하도록 수정하여 모크 데이터 기능이 정상적으로 동작할 수 있게 되었습니다.

Wable-iOS/Data/Mapper/InformationMapper.swift (1)

24-26: 매핑 로직이 올바르게 단순화되었습니다.

LCKTeam enum 변환을 제거하고 DTO의 팀 이름을 직접 할당하는 방식으로 변경하여 국제 대회 팀들도 지원할 수 있게 되었습니다. 매핑 로직이 단순화되어 가독성도 향상되었습니다.

Wable-iOS/Domain/Entity/GameSchedule.swift (1)

21-23: GameSchedule 엔티티 non-optional String 변경 승인

DTO(FetchGameSchedules.swift)에서 aTeamNamebTeamName이 이미 non-optional String으로 선언되어 있고,
도메인 레이어 매핑(OverviewUseCase.swift)에서도 homeTeam·awayTeamnil 처리 로직이 전혀 없어
옵셔널 제거가 안전한 것으로 확인되었습니다.

  • DTO: let aTeamName: String, let bTeamName: String
  • 매핑: homeTeam: lckTeams[homeTeamIndex].rawValue, awayTeam: lckTeams[awayTeamIndex].rawValue

이상 없습니다.

Copy link
Member

@youz2me youz2me left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 이제 핫픽스를 올리러 가볼까요 ㅎㅎ

@github-project-automation github-project-automation bot moved this to In Review in Wable-iOS Jul 7, 2025
@JinUng41 JinUng41 merged commit 8efb1e4 into develop Jul 8, 2025
1 check passed
@JinUng41 JinUng41 deleted the refactor/#262-team branch July 8, 2025 13:38
@github-project-automation github-project-automation bot moved this from In Review to Done in Wable-iOS Jul 8, 2025
youz2me pushed a commit that referenced this pull request Oct 26, 2025
[Refactor] 경기 일정에서 LCK 이외의 팀도 대응
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ fix 기능적 버그나 오류 해결 시 사용 ♻️ refactor 기존 코드를 리팩토링하거나 수정하는 등 사용 (생산적인 경우) 🍻 진웅 술 한잔 가온나~

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Refactor] LCK팀 이외의 팀 대응

3 participants