Skip to content

Design/#9 - DVDesign Typography 토큰 정의#10

Open
doyeonk429 wants to merge 2 commits into
developfrom
design/#9/fonts-세팅

Hidden character warning

The head ref may contain hidden characters: "design/#9/fonts-\uc138\ud305"
Open

Design/#9 - DVDesign Typography 토큰 정의#10
doyeonk429 wants to merge 2 commits into
developfrom
design/#9/fonts-세팅

Conversation

@doyeonk429
Copy link
Copy Markdown
Contributor

@doyeonk429 doyeonk429 commented May 11, 2026

✨ What’s this PR?

📌 관련 이슈 (Related Issue)


🧶 주요 변경 내용 (Summary)

  • DVDesign/Sources/Foundations/Fonts/ 하위에 Typography 디자인 토큰 추가
  • DVFont enum: Display / Heading / Body / Caption 4개 카테고리, 총 9개 토큰 정의 (size · weight · lineHeight 포함)
  • Font.dv(_:) static 헬퍼 및 View.dvFont(_:) modifier 추가 (line-height 자동 적용)
  • 디렉토리 트래킹용 PlaceholderC.swift 제거
  • 샘플 앱에 TypographyPreviewView 추가 — Foundation 섹션에서 9개 토큰을 한국어 팬그램으로 미리보기

정의된 토큰

Category Token Size Weight Line Height
Display displayBrand 28 Bold 114%
Heading headingXL 22 Semibold 136%
Heading headingLG 18 Semibold 111%
Body bodyXL 16 Medium 120%
Body bodyLG 15 Medium 106%
Body bodyMD 13 Medium 123%
Caption captionLG 12 Semibold 119%
Caption captionMDSemibold 11 Semibold 118%
Caption captionMDRegular 11 Regular 118%

📸 스크린샷 (Optional)

스크린샷 2026-05-11 오후 11 28 21

🧪 테스트 / 검증 내역

  • tuist generate 후 DVDesign 모듈 빌드 성공
  • DVDesignSampleApp 실행 → Typography 화면에서 9개 토큰이 스펙대로 렌더링되는지 확인
  • My Mac, macOS 14+ 환경에서 정상 동작

💬 기타 공유 사항

  • SF Pro는 시스템 폰트이므로 .system(size:weight:) API로 처리 — 별도 폰트 파일 등록 불필요
  • SwiftUI .lineSpacing은 줄 추가 간격만 제어하므로 단일 라인에서는 시각적 차이가 없습니다. 멀티라인일 때 디자인 스펙(예: 22px/136%)에 맞춰 줄간격이 벌어집니다

🙇🏻‍♀️ 리뷰 가이드

  • DVFont.swift의 토큰 네이밍 컨벤션 ({category}{Size} / {category}{Size}{Weight})
  • View+DVFont.swift의 line-height 적용 방식 (.lineSpacing + 수직 padding 보정)

Summary by CodeRabbit

  • New Features

    • Added typography showcase view displaying font styles with visual metrics (size, line height ratio) organized by categories.
    • Introduced a font token system enabling consistent typography application across the application.
    • Added a typography modifier for simplified font application to views.
  • Refactor

    • Updated list construction pattern in sample app navigation.

Review Change Stack

- DVFont enum으로 Display/Heading/Body/Caption 9개 토큰 정의
- Font.dv(_:) / View.dvFont(_:) 헬퍼 추가
@doyeonk429 doyeonk429 requested review from dlguszoo and yeseonglee May 11, 2026 14:29
@doyeonk429 doyeonk429 self-assigned this May 11, 2026
@doyeonk429 doyeonk429 added the 🎨 Design UI 디자인 작업 label May 11, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: String must contain at most 250 character(s) at "tone_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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
📝 Walkthrough

Walkthrough

This PR establishes a typography design system foundation by introducing a DVFont enum that tokenizes all font styles with computed properties for size, weight, and line-height metrics. SwiftUI extensions provide factory methods and a view modifier for applying tokens consistently. A new preview view in the sample app showcases all available typography tokens grouped by semantic category.

Changes

Typography Design System Foundation

