Skip to content

Conversation

@geeksbaek
Copy link
Collaborator

@geeksbaek geeksbaek commented Dec 31, 2025

Summary

  • 대시보드에 현재 시간대에 잡을 수 있는 생물 표시 섹션 추가
  • 사용자의 반구 설정 기반으로 월/시간대 필터링
  • 물고기/벌레/해산물 카테고리별 필터 기능

Changes

  • CurrentCreaturesSectionReactor: 현재 시간/월 기반 생물 필터링 로직
  • CurrentCreaturesView: 필터 버튼 및 컬렉션 뷰 UI
  • 대시보드에 '현재 출현 생물' 섹션 통합
  • 한국어/영어 로컬라이제이션 추가

Test plan

  • 현재 시간대에 맞는 생물만 표시되는지 확인
  • 필터 버튼(전체/물고기/벌레/해산물) 동작 확인
  • 생물 아이콘 탭 시 상세 화면 이동 확인
  • 반구 설정 변경 시 생물 목록 업데이트 확인

Closes #30

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a "Current Creatures" section to the dashboard showing creatures currently available based on time, season, and hemisphere.
    • Filter creatures by category (All, Fish, Bug, Sea Creature).
    • Tap on any creature to view detailed information.
    • Empty state messaging when no creatures are available.
  • Improvements

    • Enhanced code quality and performance optimizations.
    • Added English and Korean localization support for the new feature.

✏️ Tip: You can customize this high-level summary in your review settings.

- CurrentCreaturesSectionReactor 구현 (현재 시간/월 기반 필터링)
- CurrentCreaturesView 구현 (물고기/벌레/해산물 필터 버튼)
- 사용자 반구 설정 기반 출현 생물 표시
- 대시보드에 '현재 출현 생물' 섹션 추가
- 한국어/영어 로컬라이제이션 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@coderabbitai
Copy link

coderabbitai bot commented Dec 31, 2025

Warning

Rate limit exceeded

@geeksbaek has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 44 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between a3ba2a4 and fa0268b.

📒 Files selected for processing (2)
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/ViewModels/CurrentCreaturesSectionReactor.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/Views/CurrentCreaturesView.swift
📝 Walkthrough

Walkthrough

The pull request introduces a new "Current Creatures" dashboard section that displays creatures available at the current time with filtering by creature type. It includes a reactor managing time-based availability logic, a UI view with filters and collection display, localization strings for multiple languages, and integration into the dashboard.

Changes

Cohort / File(s) Summary
Localization Additions
Animal-Crossing-Wiki/Projects/App/Resources/en.lproj/Localizable.strings, ko.lproj/Localizable.strings
Added four string keys for the Current Creatures section ("Current Creatures", "currentCreaturesEmpty", "currentCreaturesCount", "All") with English and Korean translations.
New Feature: State Management
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/ViewModels/CurrentCreaturesSectionReactor.swift
New ReactorKit reactor managing creature fetching, filtering by category, time-based availability logic, hour parsing (supporting ranges like "4 AM - 9 AM" and overnight ranges), and hemisphere-aware calculations. Coordinator integration for creature detail navigation.
New Feature: UI View
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/Views/CurrentCreaturesView.swift
New UIView subclass with vertical stack layout, horizontal filter bar (All, Fish, Bug, Sea Creature), collection view for creature icons, count label, and empty state. RxSwift bindings to reactor state with dynamic height management.
Dashboard Integration
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/Coordinator/DashboardCoordinator.swift, ViewControllers/DashboardViewController.swift
Added currentCreaturesVM parameter to setUpViewModels, created new currentCreaturesSection SectionView, and inserted section between progress and random visit sections in the dashboard layout.
Minor Refactoring
Animal-Crossing-Wiki/Projects/App/Sources/Extension/String+extension.swift, Presentation/Catalog/ViewControllers/ItemsViewController.swift, Presentation/Catalog/ViewModels/ItemsReactor.swift, Presentation/Catalog/Views/CategoryRow.swift, Views/ItemSeasonView.swift
String extension: replaced count-based check with isEmpty check in isChosung and added early break on non-match. ItemsViewController: replaced named parameters with unused-parameter placeholders. ItemsReactor: removed extra space in function signature. CategoryRow: removed setSelected(_:animated:) override. ItemSeasonView: replaced guarded cast with type-check (is operator).

Sequence Diagram

sequenceDiagram
    participant User
    participant DashboardVC as DashboardViewController
    participant CurrentCreaturesView
    participant CurrentCreaturesReactor
    participant Coordinator
    participant DataFetcher

    User->>DashboardVC: Dashboard loads
    DashboardVC->>CurrentCreaturesReactor: initialize(coordinator)
    DashboardVC->>CurrentCreaturesView: init with reactor
    CurrentCreaturesView->>CurrentCreaturesReactor: trigger fetchCreatures action
    CurrentCreaturesReactor->>DataFetcher: fetch all creatures by category
    DataFetcher-->>CurrentCreaturesReactor: creatures data
    CurrentCreaturesReactor->>CurrentCreaturesReactor: compute availability<br/>(time, hemisphere, month)
    CurrentCreaturesReactor-->>CurrentCreaturesView: update state (allCreatures)
    CurrentCreaturesView->>CurrentCreaturesView: render collection view<br/>with creature icons

    User->>CurrentCreaturesView: tap filter button (e.g., Fish)
    CurrentCreaturesView->>CurrentCreaturesReactor: send filterChanged action
    CurrentCreaturesReactor->>CurrentCreaturesReactor: apply category filter<br/>to creatures
    CurrentCreaturesReactor-->>CurrentCreaturesView: update state (filteredCreatures)
    CurrentCreaturesView->>CurrentCreaturesView: refresh collection view<br/>with filtered creatures

    User->>CurrentCreaturesView: tap creature icon
    CurrentCreaturesView->>CurrentCreaturesReactor: send creatureTapped action
    CurrentCreaturesReactor->>Coordinator: navigate to creature detail
    Coordinator-->>User: show creature details
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 A bundle of creatures hopping into view,
Time-aware and filtered—a feature quite new!
Fish, bugs, and sea friends now shine on the dash,
With hour-by-hour logic and hemisphere flash! ✨🌍

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly references the primary feature being added: a dashboard section showing creatures available at the current time.
Description check ✅ Passed The description provides a clear summary, lists specific changes, includes test plan items, and identifies the related issue, though the formal template structure is not fully followed.
Linked Issues check ✅ Passed The PR implements the core requirements from issue #30: displays creatures available at current time, shows counts by category with filter buttons, and enables navigation to creature details on tap.
Out of Scope Changes check ✅ Passed Minor refactoring changes to existing code (String extension, View Controller patterns, type-checking) are incidental improvements that support the main feature and do not introduce unrelated functionality.

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

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/ViewModels/ItemsReactor.swift (1)

79-81: Fix variable naming typo: notCollectedIemsnotCollectedItems.

Line 79 contains a typo in the variable name (Iems instead of Items). This inconsistency affects readability and maintainability, especially since the variable is used in the combineLatest call on line 81.

🔎 Proposed fix
-            let notCollectedIems = setUpUserItem()
+            let notCollectedItems = setUpUserItem()
                 .compactMap { [weak self] items in self?.setUpNotCollected(items) }
             let userItems = Observable.combineLatest(collectedItems, notCollectedIems)
+            let userItems = Observable.combineLatest(collectedItems, notCollectedItems)
                 .map { Mutation.setUserItems(collected: $0.0, notCollected: $0.1) }
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 185dea2 and a3ba2a4.

📒 Files selected for processing (11)
  • Animal-Crossing-Wiki/Projects/App/Resources/en.lproj/Localizable.strings
  • Animal-Crossing-Wiki/Projects/App/Resources/ko.lproj/Localizable.strings
  • Animal-Crossing-Wiki/Projects/App/Sources/Extension/String+extension.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/ViewControllers/ItemsViewController.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/ViewModels/ItemsReactor.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/Views/CategoryRow.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/Views/ItemSeasonView.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/Coordinator/DashboardCoordinator.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/ViewControllers/DashboardViewController.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/ViewModels/CurrentCreaturesSectionReactor.swift
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/Views/CurrentCreaturesView.swift
💤 Files with no reviewable changes (1)
  • Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/Views/CategoryRow.swift
🧰 Additional context used
🧬 Code graph analysis (3)
Animal-Crossing-Wiki/Projects/App/Resources/ko.lproj/Localizable.strings (3)
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Collection/ViewControllers/CollectionProgressViewController.swift (1)
  • setUpNavigationItem (40-42)
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Collection/ViewControllers/CollectionViewController.swift (1)
  • setUpNavigationItem (46-48)
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Animals/ViewControllers/NPCViewController.swift (1)
  • all (13-24)
Animal-Crossing-Wiki/Projects/App/Resources/en.lproj/Localizable.strings (2)
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Animals/ViewControllers/NPCViewController.swift (1)
  • all (13-24)
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Animals/ViewControllers/VillagersViewController.swift (1)
  • all (12-259)
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/ViewModels/ItemsReactor.swift (1)
Animal-Crossing-Wiki/Projects/App/Sources/Utility/Items.swift (2)
  • setUpUserCollection (69-95)
  • updateItem (401-411)
🪛 SwiftLint (0.57.0)
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/ViewModels/CurrentCreaturesSectionReactor.swift

[Warning] 90-90: Conditional statements should always return on the next line

(conditional_returns_on_newline)


[Warning] 111-111: Conditional statements should always return on the next line

(conditional_returns_on_newline)


[Warning] 149-149: Conditional statements should always return on the next line

(conditional_returns_on_newline)


[Warning] 173-173: Conditional statements should always return on the next line

(conditional_returns_on_newline)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Check Build
🔇 Additional comments (19)
Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/ViewModels/ItemsReactor.swift (1)

303-303: Formatting change approved.

The extra space after the arrow operator has been removed. No behavioral impact.

Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/Views/ItemSeasonView.swift (1)

76-76: Good refactor to idiomatic Swift.

Using the is operator for type checking is more idiomatic and readable than the cast-and-nil-check pattern (as? ... != nil). The behavior remains functionally equivalent.

Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Catalog/ViewControllers/ItemsViewController.swift (2)

397-414: Good refactoring, but verify relevance to PR objectives.

Using _ for the unused action parameter is correct Swift style and improves code clarity. However, this change appears unrelated to the PR's stated objective of adding a "Current Creatures" dashboard section.

Was this file modified intentionally as part of this feature, or is this an incidental cleanup?


415-431: Consistent refactoring applied.

Same improvement as the allSelectAction above—correctly uses _ for the unused parameter.

Animal-Crossing-Wiki/Projects/App/Sources/Extension/String+extension.swift (1)

27-38: LGTM: Improved String extension logic.

The changes correctly optimize the isChosung check using isEmpty instead of count > 0 and add an early break for efficiency. The logic now properly validates that all characters in the string are Hangul initials.

Animal-Crossing-Wiki/Projects/App/Resources/en.lproj/Localizable.strings (1)

1524-1528: Localization entries look good.

The new keys appropriately support the Current Creatures UI. Note that "All" is defined in multiple places throughout this file (lines 162, 285, 289, 1528), which works but could make future maintenance harder if context-specific translations are ever needed.

Animal-Crossing-Wiki/Projects/App/Resources/ko.lproj/Localizable.strings (1)

1529-1533: Korean localization looks appropriate.

The translations align with the English localization structure and appear suitable for the Current Creatures UI.

Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/ViewModels/CurrentCreaturesSectionReactor.swift (6)

13-38: Clean ReactorKit structure.

The reactor follows standard ReactorKit patterns with well-defined actions, mutations, and state. The separation of creatures and filteredCreatures in state is good for performance.


40-58: Safe action handling with defensive programming.

The use of safe array access at line 50 prevents potential crashes from invalid indices. Good defensive coding.


110-128: Hemisphere and month filtering logic is correct.

The method properly checks both hemisphere-specific month availability and time ranges. Assumes monthsArray uses 1-indexed months (1=January, 12=December).


144-181: Time parsing logic handles format variations well.

The defensive handling of both en-dash (" – ") and hyphen (" - ") separators is good practice. The 12-hour to 24-hour conversion correctly handles edge cases (12 AM → 0, 12 PM → 12).

Consider verifying the time parsing with actual game data to ensure the format strings match expectations (e.g., "4 AM – 9 PM", "All day").


183-190: Correctly handles overnight time ranges.

The logic properly handles both normal (8 AM – 5 PM) and overnight (9 PM – 4 AM) ranges. Note that the implementation uses a half-open interval (hour >= start && hour < end), so a creature available "4 AM – 9 AM" is catchable at 4:00 but not at 9:00. This is standard game time range behavior.


84-108: ✓ Category.critters is correctly defined and Category conforms to Comparable.

The static property Category.critters returns [.fishes, .seaCreatures, .bugs], and the Category enum's Comparable conformance defines proper sort order (critters first, followed by other categories). Sorting by category in this method works as intended.

Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/Views/CurrentCreaturesView.swift (4)

11-71: Well-structured UI components.

The view hierarchy is cleanly organized with appropriate stack views, and the empty state is properly constrained. Good UX considerations with both count display and empty state messaging.


73-93: Clean filter button implementation.

The button styling is consistent and the selection state is clearly communicated through visual changes. The updateFilterButtonAppearance method ensures mutual exclusivity of button selection.


123-202: Comprehensive and correct Rx bindings.

The view properly binds to reactor state and actions. The filter button appearance updates happen in do(onNext:) which provides immediate visual feedback. The use of MainScheduler.asyncInstance for state observation ensures UI updates on the main thread.


205-211: Clean public API with convenience initializer.

The extension provides a clear entry point for constructing the view with its reactor, following good encapsulation practices.

Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/Coordinator/DashboardCoordinator.swift (1)

40-53: Clean integration of new reactor into coordinator.

The new CurrentCreaturesSectionReactor is wired into the dashboard setup following the same pattern as existing sections. The coordinator is properly passed for navigation handling.

Animal-Crossing-Wiki/Projects/App/Sources/Presentation/Dashboard/ViewControllers/DashboardViewController.swift (1)

60-111: Dashboard integration is well-executed.

The new Current Creatures section is cleanly integrated following the established pattern. The placement between "Collection Progress" and "Residents who can visit randomly" is logical, and the pawprint icon appropriately represents the creatures feature.

- CurrentCreaturesSectionReactor 시간 필터링 개선
- CurrentCreaturesView UI 개선

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

[대시보드] 현재 시간대에 잡을 수 있는 생물을 보여주는 섹션 구현

3 participants