Fix compose preview button bug on non compose classes#1236
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 9 minutes and 19 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR modifies the Compose preview action's preparation logic to perform content-aware detection. Instead of workspace-wide Compose dependency checks, it now requires both the module's Compose dependency and the presence of at least one Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
Actionable comments posted: 2
🤖 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/itsaky/androidide/actions/etc/PreviewLayoutAction.kt`:
- Around line 66-69: The current COMPOSABLE_PREVIEW_PATTERN fails to match
annotated preview functions that include Kotlin modifiers (e.g., "private",
"internal", "protected", "public") between annotations and the "fun" keyword;
update COMPOSABLE_PREVIEW_PATTERN to permit optional modifier tokens before
"fun" (for example allow zero or more word tokens like visibility and common
modifiers such as private|internal|protected|public|open|override|suspend etc.
followed by whitespace) so patterns like "@Preview `@Composable` private fun
FooPreview()" are matched; adjust the Regex used by moduleUsesCompose(file:
File, editorContent: String) to use the revised COMPOSABLE_PREVIEW_PATTERN
(keeping existing RegexOption flags) so preview detection works for functions
with modifiers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 67b4833a-d7ab-44fe-bee0-e3637b351823
📒 Files selected for processing (1)
app/src/main/java/com/itsaky/androidide/actions/etc/PreviewLayoutAction.kt
No description provided.