Fix side panel closing issue when clicking inside the panel content area#1016
Conversation
|
Worried about impact? Review this PR in Change Stack to explore blast radius before you approve or request changes. WalkthroughThis PR fixes an issue where the Web Import side panel in the IntelliJ plugin would close when clicking inside the panel's content area. The fix adds pointer input event handling to the side panel's Compose modifier chain, specifically by appending a 🚥 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 docstrings
🧪 Generate unit tests (beta)
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.
🧹 Nitpick comments (1)
tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/SidePanel.kt (1)
60-61: ⚡ Quick winReplace empty
pointerInput(Unit) {}with an explicit tap/consume handlerIn
tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/SidePanel.kt(around line 61), the interception relies on a no-op handler:.background(JewelTheme.overlay) .pointerInput(Unit) {},A repo-wide search shows this is the only occurrence of an empty
pointerInput(Unit) {}pattern, so the intent is hard to reason about; usedetectTapGestures(onTap = {})(or another explicit consume/intercept approach) instead to make the behavior self-documenting.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/SidePanel.kt` around lines 60 - 61, Replace the no-op pointerInput(Unit) {} in the SidePanel modifier chain with an explicit tap-consume handler so the interception intent is clear: change the Modifier that currently ends with .background(JewelTheme.overlay).pointerInput(Unit) {} to use pointerInput with detectTapGestures(onTap = {}) (or an equivalent explicit consume gesture detector) to consume taps; import androidx.compose.foundation.gestures.detectTapGestures and call detectTapGestures inside the pointerInput scope to make the behavior self-documenting (refer to the pointerInput(Unit) {} occurrence in SidePanel.kt and the surrounding Modifier chain).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/SidePanel.kt`:
- Around line 60-61: Replace the no-op pointerInput(Unit) {} in the SidePanel
modifier chain with an explicit tap-consume handler so the interception intent
is clear: change the Modifier that currently ends with
.background(JewelTheme.overlay).pointerInput(Unit) {} to use pointerInput with
detectTapGestures(onTap = {}) (or an equivalent explicit consume gesture
detector) to consume taps; import
androidx.compose.foundation.gestures.detectTapGestures and call
detectTapGestures inside the pointerInput scope to make the behavior
self-documenting (refer to the pointerInput(Unit) {} occurrence in SidePanel.kt
and the surrounding Modifier chain).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ee95bec7-b012-4ee9-9359-f67a7f46755f
📒 Files selected for processing (2)
tools/idea-plugin/CHANGELOG.mdtools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/ui/screen/webimport/common/ui/SidePanel.kt
📝 Changelog
If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs: