Skip to content

Conversation

@SYAAINN
Copy link
Contributor

@SYAAINN SYAAINN commented Aug 14, 2025

📌 ISSUE

closed #321

📄 Work Description

  • 점검시간 다이얼로그 string 추출로 국제화
  • 분 단위도 나타낼 수 있도록 언어별 포맷 수정
  • 점검시간을 유저 타임존에 맞추어 변환

✨ PR Point

원래는 remoteConfig에서 가져온 2025-08-11T18:00:00 형식의 점검시간을 가공 후 뷰모델로 넘겨주었는데
언어 분기 처리를 위한 LanguageProvider 때문에 layer간 의존성이 역전되어,, 방식을 조금 변경했습니다.

  1. data layer (AppUpdateChecker) 에서는 raw한 형태로 fetch 하여 전달하는 역할만 합니다.
  2. 뷰모델에서 시작시간/종료시간을 받은 후 LanguageProvider에 넘깁니다
  3. LanguageProvider에서 언어별, 타임존별로 알맞은 포맷으로 가공합니다.

📸 ScreenShot/Video

스크린샷 2025-08-14 22 41 17

Summary by CodeRabbit

  • New Features
    • Added a localized maintenance dialog with dynamic time formatting (supports Korean and English).
    • Splash screen now displays localized maintenance window when applicable.
  • Refactor
    • Improved Home screen data loading for more reliable calendar and diary updates; smoother deletion flow.
  • Changes
    • Notification permissions: Home screen requests Android 13+ notification permission when needed; Time Reminder no longer prompts for notification permission.
  • Chores
    • App version updated to 1.5.0 (build 29).

@SYAAINN SYAAINN requested a review from MoonsuKang August 14, 2025 13:54
@SYAAINN SYAAINN self-assigned this Aug 14, 2025
@SYAAINN SYAAINN added ✨ FEAT 기능 개발 🔥 민재 민재 labels Aug 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 14, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

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

Walkthrough

This PR updates the inspection flow to return raw start/end times, adds localization/formatting for inspection text via a LanguageProvider, replaces literals in the inspection dialog with string resources, refactors Home loading and notification permission handling, removes notification permission flow from TimeReminder, and bumps the app version.

Changes

Cohort / File(s) Summary
Version bump
app/build.gradle.kts
Increment versionCode 28→29 and versionName 1.4.0→1.5.0.
AppUpdate inspection API change
app/src/main/java/com/sopt/clody/domain/appupdate/AppUpdateChecker.kt, app/src/main/java/com/sopt/clody/data/remote/appupdate/AppUpdateCheckerImpl.kt
getInspectionTimeText signature changed to suspend and now returns Pair<String, String>? (start, end). Implementation simplified; removed local formatting.
Inspection text i18n & formatting
app/src/main/java/com/sopt/clody/presentation/utils/language/LanguageProvider.kt, .../LanguageProviderImpl.kt, app/src/main/java/com/sopt/clody/presentation/ui/splash/SplashViewModel.kt
Added LanguageProvider.getInspectionTimeText(start, end). SplashViewModel now formats inspection text via LanguageProvider. Implementation supports Korean/English with minute granularity.
Inspection dialog strings
app/src/main/java/com/sopt/clody/presentation/ui/component/dialog/InspectionDialog.kt, app/src/main/res/values/strings.xml, app/src/main/res/values-ko/strings.xml
Replaced hard-coded text with string resources; added new localized strings for title, description (with time placeholder), and confirm button.
TimeReminder notification flow simplification
app/src/main/java/com/sopt/clody/presentation/ui/auth/timereminder/TimeReminderScreen.kt, .../TimeReminderViewModel.kt
Removed Android 13+ notification permission flow from UI. ViewModel sendNotification no longer takes permission flag; DTO flags now hard-coded to true.
Home data/notification refactor
app/src/main/java/com/sopt/clody/presentation/ui/home/screen/HomeScreen.kt, .../HomeViewModel.kt
Introduced permission-aware notification request on Home start. Added updateYearMonthAndLoadData(...) methods with mutex/concurrency for calendar and daily diary loading; IO dispatching; adjusted deletion/date handling; added sendNotification(isGranted).

Sequence Diagram(s)

sequenceDiagram
  participant Splash as SplashViewModel
  participant Checker as AppUpdateChecker
  participant Lang as LanguageProvider
  participant UI as InspectionDialog

  Splash->>Checker: getInspectionTimeText() (suspend)
  Checker-->>Splash: Pair(start,end)?
  alt start/end available
    Splash->>Lang: getInspectionTimeText(start, end)
    Lang-->>Splash: localizedText?
    Splash->>UI: Show dialog with localizedText
  else no inspection
    Splash-->>Splash: Proceed without dialog
  end
