-
Notifications
You must be signed in to change notification settings - Fork 1
[Refactor] 수정된 디자인 시스템 반영 #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -15,19 +15,6 @@ enum BitnagilColor { | |||||||||||||||||||||||||||||||||
| static let kakao = UIColor(named: "Kakao", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let error = UIColor(named: "Error", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // MARK: - Gradient | ||||||||||||||||||||||||||||||||||
| static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // MARK: - Emotion Colors | ||||||||||||||||||||||||||||||||||
| static let happy = UIColor(named: "EmotionHappy", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let lethargy = UIColor(named: "EmotionLethargy", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let lonely = UIColor(named: "EmotionLonely", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let sad = UIColor(named: "EmotionSad", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let anxiety = UIColor(named: "EmotionAnxiety", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // MARK: - Gray Colors | ||||||||||||||||||||||||||||||||||
| static let gray5 = UIColor(named: "Gray5", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let gray7 = UIColor(named: "Gray7", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
|
|
@@ -46,6 +33,26 @@ enum BitnagilColor { | |||||||||||||||||||||||||||||||||
| static let gray98 = UIColor(named: "Gray98", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let gray99 = UIColor(named: "Gray99", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // MARK: - Orange Colors | ||||||||||||||||||||||||||||||||||
| static let orange25 = UIColor(named: "Orange25", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange50 = UIColor(named: "Orange50", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange100 = UIColor(named: "Orange100", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange200 = UIColor(named: "Orange200", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange300 = UIColor(named: "Orange300", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange400 = UIColor(named: "Orange400", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange500 = UIColor(named: "Orange500", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange600 = UIColor(named: "Orange600", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange700 = UIColor(named: "Orange700", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange800 = UIColor(named: "Orange800", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange900 = UIColor(named: "Orange900", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // TODO: 제거될 색상들 | ||||||||||||||||||||||||||||||||||
| // MARK: - Gradient | ||||||||||||||||||||||||||||||||||
| static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
|
Comment on lines
+49
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainTODO 경고 제거 및 단계적 제거를 위한 @available(deprecated) 적용 권고 SwiftLint TODO 경고가 발생합니다. 주석을 Deprecated 표기로 바꾸고 각 상수에 deprecate 어노테이션을 부여하면 마이그레이션 추적과 사용 억제가 좋아집니다. 아래 diff 제안: - // TODO: 제거될 색상들
- // MARK: - Gradient
- static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
- static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
- static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
- static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)
+ // MARK: - Deprecated: 제거 예정 색상들 (v1 전용)
+ // MARK: - Gradient
+ @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+ static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
+ @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+ static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
+ @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+ static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
+ @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+ static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)현재 사용처 파악을 위해 간단 스캔 스크립트도 첨부합니다. 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== Deprecated(Gradient) 사용처 스캔 =="
rg -n 'BitnagilColor\.(gradientLeft|gradientRight|homeGradientLeft|homeGradientRight)\b' -S || echo "사용처 없음(또는 스캔 결과 없음)"Length of output: 787 @available(deprecated) 적용 권고 및 사용처 안내 아래 색상 상수에 — 사용처 스캔 결과
아래와 같이 변경해 주세요: - // TODO: 제거될 색상들
- // MARK: - Gradient
- static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
- static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
- static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
- static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)
+ // MARK: - Deprecated: 제거 예정 색상들 (v1 전용)
+ // MARK: - Gradient
+ @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+ static let gradientLeft = UIColor(named: "GradientLeft", in: bundle, compatibleWith: nil)
+ @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+ static let gradientRight = UIColor(named: "GradientRight", in: bundle, compatibleWith: nil)
+ @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+ static let homeGradientLeft = UIColor(named: "HomeGradientLeft", in: bundle, compatibleWith: nil)
+ @available(*, deprecated, message: "v1 전용. v2 전체 UI 적용 후 제거 예정")
+ static let homeGradientRight = UIColor(named: "HomeGradientRight", in: bundle, compatibleWith: nil)이 변경 후 사용 위치에서 deprecation 경고를 확인하며 새로운 색상으로 교체를 진행해 주세요. 📝 Committable suggestion
Suggested change
🧰 Tools🪛 SwiftLint (0.57.0)[Warning] 49-49: TODOs should be resolved (제거될 색상들) (todo) 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| // MARK: - Navy Colors | ||||||||||||||||||||||||||||||||||
| static let navy50 = UIColor(named: "Navy50", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let navy100 = UIColor(named: "Navy100", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
|
|
@@ -70,16 +77,4 @@ enum BitnagilColor { | |||||||||||||||||||||||||||||||||
| static let lightBlue700 = UIColor(named: "LightBlue700", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let lightBlue800 = UIColor(named: "LightBlue800", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let lightBlue900 = UIColor(named: "LightBlue900", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| // MARK: - Orange Colors | ||||||||||||||||||||||||||||||||||
| static let orange50 = UIColor(named: "Orange50", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange100 = UIColor(named: "Orange100", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange200 = UIColor(named: "Orange200", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange300 = UIColor(named: "Orange300", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange400 = UIColor(named: "Orange400", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange500 = UIColor(named: "Orange500", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange600 = UIColor(named: "Orange600", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange700 = UIColor(named: "Orange700", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange800 = UIColor(named: "Orange800", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| static let orange900 = UIColor(named: "Orange900", in: bundle, compatibleWith: nil) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,33 +8,42 @@ | |||||||||||||||||||||||||||||||||||||
| import UIKit | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| struct BitnagilFont { | ||||||||||||||||||||||||||||||||||||||
| let family: FontFamily | ||||||||||||||||||||||||||||||||||||||
| let style: FontStyle | ||||||||||||||||||||||||||||||||||||||
| let weight: FontWeight | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| init(style: FontStyle, weight: FontWeight) { | ||||||||||||||||||||||||||||||||||||||
| init( | ||||||||||||||||||||||||||||||||||||||
| family: FontFamily = .pretendard, | ||||||||||||||||||||||||||||||||||||||
| style: FontStyle, | ||||||||||||||||||||||||||||||||||||||
| weight: FontWeight | ||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||
| self.family = family | ||||||||||||||||||||||||||||||||||||||
| self.style = style | ||||||||||||||||||||||||||||||||||||||
| self.weight = weight | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| init(fontSize: CGFloat, | ||||||||||||||||||||||||||||||||||||||
| lineHeight: CGFloat, | ||||||||||||||||||||||||||||||||||||||
| letterSpacing: CGFloat = 0, | ||||||||||||||||||||||||||||||||||||||
| underline: Bool = false, | ||||||||||||||||||||||||||||||||||||||
| weight: FontWeight | ||||||||||||||||||||||||||||||||||||||
| init( | ||||||||||||||||||||||||||||||||||||||
| family: FontFamily = .pretendard, | ||||||||||||||||||||||||||||||||||||||
| fontSize: CGFloat, | ||||||||||||||||||||||||||||||||||||||
| lineHeight: CGFloat, | ||||||||||||||||||||||||||||||||||||||
| letterSpacing: CGFloat = 0, | ||||||||||||||||||||||||||||||||||||||
| underline: Bool = false, | ||||||||||||||||||||||||||||||||||||||
| weight: FontWeight | ||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||
| let attributes = FontAttributes( | ||||||||||||||||||||||||||||||||||||||
| fontSize: fontSize, | ||||||||||||||||||||||||||||||||||||||
| lineHeight: lineHeight, | ||||||||||||||||||||||||||||||||||||||
| letterSpacing: letterSpacing, | ||||||||||||||||||||||||||||||||||||||
| underline: underline) | ||||||||||||||||||||||||||||||||||||||
| self.family = family | ||||||||||||||||||||||||||||||||||||||
| self.style = .custom(fontAttribute: attributes) | ||||||||||||||||||||||||||||||||||||||
| self.weight = weight | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| var font: UIFont { | ||||||||||||||||||||||||||||||||||||||
| guard let font = UIFont(name: weight.fontName, size: style.fontAttributes.fontSize) else { | ||||||||||||||||||||||||||||||||||||||
| return UIFont.systemFont(ofSize: style.fontAttributes.fontSize) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
| guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize) | ||||||||||||||||||||||||||||||||||||||
| else { return UIFont.systemFont(ofSize: style.fontAttributes.fontSize) } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
Comment on lines
43
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent ❓ Verification inconclusive폰트 로드 실패 시 조용한 폴백을 피하기 위한 ASSERT 추가 권장 잘못된 PS 이름/미등록 시, 현재는 시스템 폰트로 조용히 대체됩니다. DEBUG에서만이라도 실패를 감지하면 빠르게 수정 가능합니다. -guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize)
-else { return UIFont.systemFont(ofSize: style.fontAttributes.fontSize) }
+guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize) else {
+ #if DEBUG
+ assertionFailure("[Font] \(family).\(weight) 폰트 로드 실패. 시스템 폰트로 대체됩니다.")
+ #endif
+ return UIFont.systemFont(ofSize: style.fontAttributes.fontSize)
+}DEBUG 모드에서 폰트 로드 실패 시 경고(assertion) 추가 권장 현재 PS 폰트 이름이 잘못되었거나 등록되지 않은 경우 시스템 폰트로 조용히 대체되므로, 디버그 환경에서 빠르게 문제를 인지할 수 있도록
- guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize)
- else { return UIFont.systemFont(ofSize: style.fontAttributes.fontSize) }
+ guard let font = UIFont(name: family.fontName(weight: weight), size: style.fontAttributes.fontSize) else {
+ #if DEBUG
+ assertionFailure("[Font] \(family).\(weight) 폰트 로드 실패. 시스템 폰트로 대체됩니다.")
+ #endif
+ return UIFont.systemFont(ofSize: style.fontAttributes.fontSize)
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||
| return font | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,20 @@ | ||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||
| // FontFamily.swift | ||||||||||||||||||||||||||||||||||||||||||||
| // Presentation | ||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||
| // Created by 최정인 on 8/9/25. | ||||||||||||||||||||||||||||||||||||||||||||
| // | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| enum FontFamily { | ||||||||||||||||||||||||||||||||||||||||||||
| case pretendard | ||||||||||||||||||||||||||||||||||||||||||||
| case cafe24Ssurround | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| func fontName(weight: FontWeight) -> String { | ||||||||||||||||||||||||||||||||||||||||||||
| switch self { | ||||||||||||||||||||||||||||||||||||||||||||
| case .pretendard: | ||||||||||||||||||||||||||||||||||||||||||||
| return weight.pretendardFontName | ||||||||||||||||||||||||||||||||||||||||||||
| case .cafe24Ssurround: | ||||||||||||||||||||||||||||||||||||||||||||
| return weight.cafe24FontName | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+12
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 패밀리별 지원 weight 검증(ASSERT) 추가 권장
가능한 수정 예: case .cafe24Ssurround:
- return weight.cafe24FontName
+ if case .light = weight {
+ return weight.cafe24FontName
+ } else {
+ assertionFailure("[Font] Cafe24Ssurround는 현재 .light만 지원합니다. Pretendard-Regular로 폴백합니다.")
+ return FontFamily.pretendard.fontName(weight: .regular)
+ }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
브랜드 핵심 톤(Orange500) 접근성 대비 확인 권장
아래 스크립트로 #FE7120과 흰/검 텍스트 대비비를 계산할 수 있습니다:
결과가 본문 텍스트(AA: 4.5:1, 대형 텍스트: 3:1) 기준을 만족하는지 확인해 주세요.
🏁 Script executed:
Length of output: 57
Orange500 접근성 대비 결과 확인 및 개선 필요
검증 스크립트 실행 결과:
따라서 Orange500(#FE7120)을 전경(텍스트/아이콘) 또는 배경으로 사용할 때 다음을 반영해 주세요:
수정 위치:
🤖 Prompt for AI Agents