Skip to content

추천 기능 UI에 맞게 컴포넌트들을 수정 / 구현합니다.#320

Open
pinocchio22 wants to merge 4 commits intodevfrom
fix/#315-Components
Open

추천 기능 UI에 맞게 컴포넌트들을 수정 / 구현합니다.#320
pinocchio22 wants to merge 4 commits intodevfrom
fix/#315-Components

Conversation

@pinocchio22
Copy link
Copy Markdown
Contributor

📌 이슈

✅ 작업 사항

로그인 유도 UI를 진입 경로에 따라 분기 처리할 수 있도록 수정

  • bookmark 진입 시 기존 북마크 유도 목적에 맞는 UI 노출
  • recommend 진입 시 추천 플로우에 맞는 안내 UI 노출
  • 동일 컴포넌트를 재사용하면서 타입 분기로 동작하도록 구조 개선

레벨 및 직업 입력 UI를 진입 경로에 따라 분기 처리할 수 있도록 수정

  • normal : 온보딩 / 마이페이지에서 사용하는 기본 입력 흐름
  • recommend : 추천 기능 진입 시 사용하는 입력 흐름
  • 진입 목적에 따라 타이틀 및 안내 문구가 다르게 표시되도록 수정

도감 리스트 셀에 랭킹 태그를 추가하기 위하여 CardList 및 TagChip 컴포넌트 수정

  • TagChip에 text 타입을 추가하여 랭킹 태그 표현 가능하도록 확장
  • CardList에 recommend 타입을 추가하여 추천 케이스 대응
  • 기존 UI에 영향 없이 확장 가능한 구조로 수정

Tooltip 표시를 위한 컴포넌트 및 Factory 구현

  • overlayView를 추가하여 외부 영역 터치 시 dismiss 되도록 처리
  • UIBezierPath를 사용하여 말풍선 형태 및 꼬리(arrow) 구현
  • 말풍선 방향(top/bottom, leading/trailing)에 따른 타입 분기 추가
  • anchorView 기준으로 화살표가 정렬되도록 위치 계산 로직 구현
  • 재사용 가능한 TooltipFactory 형태로 구성

+추가 : 기존 class 타입이었던 ToastFactory를 enum으로 변경하여 인스턴스 생성 방지 및 안정성 개선

특정 View를 기준으로 툴팁을 띄움
문자열 파라미터를 구체적인 타입으로 수정하여 사용성 증가
@pinocchio22 pinocchio22 requested a review from dongglehada April 9, 2026 09:34
@pinocchio22 pinocchio22 self-assigned this Apr 9, 2026
@pinocchio22 pinocchio22 added feat 새로운 기능을 추가 fix 버그 수정, 잔잔바리 수정, 병합 시 충돌 해결 labels Apr 9, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new Tooltip component to the design system, comprising TooltipView, TooltipOverlayView, and a TooltipFactory for management. It also refactors CharacterInputView and ToLoginView to utilize enums for better type safety and updates ToastFactory to an enum. The review feedback highlights opportunities to reduce code duplication regarding window access and hardcoded layout constants, optimize layer management in layoutSubviews, remove the unused TooltipArrowView file, and enhance the user experience by adding a fade-out animation during tooltip dismissal.

)

/// arrow는 툴팁 내부에서 고정 위치
let arrowInset: CGFloat = 28
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

arrowInset 값(28)은 TooltipFactory.swift의 61라인에서도 동일하게 사용되고 있습니다. 두 값이 일치하지 않을 경우 화살표의 위치와 툴팁의 배치가 어긋나는 버그가 발생할 수 있습니다. Constants 열거형에 공통 상수로 정의하여 두 파일에서 공유하도록 수정하는 것이 안전합니다.

Comment on lines +140 to +141
layer.sublayers?.removeAll(where: { $0 is CAShapeLayer })
layer.insertSublayer(shapeLayer, at: 0)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

layoutSubviews는 뷰의 레이아웃이 결정될 때마다 반복적으로 호출됩니다. 호출될 때마다 기존 레이어를 찾아 제거하고 새로운 CAShapeLayer를 생성하여 삽입하는 방식은 메모리 및 CPU 자원을 낭비하게 됩니다. 클래스 프로퍼티로 CAShapeLayer를 하나 유지하고, drawBubble에서는 해당 레이어의 path만 업데이트하도록 개선해 주세요.

Comment on lines +1 to +24
import UIKit

import SnapKit

final class TooltipArrowView: UIView {

override class var layerClass: AnyClass {
CAShapeLayer.self
}

override func layoutSubviews() {
super.layoutSubviews()

let path = UIBezierPath()
path.move(to: CGPoint(x: bounds.midX, y: bounds.maxY))
path.addLine(to: CGPoint(x: bounds.minX, y: bounds.minY))
path.addLine(to: CGPoint(x: bounds.maxX, y: bounds.minY))
path.close()

let shape = layer as! CAShapeLayer
shape.path = path.cgPath
shape.fillColor = UIColor.whiteMLS.cgColor
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

TooltipView 내부에서 UIBezierPath를 사용하여 직접 화살표를 그리고 있으므로, 이 TooltipArrowView 클래스는 현재 프로젝트 내에서 사용되지 않는 것으로 보입니다. 불필요한 파일은 제거하여 프로젝트 구조를 깔끔하게 유지하는 것이 좋습니다.

Comment on lines +11 to +16
static var window: UIWindow? {
UIApplication.shared
.connectedScenes
.flatMap { ($0 as? UIWindowScene)?.windows ?? [] }
.first { $0.isKeyWindow }
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

최상단 window를 찾는 로직이 ToastFactory.swift와 완전히 중복되어 구현되어 있습니다. 향후 윈도우 탐색 로직이 변경될 경우 두 곳을 모두 수정해야 하는 번거로움이 있으므로, UIWindow extension 등으로 분리하여 공통으로 사용하는 것이 좋습니다.

Comment on lines +99 to +105
static func dismiss() {
currentTooltip?.removeFromSuperview()
currentTooltip = nil

overlayView?.removeFromSuperview()
overlayView = nil
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

show 메서드에서는 툴팁이 나타날 때 페이드 인 애니메이션이 적용되어 있지만, dismiss 시에는 즉시 제거되어 사용자 경험이 다소 부자연스러울 수 있습니다. 제거 시에도 페이드 아웃 애니메이션을 적용한 뒤 removeFromSuperview를 호출하는 것을 고려해 보세요.

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

Labels

feat 새로운 기능을 추가 fix 버그 수정, 잔잔바리 수정, 병합 시 충돌 해결

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant