feat(ADFA-4922): Disable text actions during search - #1606
feat(ADFA-4922): Disable text actions during search#1606dara-abijo-adfa wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 Walkthrough
WalkthroughThe editor actions menu now suppresses its display when a search is active or a search query is present. IDEEditorSearcher tracks search state through an overridden search method and updates state on close. EditorActionsMenu checks this state at selection change, postDisplay, and displayWindow to dismiss or skip the menu. ChangesSearch-aware actions menu suppression
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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.
Actionable comments posted: 1
🧹 Nitpick comments (2)
editor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt (2)
48-59: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for search-state transitions.
Cover accepted searches, rejected input,
stopSearch(), andonClose(). Assert bothisSearchingandhasQuery()after each transition. The actions menu reads both values.As per coding guidelines, use unit tests for non-UI logic, cover error and edge paths, and target at least 50% line and branch coverage for changed non-UI code.
Also applies to: 90-90
🤖 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 `@editor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt` around lines 48 - 59, Update tests for IDEEditorSearcher.search and its related stopSearch() and onClose() transitions to cover accepted non-empty queries and rejected empty input. After each transition, assert both isSearching and hasQuery(), including the stopSearch() and onClose() states, so the actions-menu state contract and error/edge paths are covered.Source: Coding guidelines
48-59: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winKeep
isSearchingconsistent with an accepted search.
isSearchingis set beforesuper.search. If a delegated search rejects the pattern, this flag can stay set whilehasQuery()is otherwise not updated. Set the flag only aftersuper.searchsucceeds for non-empty inputs, and route empty input throughstopSearch()oronClose()as needed.🤖 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 `@editor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt` around lines 48 - 59, Update IDEEditorSearcher.search so super.search(query, searchOptions) runs before marking a non-empty query as searching, ensuring isSearching changes only when the delegated search succeeds. For empty queries, use the existing stopSearch() or onClose() flow instead of directly assigning isSearching, and preserve the accepted-search state consistently with hasQuery().Source: Learnings
🤖 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.
Inline comments:
In `@editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt`:
- Around line 160-166: Update onSelectionChanged so shouldSuppressActionsMenu()
is evaluated before touchHandler.hasAnyHeldHandle(). Dismiss and return whenever
suppression is active, then retain the existing early return for held handles
when suppression is inactive.
---
Nitpick comments:
In `@editor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt`:
- Around line 48-59: Update tests for IDEEditorSearcher.search and its related
stopSearch() and onClose() transitions to cover accepted non-empty queries and
rejected empty input. After each transition, assert both isSearching and
hasQuery(), including the stopSearch() and onClose() states, so the actions-menu
state contract and error/edge paths are covered.
- Around line 48-59: Update IDEEditorSearcher.search so super.search(query,
searchOptions) runs before marking a non-empty query as searching, ensuring
isSearching changes only when the delegated search succeeds. For empty queries,
use the existing stopSearch() or onClose() flow instead of directly assigning
isSearching, and preserve the accepted-search state consistently with
hasQuery().
🪄 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 Plus
Run ID: 73f22462-30b2-4629-8094-0a4a34ac11bd
📒 Files selected for processing (2)
editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kteditor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt
Disable text actions (Select, all, Copy, Help) when highlighting search matches. Implemented for file searches (Find in file) and log searches.