Layer / File(s) Summary
Font Token Definition
Projects/DVDesign/Sources/Foundations/Fonts/DVFont.swift
DVFont public enum with cases for display, heading, body, and caption styles. Computed properties define size, weight (mapped to Font.Weight), lineHeightRatio, lineHeight, lineSpacing (derived as max of line-height minus size for proper text spacing), and font (SwiftUI Font factory).
Font and View Extensions
Projects/DVDesign/Sources/Foundations/Fonts/Font+DVFont.swift, Projects/DVDesign/Sources/Foundations/Fonts/View+DVFont.swift
Font.dv(_:) static factory returns the SwiftUI Font from a token. View.dvFont(_:) modifier applies font, line spacing, and vertical padding based on token metrics.
Sample App Structure
Projects/DVDesign/SampleApp/Sources/ContentView.swift
Adds copyright header, imports DVDesign, and refactors NavigationSplitView List to use nested ForEach for component sections.
Typography Preview
Projects/DVDesign/SampleApp/Sources/TypographyPreviewView.swift
New SwiftUI view groups DVFont tokens by semantic category (Display, Heading, Body, Caption), displays each token with sample text styled via dvFont(), and shows computed metrics (size in px, line-height ratio as percentage). Helper methods organize layout and token rows.
Directory Cleanup
Projects/DVDesign/Sources/Foundations/PlaceholderC.swift
Removes directory tracking comment.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • yeseonglee
  • dlguszoo

Poem

🐰 Fonts aligned with grace so true,
Typography tokens, shiny and new,
Line heights computed, spacing precise,
Design system foundations—oh, how nice!
View modifiers simplify the way,
Your text will sing in perfect display!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding DVDesign Typography tokens, which is the primary objective of this PR.
Linked Issues check ✅ Passed The PR implements all coding objectives from issue #9: DVFont enum with 9 tokens, Font.dv() helper, View.dvFont() modifier, and TypographyPreviewView for sample app demonstration.
Out of Scope Changes check ✅ Passed All changes directly support the typography token system implementation and sample app preview. PlaceholderC.swift removal is a necessary cleanup for directory structure.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 design/#9/fonts-세팅

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

Copy link
Copy Markdown

@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.

🧹 Nitpick comments (1)
Projects/DVDesign/SampleApp/Sources/ContentView.swift (1)

9-24: 💤 Low value

Consider unifying the Foundation section with the ComponentSection enum pattern.

The hardcoded "Foundation" section works correctly, but it creates a slight architectural inconsistency since other sections use the ComponentSection enum. You could optionally add a .foundation case to ComponentSection and define its components there (e.g., Component(name: "Typography", owner: "Foundation")), which would make the data model more uniform and easier to extend in the future.

That said, the current implementation is clear and functional—this is purely a structural suggestion that can be deferred.

🤖 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 `@Projects/DVDesign/SampleApp/Sources/ContentView.swift` around lines 9 - 24,
Unify the hardcoded Foundation section by adding a .foundation case to the
ComponentSection enum and include its components (e.g., Component(name:
"Typography", owner: "Foundation")); then replace the standalone
Section("Foundation") + NavigationLink to TypographyPreviewView with the
existing ForEach over ComponentSection (so
TypographyPreviewView/ComponentPlaceholderView are created from the enum's
data), ensuring ComponentSection.allCases now yields .foundation and its
components.
🤖 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 `@Projects/DVDesign/SampleApp/Sources/ContentView.swift`:
- Around line 9-24: Unify the hardcoded Foundation section by adding a
.foundation case to the ComponentSection enum and include its components (e.g.,
Component(name: "Typography", owner: "Foundation")); then replace the standalone
Section("Foundation") + NavigationLink to TypographyPreviewView with the
existing ForEach over ComponentSection (so
TypographyPreviewView/ComponentPlaceholderView are created from the enum's
data), ensuring ComponentSection.allCases now yields .foundation and its
components.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 87261125-6848-4547-87b9-7266dd0013eb

📥 Commits

Reviewing files that changed from the base of the PR and between d9d8484 and 39b6e31.

📒 Files selected for processing (6)
  • Projects/DVDesign/SampleApp/Sources/ContentView.swift
  • Projects/DVDesign/SampleApp/Sources/TypographyPreviewView.swift
  • Projects/DVDesign/Sources/Foundations/Fonts/DVFont.swift
  • Projects/DVDesign/Sources/Foundations/Fonts/Font+DVFont.swift
  • Projects/DVDesign/Sources/Foundations/Fonts/View+DVFont.swift
  • Projects/DVDesign/Sources/Foundations/PlaceholderC.swift
💤 Files with no reviewable changes (1)
  • Projects/DVDesign/Sources/Foundations/PlaceholderC.swift

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎨 Design UI 디자인 작업

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Design: DesignSystem Fonts foundation 세팅

2 participants