Loading
sequenceDiagram
  participant HomeUI as HomeScreen
  participant Perm as Permission API
  participant VM as HomeViewModel
  participant Repo as Repositories

  HomeUI->>Perm: Check POST_NOTIFICATIONS (Android 13+)
  alt Not granted
    HomeUI->>Perm: Request permission
    Perm-->>HomeUI: Result (isGranted)
    HomeUI->>VM: sendNotification(isGranted)
  else Granted or pre-13
    HomeUI->>VM: sendNotification(true)
  end
  HomeUI->>VM: updateYearMonthAndLoadData(year, month, day)
  VM->>VM: Mutex lock, set selected date
  par Load calendar
    VM->>Repo: fetch calendar (IO)
  and Load daily
    VM->>Repo: fetch daily diaries (IO)
  end
  Repo-->>VM: Results
  VM-->>HomeUI: Update UI states
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Assessment against linked issues

Objective Addressed Explanation
점검시간 언어 분기처리 (#321)
포맷에 '분'도 표시할 수 있도록 포맷 수정 (#321)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Home notification permission request and sendNotification flow (app/src/main/java/com/sopt/clody/presentation/ui/home/screen/HomeScreen.kt, lines: multiple) Not related to inspection dialog i18n or formatting. Introduces permission handling and notification sending logic.
Addition of HomeViewModel.sendNotification(isGranted) and related IO/refactor (app/src/main/java/com/sopt/clody/presentation/ui/home/screen/HomeViewModel.kt, lines: multiple) Outside the scope of inspection time localization/format changes.
Refactor to updateYearMonthAndLoadData with mutex/concurrency (HomeViewModel.kt, lines: multiple) Broader data-loading architecture change, not tied to inspection dialog i18n/format.
Removal of TimeReminder notification permission flow and API change (TimeReminderScreen.kt / TimeReminderViewModel.kt, lines: multiple) Unrelated to the inspection dialog objectives; modifies reminder notification behavior.
Version bump 1.4.0→1.5.0 (app/build.gradle.kts, lines: defaultConfig) Versioning is not part of the inspection dialog i18n/format scope.

Possibly related PRs

Suggested labels

🌊 문수

Suggested reviewers

  • MoonsuKang

Poem

I thump my foot at maintenance time,
Two dates hop in, now neatly aligned.
In Korean or English, minutes gleam,
A tidy warren of localized dream.
Version up, permissions pruned—
Carrots queued, alarms soon crooned. 🥕🐇

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/#321-inspection-i18n

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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@SYAAINN SYAAINN changed the base branch from develop to refactor/#317-notification-request August 14, 2025 13:54
Copy link
Contributor

@MoonsuKang MoonsuKang left a comment

Choose a reason for hiding this comment

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

수고하셨슴다~ 리뷰는 그냥 읽어만 주셔도 되유

val startText = formatDateTimeWithDayOfWeek(start)
val endText = formatDateTimeWithDayOfWeek(end)
return "$startText ~ $endText"
return nowServer.isAfter(startZ) && nowServer.isBefore(endZ)
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게도 될 것 같아요

Suggested change
return nowServer.isAfter(startZ) && nowServer.isBefore(endZ)
return nowServer in startZ..endZ

Copy link
Contributor Author

Choose a reason for hiding this comment

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

기존 방식은 초과/미만이고 제안해주신 방식은 이상/이하라고 하네요! 이상/이하가 더 자연스러울 것 같아 반영했습니다!

val now = LocalDateTime.now()
return now.isAfter(start) && now.isBefore(end)
}
val serverZone = ZoneId.of("Asia/Seoul")
Copy link
Contributor

Choose a reason for hiding this comment

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

companion object로 분리하는게 더 좋아보입니다~

val startLdt = LocalDateTime.parse(start, DateTimeFormatter.ISO_LOCAL_DATE_TIME)
val endLdt = LocalDateTime.parse(end, DateTimeFormatter.ISO_LOCAL_DATE_TIME)

if (isKorean()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

함수명이 getInspectionTimeText 이라면 formatting 하는 부분은 별도의 함수로 분리하는게 좋을 것 같아유

Copy link
Contributor Author

Choose a reason for hiding this comment

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

단일 책임 원칙 고려하여 포맷핑 부분 분리했습니다.

val endLdt = LocalDateTime.parse(end, DateTimeFormatter.ISO_LOCAL_DATE_TIME)

if (isKorean()) {
val koPattern = DateTimeFormatter.ofPattern("M/d(E) HH시mm분", Locale.KOREAN)
Copy link
Contributor

Choose a reason for hiding this comment

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

요런 패턴들도 companion object로 분리하는게 좋습니다.
실무에선 다 분리하는 편 이에유

- isUnderInspection 함수에서 점검시간 검사를 초과/미만에서 이상/이하로 개선 + companion object 분리
- getInspectionTimeText 함수에서 단일 책임 원칙에 따라 포맷팅 함수 분리 + companion object 분리
@SYAAINN SYAAINN merged commit c70281e into refactor/#317-notification-request Aug 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ FEAT 기능 개발 🔥 민재 민재

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] 점검시간 다이얼로그 국제화 및 포맷 수정을 진행합니다.

3 participants