Skip to content

Conversation

Copy link

Copilot AI commented Aug 24, 2025

This PR implements the QuickSearch feature that was outlined in the TODO comment in MenuBar.kt. The feature provides a powerful search interface that opens on double shift press, allowing users to quickly find and interact with modules, settings, and commands using fuzzy matching.

Key Features

Double Shift Activation

  • Detects double shift key press within a 500ms window
  • Works with both left and right shift keys
  • Automatically opens the search popup when triggered

Comprehensive Search

The search covers three main categories:

Modules: Search by name with intelligent fuzzy matching using Levenshtein distance

// Example: typing "gui" finds "ClickGUI", "auto" finds "AutoWalk", etc.
// Shows current status (Enabled/Disabled) and allows one-click toggling

Commands: Search by name and aliases with command prefix display

// Example: typing "mod" finds "module" command
// Shows usage information and command prefix

Settings: Search across all configuration settings by name or parent module

// Example: typing "speed" finds "walkSpeed", "speedSettings", etc.
// Shows full path (module.setting) and current values

User Experience Enhancements

  • Real-time search: Results update as you type
  • Keyboard navigation: Enter to select first result, Escape to close
  • Visual indicators: Type badges ([Module], [Command], [Setting]) for easy identification
  • Rich tooltips: Detailed descriptions and context information
  • Smart filtering: Limited to 50 results with intelligent prioritization
  • Helpful guidance: Examples and tips shown in empty state

Technical Implementation

  • Built using existing ImGui infrastructure and styling patterns
  • Leverages the existing StringUtils.findSimilarStrings() Levenshtein distance implementation
  • Integrates with the reflection-based Loadable system for automatic initialization
  • Uses event-driven architecture with KeyboardEvent.Press handling
  • Clean separation of concerns between UI rendering, input handling, and search logic

Integration Points

  • Added to Help menu with "Shift+Shift" shortcut hint
  • Integrated into main GUI rendering loop via ClickGuiLayout
  • Removed the original TODO comment and unused quickSearch variable from MenuBar.kt

Files Added/Modified

  • QuickSearch.kt - Main search component with popup modal interface
  • QuickSearchInputHandler.kt - Double shift detection and keyboard event handling
  • ClickGuiLayout.kt - Integration with main GUI rendering
  • MenuBar.kt - Added functional menu item and cleaned up TODO

This implementation provides exactly what was requested in the original TODO comment: a search interface for modules, commands, and settings using Levenshtein distance matching, accessible via a convenient keyboard shortcut.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • jitpack.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -Xmx4096M -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.14.1-bin/baw1sv0jfoi8rxs14qo3h49cs/gradle-8.14.1/lib/gradle-daemon-main-8.14.1.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.14.1-bin/baw1sv0jfoi8rxs14qo3h49cs/gradle-8.14.1/lib/agents/gradle-instrumentation-agent-8.14.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.14.1 (dns block)
  • maven.fabricmc.net

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits August 24, 2025 01:20
Co-authored-by: Avanatiker <8580605+Avanatiker@users.noreply.github.com>
Co-authored-by: Avanatiker <8580605+Avanatiker@users.noreply.github.com>
Co-authored-by: Avanatiker <8580605+Avanatiker@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement the quicksearch bar. it shall open a popup on double shift with a text input. you can search modules, settings, commands etc. more details in the MenuBar.kt file Implement QuickSearch bar with double shift activation for modules, settings, and commands Aug 24, 2025
Copilot AI requested a review from Avanatiker August 24, 2025 01:25
@Avanatiker Avanatiker closed this Aug 24, 2025
@Avanatiker Avanatiker deleted the copilot/fix-d82ce026-adb3-4bca-a282-19ea8f34f8be branch August 24, 2025 06:55
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