Skip to content

feat(IconButton): spec 정합 — 박스 토큰화·hit area 정책·색상 갱신#494

Open
dididoeun wants to merge 1 commit into
release/4.0.0from
feat/WRP-887-icon-button-update
Open

feat(IconButton): spec 정합 — 박스 토큰화·hit area 정책·색상 갱신#494
dididoeun wants to merge 1 commit into
release/4.0.0from
feat/WRP-887-icon-button-update

Conversation

@dididoeun
Copy link
Copy Markdown
Collaborator

@dididoeun dididoeun commented May 28, 2026

Summary

Confluence IconButton 스펙 (4.0.0 기준, 2026-05-28 change log)에 맞춰 iOS IconButton의 박스·패딩·반경·색상 정책을 갱신합니다. 지라: WRP-887.

Changes

normal variant

  • 박스 크기 = nearestDimensionToken(icon × 1.5, tie→up), WCAG 2.2 SC 2.5.8 보장(box ≥ 24).
  • corner radius = nearestRadiusToken(box × 0.3, tie→down).
  • xlarge box: 40 → 36으로 축소(스펙 정합).
  • interactionExpansion 제거 → hit area = container 100%.
size icon box radius
small 16 24 8
medium 18 28 8
large 20 32 10
xlarge 24 36 10

background variant

  • 박스 크기 = nearestDimensionToken(icon × 1.5), pill.
  • 기본 icon 24 → 20으로 변경, case background(size: Int = 20, isAlternative: Bool = false) default 인자 지원.
  • 글래스 레이어(regularMaterial)는 컨테이너 전체를 채움.
  • icon color: alternative staticWhite@0.88 / 기본 coolNeutral50@0.61 (0.74→0.61).

outlined / solid variant

  • 컨테이너 크기 지정 모델로 통일.
  • small 32×32 / icon 16 / padding 8, medium 40×40 / icon 18 / padding 11.
  • custom(N): box = max(24, N) (WCAG clamp), icon = box − 12, padding 6.

Disabled

  • outlined 배경: .clearsemantic.backgroundNormal.
  • solid 배경: semantic.fillNormal@0.08semantic.fillNormal.
  • background icon: coolNeutral50@0.22 (변경 없음).

Blueprint Preview

  • customSize 기본값 24 → 20 (background 새 default 반영).
  • debug frame 토글 추가 — normal variant의 transparent 박스(1.5배) 영역을 빨간 외곽선으로 시각화하는 검증용 도구.

문서

  • documentation/components/actions/iconbutton/ios.md 자동 갱신.
  • packages/montage-mcp/data/components.json 자동 갱신.

Test plan

  • xcodebuild -workspace Montage.xcworkspace -scheme Montage build 통과
  • xcodebuild -workspace Montage.xcworkspace -scheme Blueprint build 통과
  • make 실행으로 문서/MCP 데이터 갱신 (verify-docs 통과 예상)
  • iPhone 17 시뮬레이터에서 Blueprint 앱 실행 확인
  • 리뷰어: normal small/medium/large/xlarge 박스가 각 24/28/32/36인지 debug frame 토글로 확인
  • 리뷰어: background 기본(.background()) 호출이 size=20으로 동작하는지 확인
  • 리뷰어: outlined/solid custom(N<24)이 24로 clamp되는지 확인
  • 리뷰어: 각 variant disabled 색상이 위 표대로인지 확인

🤖 Generated with Claude Code

- normal: 박스 = nearestDimensionToken(icon × 1.5, tie→up), WCAG 24 clamp.
  corner radius = nearestRadiusToken(box × 0.3, tie→down). xlarge box 40→36.
- background: 박스 = nearestDimensionToken(icon × 1.5). 기본 icon 24→20,
  `.background()` default 인자 지원. 글래스 레이어 컨테이너 채움.
- outlined/solid: 컨테이너 크기 지정 모델. small 32 / medium 40 /
  custom(N)은 max(24, N), icon = box − 12. WCAG 24 clamp.
- disabled: outlined 배경 `.backgroundNormal`, solid 배경 `.fillNormal`,
  background icon coolNeutral50@0.22.
- interaction expansion 제거 → hit area = container 100%.
- Blueprint Preview에 debug frame 토글 추가(시각 검증용),
  background customSize 기본값 20으로 동기화.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dididoeun dididoeun requested a review from a team as a code owner May 28, 2026 07:09
@dididoeun dididoeun requested review from deholic and removed request for a team May 28, 2026 07:09
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 28, 2026

Review Change Stack

Summary by CodeRabbit

릴리스 노트

  • New Features

    • 아이콘 버튼 미리보기에 디버그 프레임 표시 기능 추가
  • Bug Fixes

    • 아이콘 버튼의 배경 variant 크기 기본값 조정
    • 히트 영역 정책 개선
  • Documentation

    • 아이콘 버튼 컴포넌트 문서 상세화 (variant별 크기 산출 규칙 명시)
    • 한국어 포함 로컬라이제이션 문자열 추가 및 갱신

Walkthrough

IconButton 컴포넌트의 크기 계산 모델을 재설계하고 ZStack 기반 레이아웃으로 전환합니다. Variant API에 기본값을 추가하고, 프리뷰에 디버그 프레임 도구를 제공하며, 문서와 로컬라이제이션을 업데이트합니다.

Changes

IconButton 구조 재설계 및 기능 강화

Layer / File(s) Summary
Core 구조 및 body 재구성
Sources/Montage/1 Components/2 Actions/IconButton.swift
저장 프로퍼티 초기화(padding: .zero, 색상 기본값 nil)와 modifier 가드(showPushBadge.normal 전용)를 단순화합니다. body는 단일 뷰 체인에서 ZStack 기반으로 전환하고, 통일된 크기 값(resolvedContainerSize, resolvedIconSize, resolvedCornerRadius)으로 배경/테두리/아이콘을 배치하며, 기존의 interactionExpansion/interactionShape 중심 계산을 제거하고 clipShape/contentShape로 경계를 정리합니다.
Variant API 및 Size 모델 시스템
Sources/Montage/1 Components/2 Actions/IconButton.swift
Variant.background에 size 기본값(20) 추가하고, 새로운 Size enum을 도입합니다. IconButton.Variant 확장 computed 속성(containerSize, iconSize, cornerRadius, borderWidth, 색상)을 token 기반 보정(nearestDimensionToken, nearestRadiusToken)과 함께 재구현하고, 기존의 backgroundOffset/interactionExpansion/interactionShape 기반 로직을 제거합니다.
프리뷰 디버그 프레임 기능
Sources/Blueprint/Sources/Scene/Previews/IconButtonPreview.swift
customSize 기본값을 24에서 20으로 변경하고, showDebugFrame 상태 변수를 추가합니다. 아이콘 버튼 렌더 영역에 .overlay를 추가하여 활성화 시 빨간 반투명 테두리를 표시하고, "debug frame" 토글 UI를 구현합니다.
문서 및 API 레퍼런스 업데이트
documentation/components/actions/iconbutton/ios.md
Variant별 크기 산출 규칙(normal: 아이콘 기반 및 최소 24×24, outlined/solid: 컨테이너 기반 및 아이콘 box − 12)과 hit area 정책(컨테이너와 동일)을 명시합니다. 메서드 variant 지원 범위 노트를 수정하고, Size/NormalSize/Variant 열거형 정의 및 파라미터 설명을 재작성합니다.
로컬라이제이션 및 메타데이터
Sources/Montage/Asset/Localizable.xcstrings, packages/montage-mcp/data/components.json
Localizable.xcstrings에 format string(%1$@ %2$@, %1$@ %2$lld) 및 한국어 UI 문구 추가/업데이트합니다. components.json의 API 요약 텍스트(padding, NormalSize, Size)를 변경된 크기 정책에 맞춰 업데이트합니다.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • wanteddev/montage-ios#485: 주 PR과 마찬가지로 IconButton.swiftIconButton.Variant/NormalSize 기반 크기 모델과 IconButtonPreview.swift의 normal-size/custom-size 동작을 수정하는 코드 레벨의 직접적인 관련성이 있습니다.

Suggested labels

accepted, AI Review Completed

Suggested reviewers

  • knine79
  • jhseo
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경사항을 명확하게 반영하고 있습니다: IconButton의 박스 토큰화, hit area 정책, 색상 갱신이 핵심 변경사항이며 제목에 잘 요약되어 있습니다.
Description check ✅ Passed PR 설명이 변경사항과 명확하게 관련되어 있으며, 자세한 스펙 변경 내용, 테스트 계획, JIRA 링크를 포함하고 있습니다.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 feat/WRP-887-icon-button-update

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.

Actionable comments posted: 1

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

Inline comments:
In `@packages/montage-mcp/data/components.json`:
- Line 1050: 요약 문자열에 선행 특수문자 '·'가 포함되어 있어 문서에 오타로 노출됩니다;
packages/montage-mcp/data/components.json에서 해당 항목의 "summary" 값(현재 "· variant의
컨테이너 사이즈를 결정하는 열거형입니다.")을 찾아 선행 '·' 및 불필요한 공백을 제거하여 "variant의 컨테이너 사이즈를 결정하는
열거형입니다."로 변경해 주세요.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 398a0414-8024-4898-bc29-29ed93de4035

📥 Commits

Reviewing files that changed from the base of the PR and between bc957dd and 108988f.

📒 Files selected for processing (5)
  • Sources/Blueprint/Sources/Scene/Previews/IconButtonPreview.swift
  • Sources/Montage/1 Components/2 Actions/IconButton.swift
  • Sources/Montage/Asset/Localizable.xcstrings
  • documentation/components/actions/iconbutton/ios.md
  • packages/montage-mcp/data/components.json

"name": "IconButton.Size",
"kind": "enum",
"summary": "버튼 사이즈를 결정하는 열거형입니다.",
"summary": "· variant의 컨테이너 사이즈를 결정하는 열거형입니다.",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

요약 문구 선행 특수문자 제거 필요

Line 1050의 ·는 문서 노출 시 오타처럼 보입니다. 불필요한 선행 문자는 제거해 주세요.

수정 제안
-          "summary": "· variant의 컨테이너 사이즈를 결정하는 열거형입니다.",
+          "summary": "variant의 컨테이너 사이즈를 결정하는 열거형입니다.",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"summary": "· variant의 컨테이너 사이즈를 결정하는 열거형입니다.",
"summary": "variant의 컨테이너 사이즈를 결정하는 열거형입니다.",
🤖 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 `@packages/montage-mcp/data/components.json` at line 1050, 요약 문자열에 선행 특수문자 '·'가
포함되어 있어 문서에 오타로 노출됩니다; packages/montage-mcp/data/components.json에서 해당 항목의
"summary" 값(현재 "· variant의 컨테이너 사이즈를 결정하는 열거형입니다.")을 찾아 선행 '·' 및 불필요한 공백을 제거하여
"variant의 컨테이너 사이즈를 결정하는 열거형입니다."로 변경해 주세요.

@github-actions github-actions Bot added the in review This issue requires a review. label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in review This issue requires a review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant