Skip to content

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

Merged
dara-abijo-adfa merged 5 commits into
stagefrom
ADFA-4922-disable-text-action-in-search
Aug 3, 2026
Merged

feat(ADFA-4922): Disable text actions during search#1606
dara-abijo-adfa merged 5 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cfcc8bcc-b694-43fc-aaf3-5512984d0309

📥 Commits

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

📒 Files selected for processing (1)
  • editor/src/main/java/com/itsaky/androidide/editor/ui/EditorActionsMenu.kt
🚧 Files skipped from review as they are similar to previous changes (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 search and updates state on close. EditorActionsMenu checks this state during selection changes, postDisplay(), and displayWindow().

Changes

Search-aware actions menu suppression

Layer / File(s) Summary
Search state tracking
editor/.../IDEEditorSearcher.kt
search sets isSearching for non-empty queries and clears it for empty queries before delegating. onClose calls stopSearch() after clearing the state.
Actions menu suppression logic
editor/.../EditorActionsMenu.kt
Selection changes dismiss the menu during search. postDisplay() and displayWindow() skip or dismiss the menu when suppression applies.

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

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant IDEEditorSearcher
  participant EditorActionsMenu

  User->>IDEEditorSearcher: Start or update search
  IDEEditorSearcher->>IDEEditorSearcher: Set search state
  EditorActionsMenu->>IDEEditorSearcher: Check search state
  IDEEditorSearcher-->>EditorActionsMenu: Return suppression state
  EditorActionsMenu->>EditorActionsMenu: Dismiss or skip display
  User->>IDEEditorSearcher: Close search
  IDEEditorSearcher->>IDEEditorSearcher: Clear state and stop search
Loading

Possibly related PRs

Suggested reviewers: jomen-adfa, itsaky-adfa

Poem

A rabbit searches through the code,
The action menu leaves the road.
Queries set the search state bright,
Closing search restores the light.
🐇🔍 Neat and quiet, just right.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: disabling text actions during editor search.
Description check ✅ Passed The description directly explains which text actions are disabled and where the change applies.
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

@dara-abijo-adfa
dara-abijo-adfa merged commit 5305e52 into stage Aug 3, 2026
4 checks passed
@dara-abijo-adfa
dara-abijo-adfa deleted the ADFA-4922-disable-text-action-in-search branch August 3, 2026 17:46
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.

2 participants