Skip to content

feat(ADFA-4922): Disable text actions during search - #1606

Open
dara-abijo-adfa wants to merge 3 commits into
stagefrom
ADFA-4922-disable-text-action-in-search
Open

feat(ADFA-4922): Disable text actions during search#1606
dara-abijo-adfa wants to merge 3 commits into
stagefrom
ADFA-4922-disable-text-action-in-search

Conversation

@dara-abijo-adfa

Copy link
Copy Markdown
Contributor

Disable text actions (Select, all, Copy, Help) when highlighting search matches. Implemented for file searches (Find in file) and log searches.

@dara-abijo-adfa dara-abijo-adfa self-assigned this Jul 31, 2026

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@dara-abijo-adfa, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 38f77978-8cc9-40ba-a6e8-017657ec3c5d

📥 Commits

Reviewing files that changed from the base of the PR and between cc0263f and 4bf5cd7.

📒 Files selected for processing (1)
  • editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt
📝 Walkthrough
  • Disables Select All, Copy, and Help while search matches are highlighted.
  • Tracks active searches in IDEEditorSearcher.
  • Dismisses the actions menu when search state or selection changes.
  • Risk: Search state must remain synchronized across all search start and close paths.

Walkthrough

The 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.

Changes

Search-aware actions menu suppression

Layer / File(s) Summary
Search state tracking
editor/.../IDEEditorSearcher.kt
search override sets isSearching for non-empty queries and clears it for empty queries before delegating to the superclass. onClose calls stopSearch() after clearing the state.
Actions menu suppression logic
editor/.../EditorActionsMenu.kt
Adds shouldSuppressActionsMenu() check. Selection changes dismiss the menu immediately during search and ignore held handles, using a shouldShow flow. postDisplay() and displayWindow() abort or dismiss when suppression applies.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • appdevforall/CodeOnTheGo#1605: Directly overlaps by modifying the same EditorActionsMenu.kt and IDEEditorSearcher.kt files to suppress editor text actions during search.

Suggested reviewers: itsaky-adfa

Poem

A rabbit hops through search and find,
The menu hides, it stays behind.
No pop-up now to steal the show,
While queries search both high and low.
🐇🔍 Quiet code, a tidy line!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the feature change: disabling text actions during editor search.
Description check ✅ Passed The description accurately explains disabling text actions for highlighted search matches in file and log searches.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-4922-disable-text-action-in-search

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Add regression coverage for search-state transitions.

Cover accepted searches, rejected input, stopSearch(), and onClose(). Assert both isSearching and hasQuery() 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 win

Keep isSearching consistent with an accepted search.

isSearching is set before super.search. If a delegated search rejects the pattern, this flag can stay set while hasQuery() is otherwise not updated. Set the flag only after super.search succeeds for non-empty inputs, and route empty input through stopSearch() or onClose() 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

📥 Commits

Reviewing files that changed from the base of the PR and between fdbf04b and cc0263f.

📒 Files selected for processing (2)
  • editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt
  • editor/src/main/java/io/github/rosemoe/sora/widget/IDEEditorSearcher.kt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant