Skip to content

[Refactor/#225] 디자인 시스템 타이포그래피 구조 개선#226

Open
wjdrjs00 wants to merge 2 commits into
developfrom
refactor/#225-typography-structure
Open

[Refactor/#225] 디자인 시스템 타이포그래피 구조 개선#226
wjdrjs00 wants to merge 2 commits into
developfrom
refactor/#225-typography-structure

Conversation

@wjdrjs00

@wjdrjs00 wjdrjs00 commented Jul 14, 2026

Copy link
Copy Markdown
Member

[ PR Content ]

디자인 시스템 타이포그래피의 구조를 개선합니다. 공개 토큰 이름 38개와 dp 기반 폰트 크기 정책은 그대로 유지되며, feature 모듈 호출부 변경은 없습니다.

Related issue

Screenshot 📸

UI 변경 없음 (렌더링 결과 동일)

Work Description

  • BitnagilTypography 재작성: getter 38개가 접근할 때마다 TextStyle을 새로 만들던 구조를, 생성자에서 Density를 받아 38개를 미리 계산해 val로 보관하는 구조로 변경했습니다. 토큰 접근이 단순 필드 읽기가 되어 리컴포지션마다 발생하던 객체 할당·단위 변환이 제거됩니다.
  • 스타일 정의 단순화: Regular 1줄 + 웨이트 변형 copy 1줄 패턴으로, 스타일 추가 시 수정 지점이 3곳 → 1곳이 됩니다.
  • BitnagilTextStyle.kt 삭제: 스펙 클래스와 dp 변환 헬퍼를 Type.kt의 textStyle() 헬퍼로 흡수했습니다. 미사용이던 toSpTextStyle(dp 정책에 어긋나는 sp 변환 선택지)도 함께 제거됩니다.
  • Theme.kt: 아무 효과 없던 LocalBitnagilTypography provides LocalBitnagilTypography.currentremember(density) { BitnagilTypography(density) } 실제 주입으로 교체했습니다. 시스템 글꼴 크기 변경 시 자동 재계산됩니다.
  • MainActivity: 콘텐츠를 BitnagilTheme으로 래핑했습니다. 기존에는 BitnagilTheme이 프로덕션에서 한 번도 적용되지 않고 있었는데(사용처 전부 프리뷰), 새 구조에서는 테마 미적용 시 fontScale=1 폴백이 쓰여 dp 고정 정책이 깨지므로 루트 래핑으로 유지시켰습니다.

To Reviewers 📢

  • LocalBitnagilTypography 기본값을 Density(1f) 폴백 인스턴스로 둔 것은 BitnagilTheme으로 감싸지 않은 기존 프리뷰(80여 개 파일)를 깨뜨리지 않기 위함입니다. 프리뷰 기본 fontScale=1에서는 기존과 동일하게 렌더링됩니다.
  • 앞으로 새 Activity/ComposeView 진입점을 추가할 때는 BitnagilTheme 래핑이 필요합니다. 미적용 시 컴파일은 되지만 해당 트리의 텍스트가 시스템 글꼴 크기의 영향을 받게 됩니다.
  • 검증: :core:designsystem/:presentation/:app 컴파일, assembleDebug, ktlintCheck 통과. LocalDensity provides 오버라이드가 프로젝트에 없음을 확인했습니다. 실기기에서 시스템 글꼴 크기 변경 시 텍스트 크기 불변 확인을 함께 부탁드립니다.

Summary by CodeRabbit

  • 개선 사항
    • 앱 화면 전반에 Bitnagil 테마가 일관되게 적용됩니다.
    • 기기 화면 밀도에 맞춰 글꼴 크기와 줄 간격이 보다 정확하게 표시됩니다.
    • 다양한 텍스트 스타일이 안정적으로 적용되어 화면 가독성이 향상됩니다.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

앱 루트에 BitnagilTheme을 적용하고, density 기반으로 TextStyle을 미리 생성·제공하는 타이포그래피 구조로 변경했습니다. 기존 BitnagilTextStyle 구현과 변환 접근자는 제거되었습니다.

Changes

타이포그래피 및 테마 적용

Layer / File(s) Summary
Density 기반 타이포그래피 생성
core/designsystem/.../typography/Type.kt, core/designsystem/.../typography/BitnagilTextStyle.kt
BitnagilTypography가 density를 받아 TextStyle을 직접 생성하며, 기본 provider가 새 생성자를 사용합니다. 기존 BitnagilTextStyle과 변환 로직은 삭제되었습니다.
테마 제공 및 앱 루트 적용
core/designsystem/.../Theme.kt, app/src/main/java/com/threegap/bitnagil/MainActivity.kt
BitnagilTheme이 현재 density 기반 typography를 생성해 CompositionLocal에 제공하고, MainActivity 콘텐츠를 해당 테마로 감쌉니다.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Poem

당근 든 토끼가 폴짝, 새 글꼴 길을 열었네
density 따라 TextStyle, 한 번만 태어나네
테마 품에 쏙 들어가
앱 화면도 함께 웃네
깡총! 디자인이 가벼워졌네

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed 제목이 타이포그래피 구조 개선과 관련되어 있어 변경 사항의 핵심을 잘 요약합니다.
Description check ✅ Passed 필수 섹션인 Related issue, Screenshot, Work Description, To Reviewers를 모두 포함해 템플릿을 대부분 충족합니다.
Linked Issues check ✅ Passed #225의 핵심 요구사항인 Typography 재작성, BitnagilTextStyle 삭제, Theme 주입, MainActivity 래핑이 반영되었습니다.
Out of Scope Changes check ✅ Passed 요구사항과 무관한 변경은 보이지 않으며 모든 수정이 타이포그래피 구조 개선 범위에 있습니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/#225-typography-structure

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

Comment @coderabbitai help to get the list of available commands.

@wjdrjs00 wjdrjs00 self-assigned this Jul 14, 2026
@wjdrjs00 wjdrjs00 added the 🔨 Refactor 기존 기능 개선 label Jul 14, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/typography/Type.kt (1)

17-33: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

textStyle() 헬퍼 구현 확인.

Dp.toSp()fontScale에만 의존해 변환되므로(density.density와 무관), 시스템 폰트 배율이 바뀌어도 실제 렌더링 크기는 dp 값 그대로 유지됩니다. Theme.ktremember(density)와 결합해 fontScale 변경 시에만 재계산되는 구조도 올바릅니다. 다만 이 division-only 동작은 비직관적일 수 있어, 향후 유지보수자가 오해하지 않도록 간단한 주석을 남기는 것도 좋을 것 같습니다.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/typography/Type.kt`
around lines 17 - 33, In the textStyle() helper, add a brief comment documenting
that converting the typography dimensions with Dp.toSp() intentionally depends
on fontScale rather than display density, so rendered text sizes remain based on
the dp values while responding to system font scaling. Keep the existing
conversion logic and Theme.kt recomposition behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/typography/Type.kt`:
- Around line 17-33: In the textStyle() helper, add a brief comment documenting
that converting the typography dimensions with Dp.toSp() intentionally depends
on fontScale rather than display density, so rendered text sizes remain based on
the dp values while responding to system font scaling. Keep the existing
conversion logic and Theme.kt recomposition behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad3600f7-10c4-49c8-af9a-da4596012fc8

📥 Commits

Reviewing files that changed from the base of the PR and between d70c57c and 58fd629.

📒 Files selected for processing (4)
  • app/src/main/java/com/threegap/bitnagil/MainActivity.kt
  • core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/Theme.kt
  • core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/typography/BitnagilTextStyle.kt
  • core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/typography/Type.kt
💤 Files with no reviewable changes (1)
  • core/designsystem/src/main/java/com/threegap/bitnagil/designsystem/typography/BitnagilTextStyle.kt

@wjdrjs00
wjdrjs00 requested a review from l5x5l July 14, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 Refactor 기존 기능 개선 🧤 대현

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REFACTOR] 디자인 시스템 타이포그래피 구조를 개선합니다.

1 participant