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

fix: Make search keyboard shortcut work before search is opened #41

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

Conversation

MikeRatcliffe
Copy link

@MikeRatcliffe MikeRatcliffe commented Sep 18, 2024

Fixes #24

This is one pull request in a stack... they are all based on top of each other, so the order is important.

The advantage of this approach is that you are guaranteed no conflicts and reviews should be shorter.

Review each patch and merge before you move on to the next, this way, nothing will break and the code will be easier to review.

Start from #38 and work your way up the stack until you reach #51 (bottom to top).

This commit fixes a missing code issue in the `patchNow` function of the
App Tools modal. The issue was that the code was referencing a variable
called `package` which wasn't actually being passed in the argument
object.

This commit updates the code to use the correct variable name `pkg`,
which is now being passed in the argument object. This ensures that the
App Tools modal functions correctly and can access the correct
information about the application being managed.
This commit addresses an issue with sorting functionality in the
"browse" and "remote" views within the application.  The previous
implementation of the `sortBy` function contained a nested function,
which completely broke the sort functionality.

This change also simplifies the `sortBy` function by making the sorting
logic more straightforward and easier to understand. This improved
clarity and maintainability will benefit developers working on the
codebase.
Fixes VRPirates#34

Cleanly closes `adb` and `rclone` connections when the application
exits, ensuring resources are freed and preventing potential issues.
This addresses a previous oversight where these connections weren't
properly closed, potentially leading to resource leaks and unexpected
behavior.

Even though we free up the adb connection we don't close the server
because other programs may be using the connection.

The changes introduce a `destroy()` function in `tools.js` that handles
the cleanup. This function is called when the application receives the
"will-quit" event, ensuring that resources are freed before the
application terminates.

This change enhances the application's reliability and stability by
preventing resource leaks and ensuring a clean exit.
This commit addresses an issue where the keyboard shortcut (Ctrl+F or
Cmd+F) for opening the search dialog in the app was only functional
after the search dialog was already open. This change makes the keyboard
shortcut work regardless of the search dialog's current state.

The main change involves renaming the `openSearch()` function to
`toggleSearch()`, which now handles both opening and closing the search
dialog based on its current visibility. The logic for handling the
keyboard shortcut has been moved to the
`document.addEventListener("keydown", ...)` block, allowing for a more
robust and platform-independent solution.

Additionally, the `FindDialog` class has been modified to handle
toggling the search dialog's visibility dynamically, with a new
`display` parameter for the `toggle()` function. This provides more
control over the dialog's state and simplifies its usage.

This improvement provides a more intuitive and user-friendly experience
by ensuring that the search shortcut is always functional, regardless of
the current state of the search dialog.
@MikeRatcliffe MikeRatcliffe force-pushed the make-search-shortcut-work-before-search-opened branch from d57a27a to 836d011 Compare September 30, 2024 13:27
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.

Make search keyboard shortcut work before search is opened
1 participant