Skip to content

Conversation

@Kimyonhae
Copy link
Contributor

  1. 웨이트 트레이닝 이미지 버그
  2. 몸무게 타입 변경 및 모델링 타입 변경

@gemini-code-assist
Copy link

Summary of Changes

Hello @Kimyonhae, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 웨이트 트레이닝 이미지 관련 버그를 해결하고, 애플리케이션 전반에 걸쳐 몸무게 데이터 타입을 정수에서 소수점(Double)으로 변경하여 더 정확한 몸무게 기록 및 표시를 가능하게 합니다. 이는 데이터 모델, DTO, 그리고 UI 컴포넌트에 걸쳐 일관된 타입 변경을 포함합니다.

Highlights

  • 웨이트 트레이닝 이미지 버그 수정: 웨이트 트레이닝 이미지셋의 Contents.json 파일에서 참조하는 이미지 파일명이 WEIGHTS.pdf에서 WEIGHT_TRAINING.pdf로 수정되었습니다. 또한, ExerciseObj 열거형에서 weights 케이스가 weight_training으로 변경되어 이미지와 모델링 이름이 일관성을 갖도록 했습니다.
  • 몸무게 데이터 타입 변경: CalendarDetail.swiftExerciseResponse 구조체와 ExerciseDTO.swiftExerciseBody 구조체에서 weight 속성의 데이터 타입이 Int 또는 Int?에서 Double 또는 Double?로 변경되었습니다. 이는 몸무게를 더 정확하게 기록하기 위함입니다.
  • 몸무게 입력 필드 로직 개선: ExerciseRecordView.swift에서 몸무게 입력 필드에 사용되던 inputGroup이 소수점 입력을 지원하는 새로운 weightGroup 함수로 대체되었습니다. 이 변경으로 사용자가 몸무게를 소수점 단위로 입력할 수 있게 되었습니다.
  • ViewModel의 몸무게 타입 동기화: ExerciseRecordView+ViewModel.swift에서 weight 속성의 타입이 Int에서 Double로 변경되어, 모델 및 DTO의 변경 사항과 일치하도록 업데이트되었습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

이 PR은 웨이트 트레이닝 이미지 관련 버그를 수정하고, 몸무게 데이터 타입을 Int에서 Double로 변경하는 내용을 담고 있습니다. 전반적으로 변경 사항은 명확하며, PR의 목적을 잘 달성하고 있습니다. 다만, 몸무게 입력을 위해 새로 추가된 weightGroup 뷰에서 사용자 경험(UX)을 저해할 수 있는 부분을 발견하여 수정을 제안합니다. 또한 코드 중복을 줄이기 위한 리팩토링 제안도 포함했습니다. 자세한 내용은 아래 주석을 확인해주세요.

I am having trouble creating individual review comments. Click here to see my feedback.

RecordManagment/Presentation/View/Exercise/ExerciseRecordView.swift (276-280)

high

몸무게 입력 처리 로직에 사용자 경험을 저해할 수 있는 부분이 있습니다.

현재 구현에서는 사용자가 소수점을 포함한 숫자를 잘못 입력할 경우(예: "1.2." 입력), Double(filtered)nil이 되어 값이 0으로 초기화됩니다. 이로 인해 사용자가 입력하던 "1.2"라는 값이 사라져버리는 문제가 발생합니다.

잘못된 입력에 대해 값을 0으로 초기화하는 대신, 유효하지 않은 입력일 경우 바인딩된 값을 업데이트하지 않도록 수정하여 사용자가 입력을 수정할 기회를 주는 것이 좋습니다. 이렇게 하면 사용자가 실수로 잘못 입력하더라도 기존 입력 내용이 유지되어 더 나은 사용자 경험을 제공할 수 있습니다.

                    if let value = Double(filtered) {
                        number.wrappedValue = value
                    } else if filtered.isEmpty && isFocused == focused {
                        number.wrappedValue = 0
                    }

RecordManagment/Presentation/View/Exercise/ExerciseRecordView.swift (251-300)

medium

weightGroup 함수는 기존의 inputGroup 함수와 매우 유사한 구조를 가지고 있습니다. 현재는 IntDouble 타입을 처리하기 위해 두 개의 함수로 분리되어 있지만, 이로 인해 코드 중복이 발생하고 유지보수성이 저하될 수 있습니다.

향후에 제네릭(Generic)을 사용하여 이 두 함수를 하나로 통합하는 것을 고려해보세요. 예를 들어, NumericLosslessStringConvertible 프로토콜을 활용하여 숫자 입력을 처리하는 범용적인 뷰 헬퍼 함수를 만들 수 있습니다. 이렇게 하면 코드 중복을 줄이고 재사용성을 높일 수 있습니다.

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