Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Context Menu for Search Results (Right-Click Feature) #1183

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Harmanpawar15
Copy link

📝 Summary

This PR adds a right-click context menu to search results using UIContextMenu. Users can now:

  • Right-click on a search result to see a menu.
  • Choose "Open File" to open the file (same as left-click).
  • Choose "Open Containing Folder" to navigate to the file’s location in File Explorer.

✅ Changes

  • Integrated UIContextMenu for search results.
  • Preserved existing left-click behavior.
  • Used UIWindow to open the containing folder.

🔍 How to Test

  1. Search for a file.
  2. Right-click on a result → A context menu should appear.
  3. Click "Open File" → The file should open.
  4. Click "Open Containing Folder" → File Explorer should open at the file’s location.

📌 Notes

  • No existing functionality was altered.
  • This aligns with the contributing guidelines and maintains UI consistency.

@KernelDeimos
Copy link
Contributor

Manually tested - looks good. Concerning the UX, I had two thoughts that are in conflict:

  • It's convenient that the search window doesn't close when you open something, because you might want to open another result as well
  • The fact that it doesn't close looks kind of like a bug because of the nature of this type of dialog (dialogs with an overlay typically disappear when you take an action)

This a solution I think will keep the convenience of the window not closing and make it seem more natural: if you click an item normally the search window goes away like it usually does, if you right-click an item and open it that way the dialog turns into a regular window. (i.e. no overlay, so it won't go away if you click outside of it; has a titlebar shown so there's an X button). Let me know if this makes sense or if you have any questions. I'm also going to tag @jelveh in case he wants to weigh in.

I recorded a manual test (1.6x speed)

pr-1183_1.6x.mp4

@KernelDeimos
Copy link
Contributor

Also I think the use of emojis in comments is something we should do more often. I makes separate sections of the code quicker to identify (really important because I think a developer's brain has to perform that task unconsciously a lot more frequently than we think about) and it's super on-point with Puter's brand/personality. (+ everything should support UTF-8 nowadays)

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