Skip to content

Conversation

@youz2me
Copy link
Member

@youz2me youz2me commented Apr 17, 2025

👻 PULL REQUEST

📄 작업 내용

  • 1차 QA에서 나온 작업 사항들을 반영했어요.
구현 내용 UITextView 플레이스홀더 오류 해결 글쓰기 유효성 검사 조건 추가 스크롤 시 좋아요 사라지는 문제 해결 제목 링크 인식 오류 해결
GIF

💻 주요 코드 설명

QA 오류 사항 및 해결 방법 설명

  • 온보딩 화면에서 연도를 표시하던 CollectionView가 중복되어 선택되던 문제를 해결했습니다.
    • 기존 셀 선택 시 다른 셀의 선택 상태를 해제해주던 로직에 문제가 있는 것 같아 ViewController 차원에서 선택된 인덱스의 값을 가지도록 하고, 해당 인덱스에 따라 UI를 업데이트하도록 설정했습니다.
  • 홈 화면에서 좋아요를 누르고 스크롤 시 좋아요가 사라지는 이슈를 해결했습니다.
    • 좋아요/좋아요 취소 서버 통신 이후 바로 값을 받아오지 않기 때문에 현재 저장하고 있는 Content에 좋아요 상태를 반영해주는 로직을 추가하지 않았던 게 원인이었습니다. 현재 추가되어 정상적으로 작동합니다.
  • 로그인 시 온보딩 화면으로 전환하는 조건을 추가했습니다.
    • 프로필 이미지 URL 값이 nil일 경우, 닉네임 값이 nil일 경우 온보딩 과정으로 진입합니다.
  • 유저 닉네임 입력 시 자음도 입력 가능하도록 설정했습니다.
  • 글 작성 시 유효성 검사 조건을 수정했습니다.
    • 499자까지 작성 가능하도록, 제목이 없을 경우 게시 버튼이 비활성화되도록 수정했습니다.
  • 댓글 작성 시 댓글을 작성하고 댓글/답글 버튼을 눌렀을 때 플레이스홀더가 댓글로 인식되어 덮어씌워지는 문제를 해결했습니다.
    • 댓글, 답글 버튼 클릭 시 현재 작성하던 텍스트뷰의 텍스트를 모두 삭제하고 키보드를 비활성화합니다. (기존 와블 앱 로직 참고했습니다.)
  • 상세 페이지에서 댓글 표시가 안되는 이슈를 해결했습니다.
    • 프로필 이미지가 nil일 경우 옵셔널 바인딩 구문에 걸려 nil 값을 반환하던 게 원인이었습니다. 현재는 정상적으로 표시되도록 수정했습니다.
    • 온보딩 전환 조건이 추가되면서 프로필 이미지가 nil일 경우를 고려할 필요가 없어졌기 때문에 추후 다시 수정될 가능성도 존재합니다.

🔗 연결된 이슈

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Improved year selection interface in onboarding, allowing easier selection and highlighting of years.
  • Enhancements
    • Updated like button behavior to immediately reflect changes in like status and count.
    • Title fields in post and content views now use clear backgrounds and enhanced text handling for better readability.
    • Improved handling of nickname validation and navigation after login.
  • Bug Fixes
    • Fixed comment and reply actions to properly dismiss the keyboard.
    • Relaxed requirements for displaying comment author information.
  • Style
    • Reformatted code for improved readability and maintainability.

JinUng41 and others added 24 commits April 12, 2025 16:20
- 사전 신청이라는 의미에서 PreRegister가 적합할 수 있으나, 너무 네이밍이 길어진다고 판단하여 좀 더 간결한 형태를 유지하고자 변경함.
- MockUseCase으로 구현
#Conflicts:
#	Wable-iOS/Presentation/TabBar/TabBarController.swift
…슈, 온보딩 화면 연도 중복 체크 이슈 해결
@youz2me youz2me added 🛠️ fix 기능적 버그나 오류 해결 시 사용 🦉 유진 🛌🛌🛌🛌🛌🛌🛌🛌🛌🛌 labels Apr 17, 2025
@youz2me youz2me requested a review from JinUng41 April 17, 2025 20:05
@youz2me youz2me self-assigned this Apr 17, 2025
@coderabbitai
Copy link

coderabbitai bot commented Apr 17, 2025

"""

Walkthrough

This set of changes encompasses a variety of adjustments across the iOS project. Key updates include modifications to build configurations for the Debug scheme, UI improvements in several view controllers, and refinements to user interaction logic. Notable changes involve updating code signing identities and provisioning profiles, enhancing text view styling, adjusting nickname validation logic, improving year selection state management, and synchronizing local like status updates in the home view model. Additionally, there are UI component refactors, such as replacing a label with a text view for titles and relaxing guard conditions for comment cell configuration.

Changes

File(s) Change Summary
Wable-iOS.xcodeproj/project.pbxproj Updated Debug build configuration: changed code signing identity to "iPhone Developer" and provisioning profile to "Wable_Debug".
Wable-iOS/Presentation/Helper/Extension/UITextView+.swift Modified paragraph styling and baseline offset in setPretendard, set text container insets and padding to zero, and forced layout refresh.
Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift Reformatted cell registration closures, added endEditing(true) calls in button handlers, and reformatted data source and layout closures.
Wable-iOS/Presentation/Home/View/WritePostViewController.swift Set text views' background to clear, refined post button enabling logic, and adjusted character limit enforcement.
Wable-iOS/Presentation/Home/ViewModel/HomeViewModel.swift Updated like/unlike logic to synchronize local state after operation and emit updated content array.
Wable-iOS/Presentation/Login/LoginViewController.swift Modified onboarding navigation logic to require profile URL in addition to nickname for existing users.
Wable-iOS/Presentation/Onboarding/ViewController/LCKYearViewController.swift Centralized year selection state, added helper methods for selection, and improved UI updates for year selection.
Wable-iOS/Presentation/Onboarding/ViewController/ProfileRegisterViewController.swift Changed nickname validation regex to match Korean consonants (ㄱ-ㅎ), English letters, and digits.
Wable-iOS/Presentation/WableComponent/Cell/CommentCollectionViewCell.swift Relaxed guard statement to only require createdDate, deferring handling of optional values to later.
Wable-iOS/Presentation/WableComponent/Cell/ContentCollectionViewCell.swift Replaced titleLabel with titleTextView, updated related logic and styling, and removed redundant insets for content text view.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant HomeViewModel
    participant LikeUseCase
    participant ContentsSubject

    User->>HomeViewModel: Tap Heart (contentID, isLiked)
    HomeViewModel->>LikeUseCase: createLike/deleteLike(contentID)
    LikeUseCase-->>HomeViewModel: Completion (success/failure)
    HomeViewModel->>ContentsSubject: Update like count and status for contentID
Loading
sequenceDiagram
    participant User
    participant LCKYearViewController
    participant CollectionView

    User->>LCKYearViewController: Select Year Cell
    LCKYearViewController->>LCKYearViewController: Update selectedYearIndex
    LCKYearViewController->>CollectionView: Update cell appearance
    LCKYearViewController->>LCKYearViewController: Update pull-down button title
Loading

Assessment against linked issues

Objective Addressed Explanation
QA 반영 (QA feedback implementation) (#175)

Suggested reviewers

  • JinUng41

Poem

A hop, a skip, a code refactor bright,
With text views styled just right,
Year selectors gleam,
And nicknames redeem,
Debug builds now take flight!
🐇✨
"""

Tip

⚡💬 Agentic Chat (Pro Plan, General Availability)
  • We're introducing multi-step agentic chat in review comments and issue comments, within and outside of PR's. This feature enhances review and issue discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments and add commits to existing pull requests.
✨ Finishing Touches
  • 📝 Generate Docstrings

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

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: 2

🧹 Nitpick comments (4)
Wable-iOS/Presentation/Login/LoginViewController.swift (1)

179-179: Consider including complete condition in log message.

The log message only reports part of the condition (isNewUser && nickname != ""), but it doesn't include the profileURL check that's part of the actual navigation decision.

Consider updating the log message to reflect all conditions being checked:

-WableLogger.log("새로운 유저인가요? : \(sessionInfo.isNewUser && sessionInfo.user.nickname != "")", for: .debug)
+WableLogger.log("새로운 유저인가요? : \(sessionInfo.isNewUser && sessionInfo.user.nickname != "" && sessionInfo.user.profileURL != nil)", for: .debug)
Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift (1)

182-182: Unused parameters in closures

There are unused parameters in closures that could be replaced with underscore (_) to improve code clarity.

Consider replacing the unused parameters with underscores:

- > { [weak self] cell, indexPath, item in
+ > { [weak self] cell, _, item in

And:

- sectionIndex,
- layoutEnvironment
+ sectionIndex,
+ _

Also applies to: 417-417

🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 182-182: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)

Wable-iOS/Presentation/Home/ViewModel/HomeViewModel.swift (1)

110-143: Improved local state management for content likes

This implementation ensures immediate UI feedback by updating the local content state after like/unlike operations, regardless of API success. The code correctly updates the like count and status by creating a new immutable Content instance with the updated Like data.

However, consider adding error handling that informs users when network operations fail, since the current implementation will update the UI optimistically even when the server operation fails.

.sink(receiveValue: { contentID, isLiked in
    var updatedContents = contentsSubject.value
            
    if let index = updatedContents.firstIndex(where: { $0.content.id == contentID }) {
        let originalContent = updatedContents[index]
        let originalUserContent = originalContent.content
        let originalContentInfo = originalUserContent.contentInfo
        let originalLike = originalContentInfo.like
        
        let updatedLike = isLiked
        ? Like(status: true, count: originalLike.count + 1)
        : Like(status: false, count: max(0, originalLike.count - 1))
        
        let updatedContent = Content(
            content: UserContent(
                id: originalUserContent.id,
                contentInfo: ContentInfo(
                    author: originalContentInfo.author,
                    createdDate: originalContentInfo.createdDate,
                    title: originalContentInfo.title,
                    imageURL: originalContentInfo.imageURL,
                    text: originalContentInfo.text,
                    status: originalContentInfo.status,
                    like: updatedLike,
                    opacity: originalContentInfo.opacity,
                    commentCount: originalContentInfo.commentCount
                )
            ),
            isDeleted: originalContent.isDeleted
        )
        
        updatedContents[index] = updatedContent
        contentsSubject.send(updatedContents)
+       // Consider adding error notification if the operation actually failed
+       // This could be done by passing an additional parameter indicating success/failure
    }
})
Wable-iOS/Presentation/Onboarding/ViewController/LCKYearViewController.swift (1)

154-171: Cell configuration based on selection state

The implementation now correctly configures cells based on the selection state using the selectedYearIndex property, providing clear visual feedback to users.

However, there's some code duplication between this method and the updateCellAppearance method.

Consider extracting the cell styling logic to a shared method to avoid duplication:

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    guard let cell = collectionView.dequeueReusableCell(
        withReuseIdentifier: LCKYearCollectionViewCell.reuseIdentifier,
        for: indexPath
    ) as? LCKYearCollectionViewCell else {
        return UICollectionViewCell()
    }
    
+   cell.yearLabel.text = String(2012 + indexPath.item)
    if let selectedIndex = selectedYearIndex {
        let condition = indexPath.item == selectedIndex
-       
-       cell.backgroundColor = condition ? .purple10 : .clear
-       cell.yearLabel.attributedText = String(2012 + indexPath.item).pretendardString(with: condition ? .body1 : .body2)
-       cell.yearLabel.textColor = condition ? .purple50 : .wableBlack
+       applyCellStyle(cell: cell, isSelected: condition)
    }
    
    return cell
}

+ private func applyCellStyle(cell: LCKYearCollectionViewCell, isSelected: Bool) {
+     cell.backgroundColor = isSelected ? .purple10 : .clear
+     cell.yearLabel.attributedText = cell.yearLabel.text?.pretendardString(with: isSelected ? .body1 : .body2)
+     cell.yearLabel.textColor = isSelected ? .purple50 : .wableBlack
+ }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 97c8c63 and 7144d60.

📒 Files selected for processing (10)
  • Wable-iOS.xcodeproj/project.pbxproj (2 hunks)
  • Wable-iOS/Presentation/Helper/Extension/UITextView+.swift (1 hunks)
  • Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift (4 hunks)
  • Wable-iOS/Presentation/Home/View/WritePostViewController.swift (3 hunks)
  • Wable-iOS/Presentation/Home/ViewModel/HomeViewModel.swift (2 hunks)
  • Wable-iOS/Presentation/Login/LoginViewController.swift (1 hunks)
  • Wable-iOS/Presentation/Onboarding/ViewController/LCKYearViewController.swift (5 hunks)
  • Wable-iOS/Presentation/Onboarding/ViewController/ProfileRegisterViewController.swift (1 hunks)
  • Wable-iOS/Presentation/WableComponent/Cell/CommentCollectionViewCell.swift (2 hunks)
  • Wable-iOS/Presentation/WableComponent/Cell/ContentCollectionViewCell.swift (7 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (6)
Wable-iOS/Presentation/Login/LoginViewController.swift (1)
Wable-iOS/Core/Logger/WableLogger.swift (1)
  • log (14-25)
Wable-iOS/Presentation/Home/View/WritePostViewController.swift (1)
Wable-iOS/Presentation/Helper/Extension/UITextView+.swift (1)
  • setPretendard (22-41)
Wable-iOS/Presentation/Helper/Extension/UITextView+.swift (1)
Wable-iOS/Presentation/Helper/Extension/UIFont+.swift (1)
  • pretendard (93-95)
Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift (2)
Wable-iOS/Presentation/WableComponent/Cell/ContentCollectionViewCell.swift (2)
  • configureCell (257-316)
  • profileImageViewDidTap (198-202)
Wable-iOS/Presentation/WableComponent/Cell/CommentCollectionViewCell.swift (1)
  • configureCell (161-186)
Wable-iOS/Presentation/Home/ViewModel/HomeViewModel.swift (3)
Wable-iOS/Domain/UseCase/Home/CreateContentLikedUseCase.swift (1)
  • execute (23-25)
Wable-iOS/Domain/UseCase/Home/DeleteContentLikedUseCase.swift (1)
  • execute (23-25)
Wable-iOS/Domain/Entity/Like.swift (1)
  • like (16-19)
Wable-iOS/Presentation/Onboarding/ViewController/LCKYearViewController.swift (1)
Wable-iOS/Presentation/Onboarding/ViewController/LCKTeamViewController.swift (3)
  • collectionView (96-113)
  • collectionView (119-121)
  • collectionView (123-136)
🪛 SwiftLint (0.57.0)
Wable-iOS/Presentation/Login/LoginViewController.swift

[Warning] 181-181: Using ternary to call Void functions should be avoided

(void_function_in_ternary)

Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift

[Warning] 182-182: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)


[Warning] 417-417: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)

🔇 Additional comments (25)
Wable-iOS.xcodeproj/project.pbxproj (2)

2424-2425: Build configuration updated for Debug environment.

The code signing identity has been changed from "iPhone Distribution" to "iPhone Developer" for the Debug build configuration. This is appropriate for development builds as it allows for using development certificates rather than distribution ones.


2447-2447: Provisioning profile updated for Debug configuration.

The provisioning profile specifier has been updated from "Wable_AppStore" to "Wable_Debug" for Debug builds. This correctly aligns the provisioning profile with the development environment.

Wable-iOS/Presentation/Helper/Extension/UITextView+.swift (3)

24-25: Improved paragraph styling for consistent line heights.

Setting both minimum and maximum line heights to the same value (style.size * 1.8) ensures consistent line spacing regardless of the content, which improves text layout predictability.


30-32: Added baseline offset for improved text positioning.

Adding baselineOffset to the text attributes allows for fine-tuning of vertical text positioning, which helps with proper alignment in UITextView.


35-40: Improved text container layout and forced immediate layout updates.

Setting textContainerInset and lineFragmentPadding to zero removes default padding, giving more precise control over text positioning. Calling setNeedsLayout() and layoutIfNeeded() ensures layout updates are applied immediately, which helps prevent visual glitches when the textview appears.

Wable-iOS/Presentation/WableComponent/Cell/ContentCollectionViewCell.swift (3)

48-54: Good modification for improved text handling with UITextView

The switch from a UILabel to UITextView for the title provides better functionality like link detection while maintaining proper styling with Pretendard font.


101-101: Proper cleanup in prepareForReuse

Good job updating the prepareForReuse method to include cleaning up the new titleTextView.


309-310: Appropriate visibility handling for blind status

The implementation correctly updates the visibility handling to hide titleTextView instead of titleLabel in the blind case.

Wable-iOS/Presentation/Home/View/WritePostViewController.swift (3)

36-36: Improved visual consistency with transparent backgrounds

Setting the background color to .clear for both text views creates a cleaner UI appearance that better integrates with the surrounding design.

Also applies to: 44-44


244-245: Enhanced validation for post submission

Adding the check for !titleTextView.text.isEmpty improves validation by preventing submissions with empty titles, which is a good UX enhancement.


348-348: Changed character limit constraint

The character limit check has been modified from <= 500 to < 500, which reduces the maximum allowed characters by one.

Verify if this change was intentional. If the requirement is to allow exactly 500 characters, this might need to be reverted back to <= 500.

Wable-iOS/Presentation/WableComponent/Cell/CommentCollectionViewCell.swift (1)

164-165: Relaxed guard condition for better error handling

Good change to only require createdDate in the guard statement while passing optional values directly to the configuration method. This allows the cell to display comments even when some author data might be missing.

Also applies to: 173-176

Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift (5)

199-200: Improved user experience by dismissing keyboard

Adding commentTextView.endEditing(true) when tapping the comment button provides better UX by automatically dismissing the keyboard.


237-238: Consistent keyboard dismissal on interaction

Good addition of keyboard dismissal when tapping the reply button, which maintains consistency with the comment button behavior.


179-245: Code formatting improvements for readability

The reformatting of cell registrations, callbacks, and gesture recognizers with consistent multi-line syntax significantly improves code readability.

🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 182-182: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)


248-270: Consistent formatting for DataSource initialization

The improved multi-line formatting for DataSource initialization and cell dequeuing makes the code more readable and maintainable.


415-430: Better layout code structure

The reformatted compositional layout code improves readability while maintaining the same functionality.

🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 417-417: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)

Wable-iOS/Presentation/Home/ViewModel/HomeViewModel.swift (2)

17-21: Code style improvement

The initializer has been reformatted to a multi-line style, which improves readability for functions with multiple parameters.


104-109: Better error handling for like operations

The implementation now correctly maps the result of like/unlike operations and handles errors gracefully using asDriver(onErrorJustReturn: info), ensuring the stream continues even if network operations fail.

Wable-iOS/Presentation/Onboarding/ViewController/LCKYearViewController.swift (6)

17-20: Improved state management with dedicated properties

Good addition of a selectedYearIndex property to track the selection state and a computed yearCount property to determine the valid range of years dynamically.


35-35: Default year selection initialization

Adding the call to setDefaultYear() ensures a year is pre-selected when the view loads, improving the user experience.


66-80: Well-implemented default year selection method

This method properly initializes the default selection to the current year and updates both the data model and UI accordingly. Using DispatchQueue.main.async ensures the collection view is ready before attempting to select an item.


105-112: Simplified navigation logic

The method now correctly uses the internal selectedYearIndex state rather than parsing UI elements, and provides a fallback by setting the default year if none is selected.


117-133: Good encapsulation of cell appearance logic

The updateCellAppearance helper method centralizes the cell styling logic, making the code more maintainable and consistent.


138-148: Improved collection view delegate implementation

The didSelectItemAt method now properly updates the internal state, refreshes the UI, and ensures layout updates are applied.

Comment on lines +177 to +181
let condition = sessionInfo.isNewUser && sessionInfo.user.nickname != "" && sessionInfo.user.profileURL != nil

WableLogger.log("새로운 유저인가요? : \(sessionInfo.isNewUser && sessionInfo.user.nickname != "")", for: .debug)

condition ? owner.navigateToOnboarding() : owner.navigateToHome()
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Added profile URL validation when determining navigation path.

The code now requires that a user's profile URL must not be nil in addition to checking if they're a new user with a non-empty nickname. This adds more robust validation before deciding whether to navigate to onboarding or home screens.

However, the ternary operator is not ideal for calling void functions.

Replace the ternary with a clearer if-else statement:

-condition ? owner.navigateToOnboarding() : owner.navigateToHome()
+if condition {
+    owner.navigateToOnboarding()
+} else {
+    owner.navigateToHome()
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let condition = sessionInfo.isNewUser && sessionInfo.user.nickname != "" && sessionInfo.user.profileURL != nil
WableLogger.log("새로운 유저인가요? : \(sessionInfo.isNewUser && sessionInfo.user.nickname != "")", for: .debug)
condition ? owner.navigateToOnboarding() : owner.navigateToHome()
let condition = sessionInfo.isNewUser && sessionInfo.user.nickname != "" && sessionInfo.user.profileURL != nil
WableLogger.log("새로운 유저인가요? : \(sessionInfo.isNewUser && sessionInfo.user.nickname != "")", for: .debug)
if condition {
owner.navigateToOnboarding()
} else {
owner.navigateToHome()
}
🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 181-181: Using ternary to call Void functions should be avoided

(void_function_in_ternary)

func textFieldDidChangeSelection(_ textField: UITextField) {
guard let text = textField.text else { return }
let regex = try? NSRegularExpression(pattern: "^[가-힣a-zA-Z0-9]+$")
let regex = try? NSRegularExpression(pattern: "^[ㄱ-ㅎa-zA-Z0-9]+$")
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Significant change to nickname validation pattern.

The regex pattern has been changed from matching Korean syllables (가-힣) to matching only Korean consonants (ㄱ-ㅎ). This is a significant functional change that would affect what Korean characters are accepted in the nickname field.

This change appears to be restrictive as it would prevent users from entering complete Korean syllables in their nicknames. Please verify if this is the intended behavior. If not, consider restoring the original pattern or using a more inclusive one:

-let regex = try? NSRegularExpression(pattern: "^[ㄱ-ㅎa-zA-Z0-9]+$")
+let regex = try? NSRegularExpression(pattern: "^[가-힣ㄱ-ㅎㅏ-ㅣa-zA-Z0-9]+$")

This suggested pattern would allow full Korean syllables (가-힣), consonants (ㄱ-ㅎ), vowels (ㅏ-ㅣ), and alphanumeric characters.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let regex = try? NSRegularExpression(pattern: "^[ㄱ-ㅎa-zA-Z0-9]+$")
let regex = try? NSRegularExpression(pattern: "^[가-힣ㄱ-ㅎㅏ-ㅣa-zA-Z0-9]+$")

Copy link
Collaborator

@JinUng41 JinUng41 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다.

코멘트는 몇 가지 마이너한 것들만 남겨두었으니, 확인 부탁드릴게요 🙏
다만 글을 작성한 후에 로딩뷰가 보이던데 화면 설계서를 참고하여 이 부분은 수정이 필요해 보입니다.
그리고 현재 QA 시트에 있는 사항들 중 반영된 것과 반영되지 않는 것을 알려주시면 좋을 것 같습니다.
노션의 QA 시트도 반영 부탁드릴게요~

Comment on lines 206 to 212
let commentCellRegistration = UICollectionView.CellRegistration<
CommentCollectionViewCell,
ContentComment
> {
[weak self] cell,
indexPath,
item in
Copy link
Collaborator

Choose a reason for hiding this comment

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

개행이 이상해요~

Copy link
Member Author

Choose a reason for hiding this comment

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

OMG 수정했습니닷

Comment on lines 112 to 113

if let index = updatedContents.firstIndex(where: { $0.content.id == contentID }) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

guard let 구문을 사용한다면, 코드 뎁스를 줄일 수 있을 것 같아요.

Copy link
Member Author

Choose a reason for hiding this comment

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

헉 그걸 생각 못했네요 ... 반영했습니닷 ㅎㅎ

let condition = indexPath.item == selectedIndex

cell.backgroundColor = condition ? .purple10 : .clear
cell.yearLabel.attributedText = String(2012 + indexPath.item).pretendardString(with: condition ? .body1 : .body2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

2012가 해당 클래스에서 자주 쓰이면서 동시에 중요한 의미(LCK가 시작한 년도)를 지니는 것 같은데, 이것도 상수화 하면 좋을 것 같은데 어떠세요?

Copy link
Member Author

Choose a reason for hiding this comment

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

오... 생각도 못하고 있었는데 너무 좋네요! 코드 가독성도 올라가고 유지보수에도 편리할 것 같습니다. 반영했습니다 ㅎㅎ

let defaultYear = 2012 + defaultIndex

selectedYearIndex = defaultIndex
rootView.pullDownButton.configuration?.attributedTitle = String(defaultYear).pretendardString(with: .body1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

String으로 생성할 수도 있겠지만, "\(defaultYear)"도 가능하답니다~

Copy link
Member Author

Choose a reason for hiding this comment

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

반영했습니다 ~~!!!

Comment on lines 18 to 20
private var yearCount: Int {
return Calendar.current.component(.year, from: Date()) - 2012 + 1
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

현재 날짜와 시간을 Date()로 구할 수도 있겠지만, .now라는 타입 프로퍼티도 있습니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

헉 ... 대박 너무 편리하네요 좋은 지식 공유 감사합니다!

@github-project-automation github-project-automation bot moved this to In Review in Wable-iOS Apr 18, 2025
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

🧹 Nitpick comments (2)
Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift (2)

182-182: Use _ for unused parameters

The indexPath parameter is not used in this closure.

-UICollectionView.CellRegistration<
-            ContentCollectionViewCell,
-            Content
-        > { [weak self] cell, indexPath, item in
+UICollectionView.CellRegistration<
+            ContentCollectionViewCell,
+            Content
+        > { [weak self] cell, _, item in
🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 182-182: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)


414-414: Use _ for unused parameters

The layoutEnvironment parameter is not used in this closure.

-return UICollectionViewCompositionalLayout { [weak self] (
-            sectionIndex,
-            layoutEnvironment
-        ) -> NSCollectionLayoutSection? in
+return UICollectionViewCompositionalLayout { [weak self] (
+            sectionIndex,
+            _
+        ) -> NSCollectionLayoutSection? in
🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 414-414: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between eec98be and 96edde7.

📒 Files selected for processing (3)
  • Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift (4 hunks)
  • Wable-iOS/Presentation/Home/ViewModel/HomeViewModel.swift (2 hunks)
  • Wable-iOS/Presentation/Onboarding/ViewController/LCKYearViewController.swift (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • Wable-iOS/Presentation/Home/ViewModel/HomeViewModel.swift
  • Wable-iOS/Presentation/Onboarding/ViewController/LCKYearViewController.swift
🧰 Additional context used
🪛 SwiftLint (0.57.0)
Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift

[Warning] 182-182: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)


[Warning] 414-414: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)

🔇 Additional comments (5)
Wable-iOS/Presentation/Home/View/HomeDetailViewController.swift (5)

198-199: Good fix for the placeholder issue!

Adding endEditing(true) here properly dismisses the keyboard when switching to comment mode, which addresses the issue mentioned in the PR objectives where comment placeholders were being overwritten when switching between comment and reply buttons.


234-234: Good fix for the placeholder issue!

Adding endEditing(true) here properly dismisses the keyboard when switching to reply mode, completing the fix for the placeholder overwriting issue.


179-242: LGTM: Improved code formatting

The reformatting of the setup code to use multiline syntax improves readability, making the code structure clearer and more maintainable.

🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 182-182: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)


245-263: LGTM: Consistent multiline formatting

Consistent application of multiline formatting for complex method calls makes the code more readable.


412-415: LGTM: Consistent multiline formatting

Consistent application of multiline formatting for closures improves code readability.

🧰 Tools
🪛 SwiftLint (0.57.0)

[Warning] 414-414: Unused parameter in a closure should be replaced with _

(unused_closure_parameter)

@youz2me youz2me merged commit 482ff3c into develop Apr 18, 2025
1 check passed
@youz2me youz2me deleted the fix/#175-qa branch April 18, 2025 06:38
@github-project-automation github-project-automation bot moved this from In Review to Done in Wable-iOS Apr 18, 2025
youz2me added a commit that referenced this pull request Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ fix 기능적 버그나 오류 해결 시 사용 🦉 유진 🛌🛌🛌🛌🛌🛌🛌🛌🛌🛌

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Fix] 1차 QA 반영

3 participants