Conversation
WalkthroughEditText 외부 터치 감지를 통해 키보드 숨김 동작을 개선하고, Rect 기반 히트 감지로 경계 인식 처리를 구현하며, 스크롤 인터페이스 관리를 정제하고 Done 버튼 동작 범위를 피드 편집 시나리오로 확대했습니다. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt (1)
156-166:⚠️ Potential issue | 🟠 Major세 번째 조건
editFeedModel.feedCategory.isEmpty()가 의도치 않은 동작을 유발할 수 있습니다.두 번째 조건
editFeedModel.feedId == DEFAULT_FEED_ID가 새 피드 생성(feedId = -1)을 이미 처리하므로, 세 번째 조건은 사실상 feedId가 유효한 기존 피드에서만 실행됩니다. 이 경우 feedCategory가 비어있으면editFeed()대신createFeed()가 호출되어, 기존 피드를 수정하는 대신 중복 생성이 발생할 수 있습니다.현재 구현에서 기존 피드의 feedCategory는 서버 데이터로 채워지므로 실제 문제는 드물지만, 로직적으로는 조건 2와 조건 3이 중복되거나 모순될 수 있습니다. 조건 3을 제거하거나 feedId 검사와 함께 명시적으로 결합하는 것이 안전합니다.
🛠️ 제안
조건 2가 이미
DEFAULT_FEED_ID인 모든 경우를 처리하므로 조건 3을 제거하는 것을 권장합니다:when { editFeedModel == null -> createFeedViewModel.createFeed() editFeedModel.feedId == DEFAULT_FEED_ID -> createFeedViewModel.createFeed() - editFeedModel.feedCategory.isEmpty() -> createFeedViewModel.createFeed() else -> createFeedViewModel.editFeed( feedId = editFeedModel.feedId, ) }🤖 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/createFeed/CreateFeedActivity.kt` around lines 156 - 166, The third condition checking editFeedModel.feedCategory.isEmpty() can cause existing feeds to be re-created; update the when block to remove that standalone condition so decisions rely on editFeedModel null check and editFeedModel.feedId == DEFAULT_FEED_ID only, then call createFeedViewModel.createFeed() for null or DEFAULT_FEED_ID and createFeedViewModel.editFeed(...) otherwise; reference editFeedModel, DEFAULT_FEED_ID, createFeedViewModel.createFeed() and createFeedViewModel.editFeed() when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt`:
- Around line 68-71: The code calls focusView.clearFocus() and then uses
currentFocus?.windowToken when hiding the keyboard, which can be null; instead
use the captured focusView's windowToken directly. Update the
InputMethodManager.hideSoftInputFromWindow call to pass focusView.windowToken
(from the existing focusView variable) rather than currentFocus?.windowToken so
the token is non-null even after clearFocus(); keep the same InputMethodManager
retrieval logic around getSystemService and imm.hideSoftInputFromWindow.
---
Outside diff comments:
In `@app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt`:
- Around line 156-166: The third condition checking
editFeedModel.feedCategory.isEmpty() can cause existing feeds to be re-created;
update the when block to remove that standalone condition so decisions rely on
editFeedModel null check and editFeedModel.feedId == DEFAULT_FEED_ID only, then
call createFeedViewModel.createFeed() for null or DEFAULT_FEED_ID and
createFeedViewModel.editFeed(...) otherwise; reference editFeedModel,
DEFAULT_FEED_ID, createFeedViewModel.createFeed() and
createFeedViewModel.editFeed() when making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d4f7e6d0-480d-4ca7-8f70-94421bd28d13
📒 Files selected for processing (1)
app/src/main/java/com/into/websoso/ui/createFeed/CreateFeedActivity.kt
| focusView.clearFocus() | ||
| val imm: InputMethodManager = | ||
| getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager | ||
| imm.hideSoftInputFromWindow(currentFocus?.windowToken, 0) |
There was a problem hiding this comment.
clearFocus() 호출 후 currentFocus가 null이 될 수 있습니다.
Line 68에서 clearFocus()를 호출한 후, Line 71에서 currentFocus?.windowToken을 사용하고 있습니다. 포커스가 해제되면 currentFocus가 null을 반환할 수 있어, hideSoftInputFromWindow에 null이 전달될 수 있습니다.
이미 focusView를 캡처해두었으므로, 해당 뷰의 windowToken을 직접 사용하는 것이 안전합니다.
🛠️ 수정 제안
if (!outRect.contains(ev.rawX.toInt(), ev.rawY.toInt())) {
focusView.clearFocus()
val imm: InputMethodManager =
getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
- imm.hideSoftInputFromWindow(currentFocus?.windowToken, 0)
+ imm.hideSoftInputFromWindow(focusView.windowToken, 0)
}📝 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.
| focusView.clearFocus() | |
| val imm: InputMethodManager = | |
| getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager | |
| imm.hideSoftInputFromWindow(currentFocus?.windowToken, 0) | |
| focusView.clearFocus() | |
| val imm: InputMethodManager = | |
| getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager | |
| imm.hideSoftInputFromWindow(focusView.windowToken, 0) |
🤖 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/createFeed/CreateFeedActivity.kt`
around lines 68 - 71, The code calls focusView.clearFocus() and then uses
currentFocus?.windowToken when hiding the keyboard, which can be null; instead
use the captured focusView's windowToken directly. Update the
InputMethodManager.hideSoftInputFromWindow call to pass focusView.windowToken
(from the existing focusView variable) rather than currentFocus?.windowToken so
the token is non-null even after clearFocus(); keep the same InputMethodManager
retrieval logic around getSystemService and imm.hideSoftInputFromWindow.
📌𝘐𝘴𝘴𝘶𝘦𝘴
📎𝘞𝘰𝘳𝘬 𝘋𝘦𝘴𝘤𝘳𝘪𝘱𝘵𝘪𝘰𝘯
📷𝘚𝘤𝘳𝘦𝘦𝘯𝘴𝘩𝘰𝘵
💬𝘛𝘰 𝘙𝘦𝘷𝘪𝘦𝘸𝘦𝘳𝘴
둘다 dispatchTouchEvent 및 setupCustomScroll 에서 일어나는 문제들이어서 한꺼번에 수정했습니다.
터치 이벤트 시에만 dispatchTouchEvent를 실행하도록 하여 프레임 드랍을 감소하였습니다.
또한 드래그가 안되는 문제는 movementmethod가 scroll로 되있어 기본적인 드래그가 막혔던 문제로 파악했습니다.
Summary by CodeRabbit
릴리스 노트