Skip to content

feat: 키워드, 매력포인트 추가#829

Open
devfeijoa wants to merge 3 commits intodevelopfrom
feat/828
Open

feat: 키워드, 매력포인트 추가#829
devfeijoa wants to merge 3 commits intodevelopfrom
feat/828

Conversation

@devfeijoa
Copy link
Contributor

@devfeijoa devfeijoa commented Mar 10, 2026

📌𝘐𝘴𝘴𝘶𝘦𝘴

📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯

  • 키워드 : 차원이동(세계관), 스팀펑크(소재) 추가
  • 매력포인트 : 필력 추가

📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵

Screen_recording_20260310_182431.mp4
Screenshot_20260310_182537

💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴

  1. 키워드 관련
  • 서버에서 키워드가 추가되면 자동으로 추가되는 것으로 보여 따로 수정한 코드는 없습니다.
  1. 매력포인트 관련
    작품 평가 화면의 매력포인트 부분을 '필력'을 추가 하면서 2줄 구조로 변경했습니다.
    기존 방식은 줄바꿈 시 각 줄이 start 정렬되어 피그마와 다르게 보였고, 이번에는 각 row를 별도 그룹으로 분리해 가운데 정렬되도록 수정했습니다.
    따라서 매력포인트 칩 영역을 row1, row2 두 개의 WebsosoChipGroup으로 분리하고, 이를 LinearLayout으로 감싸center_horizontal 정렬되도록 변경했습니다.
    이를 통해 각 줄이 독립적으로 가운데 정렬된 형태로 보이도록 맞췄습니다.

추가로 필력이 노출/매핑되도록 novel_rating_charm_points와 CharmPoint enum을 함께 업데이트했습니다.
추가로, 기존 선택 상태를 갱신하던 로직은 단일 wcgNovelRatingCharmPoints 기준이었는데, row1/row2 구조로 변경되면서 두 그룹을 모두 순회하도록 수정했습니다.

작품 평가 화면과 마이페이지가 매력포인트를 각각 다른 enum/매핑으로 관리하고 있어, 필력 값이 마이페이지에서 누락되고 있었습니다. 따라서 해당 매핑도 함께 추가했습니다.

@devfeijoa devfeijoa requested review from Sadturtleman, m6z1 and s9hn March 10, 2026 07:46
@devfeijoa devfeijoa self-assigned this Mar 10, 2026
@devfeijoa devfeijoa added 🍯 [FEAT] 새로운 기능을 개발합니다. [👸 공주 은영] labels Mar 10, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Walkthrough

매력포인트에 "필력"을 추가하고, 매력포인트 칩을 한 행에서 두 행으로 분리하는 레이아웃·렌더링 로직 및 선택 처리(두 칩 행 모두)를 리팩토링했습니다. 관련 리소스와 모델(enum)도 업데이트되었습니다.

Changes

Cohort / File(s) Summary
매력포인트 모델
app/src/main/java/com/into/websoso/ui/novelRating/model/CharmPoint.kt, app/src/main/java/com/into/websoso/ui/main/myPage/model/AttractivePoints.kt
WRITINGSKILL("writingskill","필력") enum 상수 추가. AttractivePoints companion의 fromString 구현을 entries.find로 변경(동일 목적).
Activity 로직
app/src/main/java/com/into/websoso/ui/novelRating/NovelRatingActivity.kt
uiState 관찰 핸들러 블록을 다중 라인으로 정리. 매력포인트 칩 렌더링을 두 행(두 개의 ChipGroup)으로 분할하고 칩 생성/클릭/선택 업데이트 로직을 헬퍼로 분리·조정.
레이아웃 변경
app/src/main/res/layout/activity_novel_rating.xml
기존 단일 WebsosoChipGroup을 제거하고, 두 개의 내부 WebsosoChipGroup(wcg_novel_rating_charm_points_row1, wcg_novel_rating_charm_points_row2)을 포함하는 LinearLayout 컨테이너(ll_novel_rating_charm_points_container)로 교체.
문자열 리소스
core/resource/src/main/res/values/strings.xml
novel_rating_charm_points 값이 "세계관,분위기,소재,캐릭터,관계"에서 "세계관,소재,필력,캐릭터,관계,분위기"로 변경(필력 추가 및 순서 조정).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • s9hn
  • m6z1
  • Sadturtleman

Poem

🐰 필력을 품은 칩이 폴짝,
두 줄로 나뉘어 춤을 추네.
작은 선택 하나에도 반짝임,
코드 밭에 당근 한 자루 남기고,
즐겁게 배포하자요! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 '키워드, 매력포인트 추가'로 변경 사항의 핵심(필력 매력포인트 추가 및 UI 구조 개선)을 명확하게 반영하고 있습니다.
Linked Issues check ✅ Passed 코드 변경사항이 연결된 이슈 #828의 요구사항을 충족합니다: 필력 매력포인트 추가 [CharmPoint.kt, AttractivePoints.kt], 키워드 업데이트 [strings.xml], UI 개선 [NovelRatingActivity.kt, activity_novel_rating.xml].
Out of Scope Changes check ✅ Passed 모든 변경사항이 이슈 #828의 범위 내에 있습니다: 필력 추가, 문자열 리소스 업데이트, UI 레이아웃 개선이 모두 명시된 목표에 부합합니다.
Description check ✅ Passed PR 설명이 필수 템플릿의 모든 주요 섹션을 포함하고 있으며, 구체적인 작업 내용과 스크린샷을 제공하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/828

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.

🧹 Nitpick comments (1)
app/src/main/java/com/into/websoso/ui/novelRating/NovelRatingActivity.kt (1)

255-268: 행 분할이 문자열 순서와 3개 고정 가정에 너무 묶여 있습니다.

지금은 6개라 맞아 보이지만, novel_rating_charm_points 순서가 바뀌거나 항목이 하나만 더 늘어도 두 번째 row에 전부 몰립니다. 게다가 XML 쪽 두 row가 모두 singleLine=true라 이후 칩이 잘릴 가능성이 큽니다. 표시 순서는 타입 안전한 목록으로 두고, 행은 chunked(3)처럼 계산하는 쪽이 안전합니다.

♻️ 예시
-        val firstRow = charmPoints.take(3)
-        val secondRow = charmPoints.drop(3)
+        val rows = charmPoints.chunked(3)

         binding.wcgNovelRatingCharmPointsRow1.removeAllViews()
         binding.wcgNovelRatingCharmPointsRow2.removeAllViews()

-        firstRow.forEach { charmPoint ->
+        rows.getOrNull(0).orEmpty().forEach { charmPoint ->
             binding.wcgNovelRatingCharmPointsRow1.addChip(createCharmPointChip(charmPoint))
         }

-        secondRow.forEach { charmPoint ->
+        rows.getOrNull(1).orEmpty().forEach { charmPoint ->
             binding.wcgNovelRatingCharmPointsRow2.addChip(createCharmPointChip(charmPoint))
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/com/into/websoso/ui/novelRating/NovelRatingActivity.kt`
around lines 255 - 268, 현재 NovelRatingActivity에서 charmPoints를 고정
2행(take(3)/drop(3))으로 나누고 있어 항목 수나 순서 변화에 취약합니다; charmPoints =
getString(novel_rating_charm_points).toWrappedCharmPoint()로 받은 리스트를 고정 가정 대신
charmPoints.chunked(3)로 행 단위로 분할하고 각 행(chunk)을 순회하면서 createCharmPointChip을 사용해
칩을 추가하세요; 기존 binding.wcgNovelRatingCharmPointsRow1/Row2는 먼저 removeAllViews()로 비운
뒤 chunk 인덱스에 따라 0이면 Row1, 1이면 Row2에 추가하고 더 많은 chunk가 나오면 새 ChipGroup(또는 XML에서 미리
준비한 추가 행)을 인플레이트하거나 동적으로 생성해 추가하도록 변경해 대처하세요.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/src/main/java/com/into/websoso/ui/novelRating/NovelRatingActivity.kt`:
- Around line 255-268: 현재 NovelRatingActivity에서 charmPoints를 고정
2행(take(3)/drop(3))으로 나누고 있어 항목 수나 순서 변화에 취약합니다; charmPoints =
getString(novel_rating_charm_points).toWrappedCharmPoint()로 받은 리스트를 고정 가정 대신
charmPoints.chunked(3)로 행 단위로 분할하고 각 행(chunk)을 순회하면서 createCharmPointChip을 사용해
칩을 추가하세요; 기존 binding.wcgNovelRatingCharmPointsRow1/Row2는 먼저 removeAllViews()로 비운
뒤 chunk 인덱스에 따라 0이면 Row1, 1이면 Row2에 추가하고 더 많은 chunk가 나오면 새 ChipGroup(또는 XML에서 미리
준비한 추가 행)을 인플레이트하거나 동적으로 생성해 추가하도록 변경해 대처하세요.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8196f223-0560-4242-99c7-114ed65fdeef

📥 Commits

Reviewing files that changed from the base of the PR and between 2c1dff4 and e6cb09c.

📒 Files selected for processing (4)
  • app/src/main/java/com/into/websoso/ui/novelRating/NovelRatingActivity.kt
  • app/src/main/java/com/into/websoso/ui/novelRating/model/CharmPoint.kt
  • app/src/main/res/layout/activity_novel_rating.xml
  • core/resource/src/main/res/values/strings.xml

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.

🧹 Nitpick comments (1)
app/src/main/java/com/into/websoso/ui/main/myPage/model/AttractivePoints.kt (1)

15-15: fromString()은 표시 문자열까지 함께 받게 해두는 편이 안전합니다.

이 함수는 API 응답 문자열을 바로 받아 변환하는 진입점인데, 현재는 enum name 형태만 매칭해서 한글 라벨이 들어오면 호출부의 mapNotNull에서 조용히 누락됩니다. 같은 개념이 다른 모델에서는 값/표시명을 따로 들고 있으니, 여기서도 korean까지 허용해 두면 포맷 변화에 더 견고합니다.

예시 수정안
-        fun fromString(value: String): AttractivePoints? = entries.find { it.name.equals(value, ignoreCase = true) }
+        fun fromString(value: String): AttractivePoints? =
+            entries.find { point ->
+                point.name.equals(value, ignoreCase = true) || point.korean == value
+            }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/com/into/websoso/ui/main/myPage/model/AttractivePoints.kt`
at line 15, fromString currently only matches enum constant names so API
responses containing the Korean label get dropped; update
AttractivePoints.fromString to also compare the incoming value against the
enum's display label (e.g., the korean property) in a case-insensitive/trimmed
way so it returns the correct AttractivePoints for either the enum name or its
korean label (keep the signature AttractivePoints?.fromString(value: String) and
search entries by name.equals(value, ignoreCase = true) || korean.equals(value,
ignoreCase = true)).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/src/main/java/com/into/websoso/ui/main/myPage/model/AttractivePoints.kt`:
- Line 15: fromString currently only matches enum constant names so API
responses containing the Korean label get dropped; update
AttractivePoints.fromString to also compare the incoming value against the
enum's display label (e.g., the korean property) in a case-insensitive/trimmed
way so it returns the correct AttractivePoints for either the enum name or its
korean label (keep the signature AttractivePoints?.fromString(value: String) and
search entries by name.equals(value, ignoreCase = true) || korean.equals(value,
ignoreCase = true)).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3b6c62ce-8e33-4c8b-9e6a-136a2bf73b9b

📥 Commits

Reviewing files that changed from the base of the PR and between e6cb09c and cb10d7a.

📒 Files selected for processing (1)
  • app/src/main/java/com/into/websoso/ui/main/myPage/model/AttractivePoints.kt

chip.isSelected = previousSelectedCharmPoints.contains(
charmPoints.find { charmPoint -> charmPoint.title == chip.text.toString() },
)
val selectedTitles = previousSelectedCharmPoints.map { it.title }.toSet()
Copy link
Contributor

Choose a reason for hiding this comment

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

previousSelectedCharmPoints가 이미 unique한 값들을 가지며 개수가 적다면 toList가 더 빠른 것으로 알고있습니다!

그리고 데이터가 많다면 mapTo(HashSet()) 구문을 써보는 것도 고려하시면 좋을 것 같아요!

Copy link
Contributor

Choose a reason for hiding this comment

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

고생하셨습니다

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: 키워드, 매력포인트 추가

2 participants