Skip to content

Add Widget Analytics#192

Merged
baekteun merged 1 commit intomasterfrom
feature/add-widget-analytics
Mar 9, 2025
Merged

Add Widget Analytics#192
baekteun merged 1 commit intomasterfrom
feature/add-widget-analytics

Conversation

@baekteun
Copy link
Copy Markdown
Member

@baekteun baekteun commented Mar 7, 2025

💡 개요

Add Widget Analytics

Summary by CodeRabbit

  • Chores
    • 애플리케이션의 버전 정보가 업데이트되었습니다 (버전 7.3, 빌드 65).
  • New Features
    • 위젯 선택 인터랙션이 기존 제스처 대신 버튼 방식으로 개선되어 더욱 명확해졌습니다.
  • Style
    • 식사 정보 표시 텍스트의 스타일이 어두운 색상으로 변경되어 가독성이 향상되었습니다.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 7, 2025

Walkthrough

이번 PR은 앱의 버전 업데이트, 위젯 인터랙션 개선, UI 스타일 수정, 그리고 이벤트 로그 관련 신규 타입 추가 및 로깅 기능 보완을 포함합니다. Info.plist의 버전 정보 변경, Import 추가, SwiftUI 위젯 선택 로직 변경, 텍스트 스타일 업데이트, 그리고 두 개의 이벤트 로그 타입 추가와 SettingsCore에서의 로깅 기능 개선이 이루어졌습니다.

Changes

파일들 변경 요약
Projects/.../Info.plist CFBundleShortVersionStringCFBundleVersion의 버전 정보 업데이트 (7.2 → 7.3, 63 → 65)
Projects/.../AddWidgetCore.swift
Projects/.../MainView.swift
각각 TWLogTipKit 모듈 import 추가 (기능 변경 없음)
Projects/.../AddWidgetView.swift 위젯 선택 방식 변경: onTapGesture를 제거하고 Button으로 전환, 버튼 클릭 시 TWLog를 통한 이벤트 로깅 추가
Projects/.../Components/MealView.swift 텍스트 폰트 수정: .twFont(.caption1)에서 .twFont(.caption1, color: .extraBlack)로 변경 (UI 스타일 개선)
Projects/.../EventLog/ClickAddToWidgetTypeEventLog.swift
Projects/.../EventLog/ClickAddToWidgetEventLog.swift
위젯 관련 클릭 이벤트 로그용 새 구조체(ClickAddToWidgetTypeEventLog, ClickAddToWidgetEventLog) 추가
Projects/.../SettingsCore.swift addWidgetButtonDidTap 처리 시, ClickAddToWidgetEventLog 인스턴스를 생성하고 TWLog.event 호출 추가 (이벤트 로깅 개선)

Sequence Diagram(s)

sequenceDiagram
    participant U as 사용자
    participant AWV as AddWidgetView
    participant VS as viewStore
    participant TW as TWLog
    U->>AWV: 위젯 선택 버튼 클릭
    AWV->>VS: 선택 이벤트 전송
    AWV->>TW: 선택 이벤트 로깅 호출
    TW-->>AWV: 로그 기록 완료
Loading
sequenceDiagram
    participant U as 사용자
    participant S as SettingsCore
    participant TW as TWLog
    U->>S: 위젯 추가 버튼 탭
    S->>TW: ClickAddToWidgetEventLog 생성 및 로깅 호출
    TW-->>S: 로그 기록 완료
Loading

Suggested labels

✨ Feature

Poem

깡총깡총 작은 토끼가 노래해,
버전이 살며시 한걸음씩 오르고,
버튼 위에 담긴 로그가 반짝이며,
새 이벤트의 빛이 코드에 스며들어,
숲 속의 코드가 즐거운 춤을 추네!
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 7, 2025

✅ Successful finished SwiftLint

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 7, 2025

🛠️ 이슈와 PR의 Labels 동기화를 스킵했어요.

Copy link
Copy Markdown
Contributor

@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: 0

🧹 Nitpick comments (2)
Projects/Feature/SettingsFeature/Sources/EventLog/ClickAddToWidgetEventLog.swift (1)

3-6: 접근 제어자 추가 제안

로그 구조체가 잘 정의되었지만, 다른 모듈에서 사용할 가능성이 있다면 접근 제어자를 명시적으로 추가하는 것이 좋습니다.

-struct ClickAddToWidgetEventLog: EventLog {
+public struct ClickAddToWidgetEventLog: EventLog {
    let name: String = "click_add_to_widget"
    let params: [String: String] = [:]
}
Projects/Feature/AddWidgetFeature/Sources/EventLog/ClickAddToWidgetTypeEventLog.swift (1)

12-46: 위젯 분석을 위한 이벤트 로그 구조체 추가

위젯 선택 시 분석 데이터를 수집하기 위한 이벤트 로그 구조체가 적절히 구현되었습니다. 이벤트 이름과 파라미터가 명확하게 정의되어 있습니다.

다만 default 케이스에서 오류가 발생했을 때 로그 품질 보장을 위해 다음과 같이 개선하는 것이 좋겠습니다:

default:
-    assertionFailure("failed to convert widget family")
-    familyString = ""
+    assertionFailure("알 수 없는 위젯 패밀리 타입: \(widget.family)")
+    familyString = "unknown"
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78689bf and 6fd5bdc.

📒 Files selected for processing (8)
  • Projects/App/iOS/Support/Info.plist (2 hunks)
  • Projects/Feature/AddWidgetFeature/Sources/AddWidgetCore.swift (1 hunks)
  • Projects/Feature/AddWidgetFeature/Sources/AddWidgetView.swift (2 hunks)
  • Projects/Feature/AddWidgetFeature/Sources/Components/MealView.swift (1 hunks)
  • Projects/Feature/AddWidgetFeature/Sources/EventLog/ClickAddToWidgetTypeEventLog.swift (1 hunks)
  • Projects/Feature/MainFeature/Sources/MainView.swift (1 hunks)
  • Projects/Feature/SettingsFeature/Sources/EventLog/ClickAddToWidgetEventLog.swift (1 hunks)
  • Projects/Feature/SettingsFeature/Sources/SettingsCore.swift (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: ⚙️ Prepare for CI
🔇 Additional comments (8)
Projects/Feature/AddWidgetFeature/Sources/AddWidgetCore.swift (1)

4-4: TWLog 모듈 import 추가 확인

TWLog 모듈을 추가하여 위젯 관련 분석을 지원할 수 있게 되었습니다. 이는 다른 파일에서 추가된 위젯 로깅 기능과 일관성을 유지합니다.

Projects/Feature/SettingsFeature/Sources/SettingsCore.swift (1)

123-124: 위젯 분석을 위한 로깅 기능 추가 완료

위젯 추가 버튼 클릭에 대한 이벤트 로깅이 적절하게 구현되었습니다. 기존 코드베이스의 다른 이벤트 로깅 패턴과 일관성 있게 작성되었습니다.

Projects/Feature/MainFeature/Sources/MainView.swift (1)

8-8:

Details

❓ Verification inconclusive

TipKit 모듈 추가 확인

TipKit 모듈이 추가되었지만 현재 파일에서는 사용되지 않고 있습니다. 향후 위젯 사용에 대한 사용자 팁 기능을 구현할 계획이 있는지 확인해주세요.


🏁 Script executed:

#!/bin/bash
# TipKit 기능이 현재 구현되어 있는지 확인
rg -t swift "import TipKit" --files-with-matches
rg -t swift "Tip" -A 3 -B 3

Length of output: 615


TipKit 모듈 사용 계획 확인 요청

  • Projects/Feature/MainFeature/Sources/MainView.swift 파일에서 import TipKit 구문은 확인되나, 해당 모듈이 현재 코드 내에서 활용되고 있지 않습니다.
  • 향후 위젯 관련 사용자 팁 기능 구현과 연결된 사용 계획이 있으신지 확인해주시면 좋겠습니다.
Projects/App/iOS/Support/Info.plist (2)

22-22: 버전 정보 업데이트 확인

애플리케이션의 Short Version String이 7.2에서 7.3으로 업데이트되었습니다. 이는 새로운 위젯 분석 기능이 추가되면서 마이너 버전이 증가한 것으로 보입니다.


35-35: 빌드 버전 업데이트 확인

빌드 버전이 63에서 65로 변경되었습니다. 버전 증가가 적절히 이루어졌습니다.

Projects/Feature/AddWidgetFeature/Sources/Components/MealView.swift (1)

224-224: 텍스트 스타일 일관성 개선

MealRectangularView의 텍스트 스타일에 색상 속성(.extraBlack)이 추가되었습니다. 이 변경으로 다른 위젯 텍스트 스타일과의 일관성이 향상되었습니다.

Projects/Feature/AddWidgetFeature/Sources/AddWidgetView.swift (2)

6-7: 필요한 Import 추가

SwiftUIUtil과 TWLog 모듈을 추가하여 위젯 선택 시 이벤트 로깅 기능을 지원합니다.


59-84: 위젯 선택 UX 및 이벤트 로깅 개선

위젯 선택 방식이 VStack과 onTapGesture에서 Button 컴포넌트로 변경되었습니다. 이는 SwiftUI의 접근성과 사용자 경험을 개선하는 좋은 변화입니다. 또한 위젯 선택 시 ClickAddToWidgetTypeEventLog를 사용하여 이벤트를 로깅하는 기능이 추가되었습니다.

Button을 사용함으로써:

  1. 접근성이 향상됩니다 (VoiceOver 등 지원)
  2. 시스템 피드백 (햅틱, 클릭 애니메이션)이 자동으로 적용됩니다
  3. 버튼의 상태 관리가 더 용이해집니다

@baekteun baekteun merged commit 8057eb8 into master Mar 9, 2025
6 checks passed
@baekteun baekteun deleted the feature/add-widget-analytics branch March 9, 2025 09:52
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