Skip to content

feat(core): icon button useLegacyInteractionLayer 하위 호환성 대응 - #640

Merged
Sh031224 merged 2 commits into
feature/4.0.0from
feature/sh031224/WRP-2919
Sep 16, 2026
Merged

Sh031224 merged 2 commits into
feature/4.0.0from
feature/sh031224/WRP-2919

Conversation

@Sh031224

@Sh031224 Sh031224 commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

IconButtonuseLegacyInteractionLayer prop을 추가합니다. normal variant에서 3.x 레이아웃을 복원하는 호환 옵션입니다.

  • size={number}는 아이콘 크기로 적용되고 박스도 아이콘과 같은 크기 → 레이아웃 footprint가 3.x와 동일
  • 문자열 size는 프리셋의 아이콘 크기가 박스 (xlarge 24 기본, large 20, medium 18, small 16)
  • 인터랙션 레이어와 radius는 4.0 사이즈 정책의 짝 박스 값(24 → 36 / radius 10 등)으로 레이아웃 바깥에 겹쳐 그려짐. 레이어는 24와 아이콘 크기보다 작아지지 않음
  • 다른 variant에서는 무시 (size가 원래부터 박스 크기)

부수 변경

  • ICON_SIZE_RATIO / RADIUS_RATIOconstants.ts로 이동, 역산 헬퍼 legacyBoxForIcon 추가 (프리셋 4개를 정확히 재현하는지 불변 테스트로 보장)
  • docs Icon button 페이지에 Legacy interaction layer 섹션 추가 (사이즈 슬라이더 비교 데모, PushBadge 조합 예시)
  • MIGRATION.md IconButton에 size 의미 변경(아이콘 → 박스) 절 추가 및 escape hatch 안내
  • 시각 테스트 픽스처 LegacyNormalIconButton 추가 (새 스냅샷은 visual-test-update.yml로 생성 필요)

Type of Change

  • New feature
  • Bug fix
  • Refactoring
  • Documentation
  • Other

Checklist

  • Changes do not break existing functionality (옵션 미사용 시 기존 4.0 동작 그대로, pnpm vitest run packages/core 전체 통과)
  • Added or updated relevant tests (icon-button/index.test.tsx 44 passed: 프리셋/숫자/WCAG 하한/최대 토큰 초과/다른 variant 무시/불변식)
  • Lint and build pass successfully (eslint / tsc 클린)

Related Issues

  • WRP-2919 — [WDS] Icon Button useLegacyInteractionLayer 속성 추가 (3.x 레이아웃 호환) · 열림 · 작업
  • Relates: WRP-802 (디자인시스템 4.0.0)

Test plan

  • docs Icon button → Legacy interaction layer 데모에서 점선 footprint가 아이콘 크기이고 hover 시 레이어가 바깥으로 그려지는지 확인
  • 같은 섹션 With push badge에서 배지가 아이콘 모서리에 정렬되는지 확인
  • CI 시각 테스트 실패 시 gh workflow run visual-test-update.yml --ref feature/sh031224/WRP-2919LegacyNormalIconButton 스냅샷 생성

🤖 Generated with Claude Code

Summary by CodeRabbit

  • 변경 사항
    • IconButtonnormal 변형에서 size가 아이콘 크기가 아닌 버튼 박스 크기를 기준으로 동작합니다.
    • 숫자 및 문자열 크기에 따른 아이콘, 박스, 모서리 반경 매핑이 새 기준으로 적용됩니다.
    • 기존 레이아웃이 필요한 경우 useLegacyInteractionLayer 옵션으로 이전 동작을 사용할 수 있습니다.
    • 레거시 레이아웃의 크기별 동작과 배지 상호작용에 대한 문서 및 예제가 추가되었습니다.

…아웃 호환)

https://wantedlab.atlassian.net/browse/WRP-2919
4.0.0에서 normal variant의 size가 아이콘 크기에서 박스 크기로 바뀌면서
인터랙션 레이어가 레이아웃 공간을 차지하게 됐다. 3.x 화면을 간격 조정 없이
옮길 수 있도록 size를 다시 아이콘 크기로 해석하고 인터랙션 레이어와
radius만 4.0 사이즈 정책의 짝 박스 값으로 레이아웃 바깥에 겹쳐 그리는
호환 옵션을 추가한다. 문자열 size는 프리셋의 아이콘 크기를 박스로 쓴다.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Sh031224 Sh031224 added this to the 4.0.0 milestone Sep 14, 2026
@Sh031224 Sh031224 self-assigned this Sep 14, 2026
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • tests/visual/__screenshots__/icon-button/LegacyNormalIconButton-chromium.png is excluded by !**/*.png

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 5bdd5a5c-7e73-4852-b418-c6f2aadbf7b6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 44b2d004-bee0-44f8-a251-747471e9a999

📥 Commits

Reviewing files that changed from the base of the PR and between 447e6ff and 27143bf.

📒 Files selected for processing (9)
  • MIGRATION.md
  • docs/data/components/actions/icon-button/web.mdx
  • packages/core/src/components/icon-button/constants.ts
  • packages/core/src/components/icon-button/helpers.ts
  • packages/core/src/components/icon-button/index.test.tsx
  • packages/core/src/components/icon-button/index.tsx
  • packages/core/src/components/icon-button/style.ts
  • packages/core/src/components/icon-button/types.ts
  • tests/visual/src/fixtures/icon-button.tsx

Included review availability: 4 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


Walkthrough

IconButtonnormal variant에 useLegacyInteractionLayer 옵션을 추가했습니다. 레거시 모드에서는 아이콘 크기와 상호작용 박스 크기를 পৃথ পৃথ하게 계산합니다. 관련 타입, 스타일, 테스트, 문서, 시각적 픽스처를 갱신했습니다.

Changes

IconButton 레거시 레이아웃

Layer / File(s) Summary
크기 계약과 레거시 박스 계산
packages/core/src/components/icon-button/constants.ts, packages/core/src/components/icon-button/helpers.ts, packages/core/src/components/icon-button/types.ts
variant별 아이콘 비율과 normal 반경 비율을 추가했습니다. legacyBoxForIcon이 최소 크기와 dimension 토큰을 기준으로 상호작용 박스 크기를 계산합니다. useLegacyInteractionLayer 타입과 설명을 추가했습니다.
IconButton 스타일 경로 연결
packages/core/src/components/icon-button/index.tsx, packages/core/src/components/icon-button/style.ts
새 옵션을 스타일 계산에 전달합니다. normal variant의 레거시 모드에서 아이콘 크기와 상호작용 박스·반경을 별도로 계산합니다.
검증과 사용 문서
packages/core/src/components/icon-button/index.test.tsx, MIGRATION.md, docs/data/components/actions/icon-button/web.mdx, tests/visual/src/fixtures/icon-button.tsx
프리셋, 숫자 크기, 최대 크기, 접근성, 다른 variant의 무시 동작을 검증합니다. 마이그레이션 문서와 레거시 모드 데모 및 시각적 테스트 픽스처를 추가했습니다.

Priority: ⬇️ Low

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

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant IconButton
  participant iconButtonStyle
  participant legacyBoxForIcon
  IconButton->>iconButtonStyle: useLegacyInteractionLayer 전달
  iconButtonStyle->>legacyBoxForIcon: normal 아이콘 크기 전달
  legacyBoxForIcon-->>iconButtonStyle: 상호작용 박스 크기 반환
  iconButtonStyle-->>IconButton: 아이콘 및 레이어 스타일 적용
Loading

Merge Risk: ⚪ Minimal · up to 27143

The compatibility option preserves the intended legacy icon-and-overlay sizing behavior while leaving other variants unchanged. No actionable merge risk was identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 7…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 IconButtonuseLegacyInteractionLayer를 추가하여 하위 호환성을 지원하는 주요 변경 사항을 정확히 요약합니다.
✨ 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 feature/sh031224/WRP-2919

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

@montage-web-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
@montage-ui/core 2.49 KB (0%)
@montage-ui/icon 3.96 KB (0%)
@montage-ui/lottie 68 B (0%)
@montage-ui/theme 156 B (0%)
@montage-ui/engine 324 B (0%)
@montage-ui/nextjs 149 B (0%)

@montage-web-actions

montage-web-actions Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

🚀 Preview

Last commitc2766f0
Preview URLhttps://dev-montage.wanted.co.kr/c2766f0

@Sh031224 Sh031224 changed the title feat(core): icon button useLegacyInteractionLayer 추가 (3.x 레이아웃 호환) feat(core): icon button useLegacyInteractionLayer 하위 호환성 대응 Sep 15, 2026
@Sh031224
Sh031224 merged commit 4bffd67 into feature/4.0.0 Sep 16, 2026
12 checks passed
@Sh031224
Sh031224 deleted the feature/sh031224/WRP-2919 branch September 16, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant