Conversation
…into ui/THIP-TextHip#34-group_note_create_page # Conflicts: # app/src/main/java/com/texthip/thip/ui/group/myroom/screen/GroupRoomScreen.kt # app/src/main/res/values/strings.xml
Walkthrough이번 변경에서는 그룹 노트 및 투표 생성 화면, 입력 섹션(페이지, 의견, 투표), 커스텀 입력 필드 등 다양한 Jetpack Compose UI 컴포넌트가 대거 추가 및 리팩터링되었습니다. 주요 입력 컴포넌트의 상태 관리 방식이 외부 제어형으로 전환되고, 아이콘 및 리소스가 추가·수정되었습니다. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GroupNoteCreateScreen
participant PageInputSection
participant OpinionInputSection
participant ToolTipModal
User->>GroupNoteCreateScreen: 화면 진입
GroupNoteCreateScreen->>PageInputSection: 페이지 입력/일반리뷰 토글 렌더링
GroupNoteCreateScreen->>OpinionInputSection: 의견 입력 렌더링
User->>PageInputSection: 페이지 입력/토글 조작
User->>OpinionInputSection: 의견 입력
User->>PageInputSection: info 아이콘 클릭
PageInputSection->>GroupNoteCreateScreen: 위치 전달
GroupNoteCreateScreen->>ToolTipModal: 툴팁 표시
User->>ToolTipModal: 닫기
ToolTipModal-->>GroupNoteCreateScreen: 툴팁 닫힘
sequenceDiagram
participant User
participant GroupVoteCreateScreen
participant PageInputSection
participant VoteInputSection
participant ToolTipModal
User->>GroupVoteCreateScreen: 화면 진입
GroupVoteCreateScreen->>PageInputSection: 페이지 입력/일반리뷰 토글 렌더링
GroupVoteCreateScreen->>VoteInputSection: 투표 제목/옵션 입력 렌더링
User->>VoteInputSection: 옵션 입력/추가/삭제
User->>PageInputSection: info 아이콘 클릭
PageInputSection->>GroupVoteCreateScreen: 위치 전달
GroupVoteCreateScreen->>ToolTipModal: 툴팁 표시
User->>ToolTipModal: 닫기
ToolTipModal-->>GroupVoteCreateScreen: 툴팁 닫힘
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 6
♻️ Duplicate comments (1)
app/src/main/java/com/texthip/thip/ui/group/note/screen/GroupVoteCreateScreen.kt (1)
46-46: TODO 주석 해결서버 데이터 연동 관련 TODO가 남아있습니다.
GroupNoteCreateScreen과 동일한 이슈입니다.
🧹 Nitpick comments (2)
app/src/main/java/com/texthip/thip/ui/group/note/screen/GroupNoteCreateScreen.kt (1)
45-45: TODO 주석 해결서버 데이터 연동 관련 TODO가 남아있습니다.
isEligible상태를 서버에서 가져오는 로직을 구현하거나, 향후 작업을 위한 별도 이슈를 생성하시겠습니까?app/src/main/java/com/texthip/thip/ui/group/note/component/VoteInputSection.kt (1)
125-127: Preview에서 중복 로직 제거컴포넌트 내부의
maxOptions체크와 Preview의 체크가 중복됩니다.onAddOption = { - if (options.size < 5) { - options = options.toMutableList().also { it.add("") } - } + options = options.toMutableList().also { it.add("") } },컴포넌트 내부에서 이미
maxOptions체크를 하고 있으므로 Preview에서는 중복 체크가 불필요합니다.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
app/src/main/java/com/texthip/thip/ui/common/buttons/ExpandableFloatingButton.kt(2 hunks)app/src/main/java/com/texthip/thip/ui/common/buttons/ToggleSwitchButton.kt(2 hunks)app/src/main/java/com/texthip/thip/ui/common/forms/BookPageTextField.kt(4 hunks)app/src/main/java/com/texthip/thip/ui/common/forms/BorderedTextField.kt(1 hunks)app/src/main/java/com/texthip/thip/ui/common/modal/ToolTip.kt(5 hunks)app/src/main/java/com/texthip/thip/ui/group/note/component/OpinionInputSection.kt(1 hunks)app/src/main/java/com/texthip/thip/ui/group/note/component/PageInputSection.kt(1 hunks)app/src/main/java/com/texthip/thip/ui/group/note/component/VoteInputSection.kt(1 hunks)app/src/main/java/com/texthip/thip/ui/group/note/screen/GroupNoteCreateScreen.kt(1 hunks)app/src/main/java/com/texthip/thip/ui/group/note/screen/GroupVoteCreateScreen.kt(1 hunks)app/src/main/res/drawable/ic_x_circle_darkgrey.xml(1 hunks)app/src/main/res/drawable/ic_x_circle_grey.xml(1 hunks)app/src/main/res/values/strings.xml(4 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: rbqks529
PR: THIP-TextHip/THIP-Android#30
File: app/src/main/java/com/texthip/thip/ui/common/cards/CardItemRoomSmall.kt:108-112
Timestamp: 2025-07-01T07:19:10.981Z
Learning: The user rbqks529 prefers to extract hardcoded UI strings to StringResource files (strings.xml) rather than keeping them inline in Compose components, which is a good practice for maintainability and localization in Android development.
app/src/main/java/com/texthip/thip/ui/common/modal/ToolTip.kt (1)
Learnt from: rbqks529
PR: THIP-TextHip/THIP-Android#30
File: app/src/main/java/com/texthip/thip/ui/common/cards/CardItemRoomSmall.kt:108-112
Timestamp: 2025-07-01T07:19:10.981Z
Learning: The user rbqks529 prefers to extract hardcoded UI strings to StringResource files (strings.xml) rather than keeping them inline in Compose components, which is a good practice for maintainability and localization in Android development.
app/src/main/java/com/texthip/thip/ui/group/note/component/OpinionInputSection.kt (1)
Learnt from: rbqks529
PR: THIP-TextHip/THIP-Android#30
File: app/src/main/java/com/texthip/thip/ui/common/cards/CardItemRoomSmall.kt:108-112
Timestamp: 2025-07-01T07:19:10.981Z
Learning: The user rbqks529 prefers to extract hardcoded UI strings to StringResource files (strings.xml) rather than keeping them inline in Compose components, which is a good practice for maintainability and localization in Android development.
app/src/main/res/values/strings.xml (1)
Learnt from: rbqks529
PR: THIP-TextHip/THIP-Android#30
File: app/src/main/java/com/texthip/thip/ui/common/cards/CardItemRoomSmall.kt:108-112
Timestamp: 2025-07-01T07:19:10.981Z
Learning: The user rbqks529 prefers to extract hardcoded UI strings to StringResource files (strings.xml) rather than keeping them inline in Compose components, which is a good practice for maintainability and localization in Android development.
app/src/main/java/com/texthip/thip/ui/common/forms/BookPageTextField.kt (1)
Learnt from: rbqks529
PR: THIP-TextHip/THIP-Android#30
File: app/src/main/java/com/texthip/thip/ui/common/cards/CardItemRoomSmall.kt:108-112
Timestamp: 2025-07-01T07:19:10.981Z
Learning: The user rbqks529 prefers to extract hardcoded UI strings to StringResource files (strings.xml) rather than keeping them inline in Compose components, which is a good practice for maintainability and localization in Android development.
🧬 Code Graph Analysis (2)
app/src/main/java/com/texthip/thip/ui/group/note/component/VoteInputSection.kt (1)
app/src/main/java/com/texthip/thip/ui/common/forms/BorderedTextField.kt (1)
BorderedTextField(35-119)
app/src/main/java/com/texthip/thip/ui/group/note/component/PageInputSection.kt (2)
app/src/main/java/com/texthip/thip/ui/common/forms/BookPageTextField.kt (1)
BookPageTextField(42-134)app/src/main/java/com/texthip/thip/ui/common/buttons/ToggleSwitchButton.kt (1)
ToggleSwitchButton(23-54)
🔇 Additional comments (23)
app/src/main/java/com/texthip/thip/ui/common/modal/ToolTip.kt (5)
59-59: 새로운 isEligible 파라미터 추가 승인적격성에 따른 UI 피드백을 제공하는 파라미터 추가가 적절합니다. 기본값
true로 설정하여 기존 코드와의 호환성을 유지한 점도 좋습니다.
73-73: 화살표 패딩 증가 승인패딩을 24.dp에서 64.dp로 증가시켜 툴팁 화살표의 위치를 조정한 것이 적절합니다. 이는 더 나은 시각적 균형을 제공할 것입니다.
Also applies to: 80-80
98-98: 조건부 텍스트 색상 로직 승인
isEligible값에 따라 텍스트 색상을 조건부로 변경하는 로직이 명확하고 직관적입니다. 적격한 경우 NeonGreen, 부적격한 경우 Red로 표시하여 사용자에게 명확한 피드백을 제공합니다.
120-120: 문자열 리소스 사용 승인하드코딩된 문자열을
stringResource로 변경한 것이 좋습니다. 이전 학습 내용에 따르면 사용자가 문자열을 StringResource 파일로 추출하는 것을 선호하므로 이는 적절한 변경입니다.Also applies to: 127-127, 134-134
139-139: 프리뷰에서 isEligible 파라미터 테스트 승인프리뷰에서
isEligible = false를 명시적으로 설정하여 빨간색 텍스트 색상을 테스트하는 것이 좋습니다. 이를 통해 두 가지 상태 모두를 시각적으로 확인할 수 있습니다.app/src/main/java/com/texthip/thip/ui/common/buttons/ExpandableFloatingButton.kt (2)
68-68: 메뉴 컨테이너 패딩 조정 승인확장된 메뉴의 bottom 패딩을 94.dp에서 62.dp로 줄이고 end 패딩을 제거한 것이 적절합니다. 이는 더 균형 잡힌 레이아웃을 제공할 것입니다.
103-103: FloatingActionButton 크기 조정 승인버튼 크기를 56.dp에서 50.dp로 줄인 것이 더 컴팩트한 디자인을 제공합니다. 이는 전체적인 UI 일관성을 향상시킬 것입니다.
app/src/main/res/drawable/ic_x_circle_darkgrey.xml (1)
1-16: 새로운 아이콘 리소스 추가 승인다크 그레이 X 원형 아이콘이 잘 정의되어 있습니다. 기존
ic_x_circle_grey.xml과 함께 다양한 UI 상태에서 사용할 수 있는 일관된 아이콘 세트를 제공합니다.app/src/main/res/drawable/ic_x_circle_grey.xml (2)
2-5: 아이콘 크기 표준화 승인아이콘 크기를 25dp에서 24dp로 변경하여 크기를 표준화한 것이 좋습니다. 뷰포트와 패스 좌표도 적절히 조정되었습니다.
7-7: 색상 및 패스 좌표 업데이트 승인스트로크 색상을 #FEFEFE에서 #3D3D3D로 변경하여 더 나은 시각적 대비를 제공하고, 패스 좌표를 새로운 크기에 맞게 조정한 것이 적절합니다.
Also applies to: 10-10, 14-14
app/src/main/java/com/texthip/thip/ui/common/buttons/ToggleSwitchButton.kt (4)
26-26: enabled 파라미터 추가 승인Switch 컴포넌트의 활성/비활성 상태를 제어할 수 있는
enabled파라미터 추가가 적절합니다. 기본값을true로 설정하여 기존 코드와의 호환성을 유지했습니다.
30-30: height 제약 추가 승인Switch에
height(30.dp)제약을 추가하여 일관된 크기를 제공하는 것이 좋습니다. 이는 다양한 화면에서 일관된 UI를 보장합니다.
35-35: disabled 상태 색상 설정 승인비활성 상태에서도 활성 상태와 동일한 색상을 유지하도록 설정한 것이 적절합니다. 이는 일관된 시각적 경험을 제공하면서도 사용자가 컴포넌트의 상태를 명확히 인식할 수 있게 합니다.
Also applies to: 37-37, 39-39, 41-41, 43-43
45-45: enabled 파라미터 전달 승인새로 추가된
enabled파라미터를 Switch 컴포넌트에 적절히 전달하여 기능을 완성했습니다.app/src/main/java/com/texthip/thip/ui/group/note/component/OpinionInputSection.kt (1)
25-32: 컴포넌트 설계가 잘 되어 있습니다매개변수의 기본값 설정과 외부 상태 관리 방식이 적절하며, 재사용성을 고려한 설계가 돋보입니다.
app/src/main/java/com/texthip/thip/ui/group/note/screen/GroupNoteCreateScreen.kt (1)
54-55: 빈 콜백 함수 구현 필요네비게이션 콜백들이 빈 상태로 남아있어 실제 기능이 동작하지 않습니다.
실제 네비게이션 로직이 구현되어야 합니다. 매개변수로 콜백을 받도록 수정하는 것을 고려해보세요.
app/src/main/java/com/texthip/thip/ui/group/note/component/VoteInputSection.kt (1)
32-42: 컴포넌트 매개변수 설계가 우수합니다동적 옵션 관리를 위한 콜백 구조와 제약 조건 매개변수가 잘 설계되어 있습니다.
app/src/main/java/com/texthip/thip/ui/group/note/screen/GroupVoteCreateScreen.kt (1)
49-53: 복잡한 validation 로직이 잘 구현되어 있습니다여러 조건을 고려한 완료 버튼 활성화 로직이 명확하고 정확합니다.
app/src/main/java/com/texthip/thip/ui/group/note/component/PageInputSection.kt (2)
99-106: 토글 상태 변경 시 텍스트 처리 로직이 우수합니다토글 활성화 시 텍스트를 자동으로 클리어하고, 비활성화 시 적절한 초기값을 설정하는 로직이 사용자 경험을 고려한 좋은 구현입니다.
80-90: 툴팁 위치 캡처 로직이 잘 구현되어 있습니다
onGloballyPositioned를 사용한 아이콘 위치 캡처와 클릭 이벤트 처리가 적절하게 구현되어 있습니다.app/src/main/java/com/texthip/thip/ui/common/forms/BorderedTextField.kt (1)
36-119: 외부 상태 관리 패턴으로의 리팩토링이 잘 구현되었습니다.
OutlinedTextField에서BasicTextField로의 전환과 외부 상태 관리 패턴 적용이 깔끔하게 처리되었습니다. 포커스 상태에 따른 아이콘 변경 로직도 명확합니다.app/src/main/res/values/strings.xml (1)
14-14: 그룹 노트 및 투표 관련 문자열 리소스가 잘 추가되었습니다.새로운 기능을 위한 문자열 리소스들이 적절한 섹션에 체계적으로 추가되었으며, 네이밍 컨벤션도 일관성 있게 유지되고 있습니다.
Also applies to: 154-190
app/src/main/java/com/texthip/thip/ui/common/forms/BookPageTextField.kt (1)
45-134: 제어 컴포넌트 패턴으로의 리팩토링이 훌륭합니다.
bookPage에서bookTotalPage로의 파라미터 이름 변경이 더 명확합니다enabled파라미터 추가로 유연성이 향상되었습니다- 입력 검증 로직이 적절히 구현되었습니다
- 에러 상태에 따른 UI 변경이 잘 처리되었습니다
| onValueChange = { | ||
| if (it.length <= maxLength) onTextChange(it) | ||
| }, |
There was a problem hiding this comment.
🛠️ Refactor suggestion
텍스트 입력 제한 로직 개선 필요
현재 로직에서는 maxLength를 초과하면 입력을 차단하지만, 초과된 텍스트가 이미 있는 경우 사용자가 텍스트를 수정하거나 줄일 수 없게 됩니다.
다음과 같이 수정하여 초과 상태에서도 텍스트 편집이 가능하도록 개선하세요:
- onValueChange = {
- if (it.length <= maxLength) onTextChange(it)
- },
+ onValueChange = { newText ->
+ // 길이가 줄어들거나 최대 길이 이하일 때만 허용
+ if (newText.length <= text.length || newText.length <= maxLength) {
+ onTextChange(newText)
+ }
+ },📝 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.
| onValueChange = { | |
| if (it.length <= maxLength) onTextChange(it) | |
| }, | |
| onValueChange = { newText -> | |
| // 길이가 줄어들거나 최대 길이 이하일 때만 허용 | |
| if (newText.length <= text.length || newText.length <= maxLength) { | |
| onTextChange(newText) | |
| } | |
| }, |
🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/ui/group/note/component/OpinionInputSection.kt
around lines 48 to 50, the current onValueChange logic blocks input when the
text length exceeds maxLength, preventing users from editing or reducing the
text if it is already too long. Modify the logic to always allow text changes
but truncate the input to maxLength if it exceeds the limit, ensuring users can
edit and shorten the text even when over the limit.
| isGeneralReview = isGeneralReview, | ||
| onGeneralReviewToggle = { isGeneralReview = it }, | ||
| isEligible = isEligible, | ||
| bookTotalPage = 600, |
There was a problem hiding this comment.
🛠️ Refactor suggestion
하드코딩된 값을 매개변수로 변경
bookTotalPage = 600이 하드코딩되어 있습니다. 이는 동적으로 전달받아야 하는 값입니다.
@Composable
-fun GroupNoteCreateScreen() {
+fun GroupNoteCreateScreen(
+ bookTotalPage: Int = 600, // 기본값은 유지하되 외부에서 주입 가능하도록
+ onNavigateBack: () -> Unit = {},
+ onComplete: () -> Unit = {}
+) {🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/ui/group/note/screen/GroupNoteCreateScreen.kt
at line 69, the value 600 is hardcoded for bookTotalPage. Modify the code to
accept bookTotalPage as a parameter to the function or constructor where this
value is used, and pass the dynamic value instead of the fixed 600.
There was a problem hiding this comment.
@rbqks529 맞습니다! 하드코딩된 값을 매개변수로 변경하면 컴포넌트의 재사용성과 유지보수성이 훨씬 좋아지죠.
이 변경사항을 구현하도록 도와드릴까요? `` 태그를 사용해서 코드 변경을 계획할 수 있습니다.
🐰✨
/| /|
( :v: )
|(_)|
🧠 Learnings used
Learnt from: rbqks529
PR: THIP-TextHip/THIP-Android#30
File: app/src/main/java/com/texthip/thip/ui/common/cards/CardItemRoomSmall.kt:108-112
Timestamp: 2025-07-01T07:19:10.981Z
Learning: The user rbqks529 prefers to extract hardcoded UI strings to StringResource files (strings.xml) rather than keeping them inline in Compose components, which is a good practice for maintainability and localization in Android development.
⏳ Preparing changes...
There was a problem hiding this comment.
A summary of the changes CodeRabbit can apply:
- Modify GroupNoteCreateScreen.kt by updating the GroupNoteCreateScreen function to accept parameters for total pages and navigation callbacks, and replace hardcoded values and inline callbacks with these parameters to enable dynamic behavior and external control.
- ✅ Create PR with these edits
- 📌 Create commit in current branch
- 📋 Get copyable edits
| isGeneralReview = isGeneralReview, | ||
| onGeneralReviewToggle = { isGeneralReview = it }, | ||
| isEligible = isEligible, | ||
| bookTotalPage = 600, |
There was a problem hiding this comment.
🛠️ Refactor suggestion
하드코딩된 값을 매개변수로 변경
GroupNoteCreateScreen과 동일한 이슈로 bookTotalPage = 600이 하드코딩되어 있습니다.
@Composable
-fun GroupVoteCreateScreen() {
+fun GroupVoteCreateScreen(
+ bookTotalPage: Int = 600,
+ onNavigateBack: () -> Unit = {},
+ onComplete: () -> Unit = {}
+) {Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In
app/src/main/java/com/texthip/thip/ui/group/note/screen/GroupVoteCreateScreen.kt
at line 75, the value 600 for bookTotalPage is hardcoded. Modify the code to
pass bookTotalPage as a parameter to the function or constructor instead of
using the fixed value 600, ensuring it can be dynamically set from outside the
method or class.
rbqks529
left a comment
There was a problem hiding this comment.
전체 코드 확인했습니다. 이제 기록장은 다 완성된거일까요?
There was a problem hiding this comment.
투표 생성 페이지에서 사용될 수 있게 수정하신거 같네요 확인했습니다!
| ) { | ||
| var text by rememberSaveable { mutableStateOf("") } | ||
| val myStyle = typography.menu_r400_s14_h24.copy(lineHeight = 14.sp) | ||
| val interactionSource = remember { MutableInteractionSource() } |
There was a problem hiding this comment.
처음 보는 코드인데 혹시 어떤 역할인지 물어봐도 될까요? InteractionSource는 처음봤네요
There was a problem hiding this comment.
이 textfield가 focus가 안됐을 때, 됐을 때, 입력창이 채워졌을 때 등 여러가지 상태가 있는데 그 중에서 focus일 때의 상태를 받기 위한 코드입니닷!
| import com.texthip.thip.ui.theme.ThipTheme.typography | ||
| import androidx.compose.ui.platform.LocalDensity | ||
|
|
||
| enum class ArrowPosition { |
There was a problem hiding this comment.
이 이넘 클래스는 해당 툴팁 함수에서 같이 사용되는건가요?
There was a problem hiding this comment.
이거 제가 만든 코드 아니고 주연이가 만든 코드에서 위치만 살짝 수정한거입니둣 ..ㅎ... 근데 이 툴팁에서만 사용되는거같아요 ~
| isGeneralReview = isGeneralReview, | ||
| onGeneralReviewToggle = { isGeneralReview = it }, | ||
| isEligible = isEligible, | ||
| bookTotalPage = 600, |
➕ 이슈 링크
🔎 작업 내용
📸 스크린샷
기록 작성 페이지 (총평 활성화 안된 경우)
2025-07-19.12.42.21.mov
기록 작성 페이지 (총평 활성화 된 경우)
2025-07-19.12.44.51.mov
투표 생성 페이지
2025-07-19.12.46.40.mov
😢 해결하지 못한 과제
이전에 작업했던 화면들에서 새로 생긴 데이터가 없는 경우의 화면들은 새로 이슈 파서 작업하겠습니다 .. 작업 시간이 딜레이돼서 죄송함다ㅠ
📢 리뷰어들에게