[CVW-046] 코인 디테일 화면 QTY, 가겨정보 텍스트 표현 변경#60
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves the coin detail screen by refining the display format for orderbook and recent trade quantities, and it adds a test module to verify the changes.
- Implements compact formatting logic (K/M/B notation) for numbers in the CVNumber data structure.
- Updates view configuration for better text scaling in orderbook cells.
- Introduces unit tests for the new numeric formatting logic.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Projects/Utils/CoreUtil/Tests/CVNumberTests.swift | Added tests for verifying the compact numeric formatting. |
| Projects/Utils/CoreUtil/Sources/DataStructure/CVNumber.swift | Implemented a new function for compacting numbers and refactored rounding methods. |
| Projects/Utils/CoreUtil/Project.swift | Added a new test target for CoreUtil. |
| Projects/Features/CoinDetail/Feature/Sources/Views/OrderbookCellView.swift | Adjusted UI properties for proper text scaling. |
| Projects/Features/CoinDetail/Feature/Sources/CoinDetailPageViewModel.swift | Updated the usage of numeric formatting in the view model. |
Comments suppressed due to low confidence (2)
Projects/Features/CoinDetail/Feature/Sources/CoinDetailPageViewModel.swift:209
- The parameter 'bigestQuantity' appears to be a misspelling; consider renaming it to 'biggestQuantity' for clarity.
func transform(bigestQuantity: CVNumber, orderbook: Orderbook, type: OrderbookType) -> OrderbookCellRO {
Projects/Utils/CoreUtil/Sources/DataStructure/CVNumber.swift:129
- [nitpick] The usage of hardcoded numeric limits (such as the value 5 for the character count) makes the logic harder to maintain. It would be beneficial to extract these magic numbers into named constants.
if let numString = formatter.string(from: base as NSNumber), numString.count <= 5 {
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경된 점
코인 디테일 화면 오더북, 최근거래정보 QTY, 가겨정보 텍스트 표현 변경
거래량에따라 텍스트 길이가 변해 정보확인에서 가시성이 떨어진다고 판단했습니다.
따라서 간소화 로직을 추가하여 표현의 가시성은 높이고 예상하지 못한 UI표현을 최소화 했습니다.
CoreUtil테스트 모듈 생성
수 간소화 로직은
CoreUtil모듈의CVNumber의 인스턴스 매서드로 구현했습니다.해당 로직의 경우 프로젝트 내 모든 영역에서 접근 가능함으로 테스트가 필수적이라고 판단했습니다.
따라서 테스트 모듈을 생성하고 확인이 필요한 케이스에 대한 검증을 진행했습니다.