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

[Bug] Search panel covers findings #1676

Closed
1 task
mehlian opened this issue May 15, 2024 · 6 comments
Closed
1 task

[Bug] Search panel covers findings #1676

mehlian opened this issue May 15, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@mehlian
Copy link

mehlian commented May 15, 2024

Operating System

Windows

What's the issue you encountered?

When searching using ctrl+f new panel shows up. This panel covers found patterns.
image

Also there is no way to scroll 'Hex editor' view when search panel is visible.

How can the issue be reproduced?

  1. open any file.
  2. search for Hex pattern that is located where search panel will show up (top left corner of 'Hex editor' view).
  3. pattern is found but its covered by search panel
  4. there is no way to scroll 'Hex editor' view to uncover found pattern or move 'search panel'

ImHex Version

1.33.X@8802a8e

ImHex Build Type

  • Nightly or built from sources

Installation type

Portable

Additional context?

Maybe change 'search panel' to bar at top/bottom like 'Page/Region' bar at bottom?
Allow to scroll 'Hex editor' view when 'search panel' is visible (for both small and big files).

@mehlian mehlian added the bug Something isn't working label May 15, 2024
@paxcut
Copy link
Contributor

paxcut commented May 15, 2024

this was fixed two or three days ago. now the popup can be moved and it also becomes transparent when not hovering. the amount of transparency can be adjusted in the theme editor. Note that the problem was that the window was already scrolled all the way to the top, so you couldn't scroll down any further to make the content visible because when the search popup is open the mouse wheel scrolls the window up and down.

Please obtain the latest nightly build that already incorporates said changes so you can verify this is no longer a problem for you.

image

@mehlian
Copy link
Author

mehlian commented May 15, 2024

I'll wait for next release since nightly build (available from readme page button) is in msi format and I want portable.

Note that the problem was that the window was already scrolled all the way to the top, so you couldn't scroll down any further to make the content visible because when the search popup is open the mouse wheel scrolls the window up and down.

I don't understand this statement. It is true that for small binaries where there is no scroll bar there is no way to scroll view, but I can't scroll even when pattern was found in the middle of big file and search panel was still visible (search panel was in focus but mouse was over Hex editor to scroll Hex editor view).

I would prefer search panel as bar at the bottom than moving search panel left and right to see what was found and where.

Search panel in version 1.33.X@8802a8e can have more issues like you cannot resize ImHex window while search panel is visible.

@paxcut
Copy link
Contributor

paxcut commented May 15, 2024

Head on over to this page and at the very bottom you'll find portable nightly builds.

but I can't scroll even when pattern was found in the middle of big file and search panel was still visible (search panel was in focus but mouse was over Hex editor to scroll Hex editor view).

The search window in the hex editor is implemented as an ImGui Modal window that needs focus while is open and closes once focus is lost, so it is impossible to resize other windows or anything that requires focus. Scrolling the hex editor view does not require focus to the hex editor itself. As long as the search panel has the focus it needs to stay open, the mouse scroll wheel will scroll the hex editor window up and down. It is easy to test, open the search window and move the mouse wheel up and down.

I would prefer search panel as bar at the bottom than moving search panel left and right to see what was found and where.

Please download a portable nightly build from the web page listed above to test the new functionality and comment on it if there are further issues.

Search panel in version 1.33.X@8802a8e can have more issues like you cannot resize ImHex window while search panel is visible.

As explained earlier that's an implementation limitation that cannot be helped. Unlike the pattern editor search window that can make room to avoid hiding any content, like visual studio code does, the hex editor widow has no room to allow placing the search panel in a fixed position that is guaranteed not to hide some content which is why it was decided to allow moving it and giving it transparency so that no data is permanently hidden under it.

@mehlian
Copy link
Author

mehlian commented May 15, 2024

Downloaded nightly build and here are results:

  • scroll 'Hex editor' view while 'search panel' is visible - fixed
  • resize ImHex window while 'search panel' is visible - fixed

I have found new issue with 'search panel' logic. I'll open new issue. This can be closed on next release.

@mehlian
Copy link
Author

mehlian commented May 15, 2024

Unlike the pattern editor search window that can make room to avoid hiding any content, like visual studio code does, the hex editor widow has no room to allow placing the search panel in a fixed position that is guaranteed not to hide some content which is why it was decided to allow moving it and giving it transparency so that no data is permanently hidden under it.

In visual studio code when we use ctrl+f to show search panel in code window, extra padding/margin is added at top to allow scrolling code down and look at code covered by search panel.

It may be 'ugly' behavior for 'hex editor' view.

That's why search bar at the bottom would be better - content of 'hex editor' view would not move, just new search bar would appear at bottom covering bottom portion of 'hex editor'. Scrollbar would move up (above search bar) and you could scroll down to uncover this area.

Similarly how ctrl+f works in Firefox browser.

@paxcut
Copy link
Contributor

paxcut commented May 15, 2024

  • scroll 'Hex editor' view while 'search panel' is visible - fixed
  • resize ImHex window while 'search panel' is visible - fixed

Glad to hear it and you don't need to wait for release to close the issue if you don't want to.

In visual studio code when we use ctrl+f to show search panel in code window, extra padding/margin is added at top to allow scrolling code down and look at code covered by search panel.
It may be 'ugly' behavior for 'hex editor' view.

Yes, I mentioned that because I coded the Pattern editor search window to behave like vs code and ensuring that the text doesn't jump up or down when you hit ctrl-f wasn't easy (in fact there are cases when closing the search panel where the text has to jump as vs code shows). The search panel for the text editor is designed wide and span only two or three (with replace) lines of code so the extra padding needed is minimal and the end of scroll cases, where the main problem lies really, can be handled gracefully.

That kind of behavior is just not possible with the hex editor window because in general there is no region of the layout that's not covering some portion of the ui and the window spans too many lines to trick the eye into thinking that nothing has changed unless you are paying close attention. Think NotePad++ search window which has a similar issue and look at how it is handled there. It may not look it, but there is a great deal of planning and study of other app uis that goes into the design choices being made. You can't ignore some needs to justify some choice without some sound logic to back it up.

That's why search bar at the bottom would be better - content of 'hex editor' view would not move, just new search bar would appear at bottom covering bottom portion of 'hex editor'. Scrollbar would move up (above search bar) and you could scroll down to uncover this area.

Similarly how ctrl+f works in Firefox browser

As an example, since you mentioned it, turning things into a firefox-like search is not an option for Imhex because the hex editor search window is no longer a simple text search window and must allow for the search of binary values and other things that turns that into an unfeasible choice.
There are lengthy discussions on Imhex discord about this and other ui considerations and everyone is welcome to participate and express their opinion but the final choices can only be made by the main developers. That's a tall order since the very popularity of the app depends on how well tuned the choices are to the community need and I know of few open source projects that are more responsive to the community than Imhex is. But I am digressing so I'll stop here.

@mehlian mehlian closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants