Decimation / SmartImage

Reverse image search tool (SauceNao, IQDB, Ascii2D, trace.moe, and more)
GNU General Public License v3.0
567 stars 27 forks source link

[Bug Report] Some Menu Bugs Encountered #39

Closed SakiSakiSakiSakiSaki closed 1 year ago

SakiSakiSakiSakiSaki commented 1 year ago

Just documenting some bugs from Release 3.0.1 incase you weren't aware.

Decimation commented 1 year ago

Thanks for the report! I'll resolve these issues in the next release.

Decimation commented 1 year ago

I'm looking into the issues now. Can you reproduce these issues on the previous release? Also, what is your .NET version (you can find out by running dotnet --info). Could you also share your SmartImage configuration?

SakiSakiSakiSakiSaki commented 1 year ago

Hey friend, sorry for the late response.

I just downloaded version 3.0.0 for my re-testing (I assume this is the "previous release" you were talking about):

These two still occur in v3.0.0.

Not applicable in v3.0.0.

This still occurs in v3.0.0. Can't have any path in your clipboard prior to opening the .exe.

  • Sometimes after searching, the entire window will freeze/hang up, and suddenly close. I thought this might've had to do with the file being in the same directory as the program, but same thing occurs when it's the same file in it's own directory. https://user-images.githubusercontent.com/41088844/222614802-4d02295a-ae3d-4c23-b283-8c1b095b0c6e.mp4
  • This never seemed to happen when I would use the context menu; after a successful search, I just need to click "Delete" once, and the image would be deleted. However after this if I clicked "Clear" and/or "Restart" and drag and dropped a new image and ran that, the freezing issue would occur again.

This doesn't seem to occur in v3.0.0. But looking back at the v3.0.1 video I linked to this "freezing" issue, it occurred after I pressed "Delete". Testing v3.0.1 again, I couldn't consistently replicate this issue.


Also, what is your .NET version (you can find out by running dotnet --info)

.NET SDK (reflecting any global.json):
Version:   6.0.101
Commit:    ef49f6213a

Could you also share your SmartImage configuration?

I can't imagine these being of use since they're from fresh downloads due to the testing I just did.

Let me know if there's anything else you need from me!

Decimation commented 1 year ago

Also, what is your .NET version (you can find out by running dotnet --info)

.NET SDK (reflecting any global.json): Version: 6.0.101 Commit: ef49f6213a

SmartImage uses .NET 7. Can you update to .NET 7, then attempt to replicate the issues again?

Decimation commented 1 year ago

Engine configuration

The jankiness of selecting/toggling engine options has always been present AFAIK. This is due to constraints with how the GUI library (Terminal.Gui) and mapping a ListView to a flagged enum. I can rewrite the functionality which does this (it was in the backlog).

Auto-search

As you correctly identified, auto-search works when using SmartImage via the command-line and context menu, which is mostly what it was intended for. I have been trying to enable its use for the GUI (the main mode), but due to how Terminal.Gui works internally, any successful attempts I've made thus far are too hacky and issue-prone, and I don't want to release builds in such states. I'll also try to work on this as well.

Clipboard

In your video, you drag-and-drop another file into the input field before clearing the input field (use the [Clear] button to clear the input field, or [Restart] to clean everything up). This results in two inputs (files in this case) in the field:

2023-04-15_(04h25m33s)_On5r4imlCU

Dragging-and-dropping into text fields appends data, rather than clearing it (Terminal.Gui behavior I cannot change).

SmartImage should have safeguards in place to ensure the input field contains valid input, but you may have found an edge case I was unaware of. I will see if this is the case. Could you replicate this again, but clear the input field before dragging-and-dropping another file into the input field?

SakiSakiSakiSakiSaki commented 1 year ago

SmartImage uses .NET 7. Can you update to .NET 7, then attempt to replicate the issues again?

Sure, which version do you want me to retest?

SakiSakiSakiSakiSaki commented 1 year ago

In your video, you drag-and-drop another file into the input field before clearing the input field (use the [Clear] button to clear the input field, or [Restart] to clean everything up). This results in two inputs (files in this case) in the field:

So I just tried this in v3.0.0. Pressing [Clear] does clear the input field, but it doesn't populate itself with the new file being dragged in, it remains empty. Hitting [Run] does nothing in this state, it says Error: invalid input in cyan text. A workaround is to enter and exit [Config], and then drag the file in.

Decimation commented 1 year ago

In your video, you drag-and-drop another file into the input field before clearing the input field (use the [Clear] button to clear the input field, or [Restart] to clean everything up). This results in two inputs (files in this case) in the field:

So I just tried this in v3.0.0. Pressing [Clear] does clear the input field, but it doesn't populate itself with the new file being dragged in, it remains empty. Hitting [Run] does nothing in this state, it says Error: invalid input in cyan text. A workaround is to enter and exit [Config], and then drag the file in.

This is technically the correct behavior, although it is somewhat counterintuitive.

When you click a button, focus is changed to the button (like clicking in and out of windows). You just have to click the input field again (you can tell if it's focused by the cursor underscore _). This is also just how the UI library works (as is common in most UI designs).

However, I have added in a QOL change in the upcoming release which will automatically change focus back to the input field after [Clear] is clicked. Similarly, the reason your workaround works is because exiting the [Config] dialog automatically focuses the input field again.

Decimation commented 1 year ago

SmartImage uses .NET 7. Can you update to .NET 7, then attempt to replicate the issues again?

Sure, which version do you want me to retest?

If you would, try both 3.0.1 and 3.0.0 so I can isolate which problems appear in which version.

SakiSakiSakiSakiSaki commented 1 year ago

Apologies for the delayed response,

Results for v3.0.0 and v3.0.1 are below after updating to .NET 7:

Both occurs in v3.0.0. Both occurs in v3.0.1.

Not applicable in v3.0.0.. Occurs in v3.0.1.

Occurs in v3.0.0. Workaround works still. Your suggestion also works. Can't get clipboard to populate the input field in v3.0.1.

  • Sometimes after searching, the entire window will freeze/hang up, and suddenly close. I thought this might've had to do with the file being in the same directory as the program, but same thing occurs when it's the same file in it's own directory. https://user-images.githubusercontent.com/41088844/222614802-4d02295a-ae3d-4c23-b283-8c1b095b0c6e.mp4
  • This never seemed to happen when I would use the context menu; after a successful search, I just need to click "Delete" once, and the image would be deleted. However after this if I clicked "Clear" and/or "Restart" and drag and dropped a new image and ran that, the freezing issue would occur again.

I've deduced that this is a v3.0.1 issue, and largely seems to occur after successfully searching an image, and clicking "Delete". The entire window will freeze, and automatically close. Doesn't matter if I "Clear" or "Restart" before clicking "Delete" or not, the same freeze, close, happens.


I hope these results find you well!

Decimation commented 1 year ago

Please try the v3.0.2-pre prerelease.

Changes

Notes

SakiSakiSakiSakiSaki commented 1 year ago

Changes

  • Improves the engine selection UX

So I'm not sure if this addressed the buttons being selected/deselected en masse with pressing Enter, but that issue still exists in v.3.0.2

  • Fixes delete button crash

I can't test this out as SmartImage crashes after searching an image: https://user-images.githubusercontent.com/41088844/233818755-ac4d0689-bb0b-4fb5-b8b9-64b12dde1a66.mp4

The image in question: Background 26_waifu2x_art_noise3_scale_tta_1


Not sure if these issues are cause of my specific machine, or if it's just cause you haven't gotten around to them yet. Thanks for the update!

Decimation commented 1 year ago

Try the updated v3.0.2-pre build. I just made some changes/fixes:

I forgot to document that you had to check None to clear the selections, but I added a button to clear the engine selection. I apologize for the un-intuitive UX in that regard.

https://user-images.githubusercontent.com/4624891/233822278-1d419041-a3ee-4ef3-b78d-95942ee0b82b.mp4

I tried the image you used and it works in the latest build:

https://user-images.githubusercontent.com/4624891/233822365-28986505-6ab9-49e3-a6de-ca5d19d31537.mp4

Let me know!

SakiSakiSakiSakiSaki commented 1 year ago

I forgot to document that you had to check None to clear the selections

By None do you mean Clear?

I apologize for the un-intuitive UX in that regard.

No worries! I imagine trying to make a UI out of a terminal is going to be frustrating and hacky from the very start. Whatever you're unable to address can be chalked up to library limitations really.

Overall the menu selection is quite solid, with that pressing "Enter" after mass select bug being mostly or entirely gone. I assume you can't stomp it out for deselect, which is probably library limitations again. Not sure if you're aware of this, but selecting multiple engines, and hitting the Save button doesn't actually save them. You must press "Enter" to lock your choices in.

I tried the image you used and it works in the latest build:

So it does work for me as well, but it takes much longer for me than it does for you in your video. Almost 30 seconds after clicking "Run" does the process appear, and then open a window to the result. Wonder if it's cause my CPU was occupied?

Decimation commented 1 year ago

So it does work for me as well, but it takes much longer for me than it does for you in your video. Almost 30 seconds after clicking "Run" does the process appear, and then open a window to the result. Wonder if it's cause my CPU was occupied?

Can you record this issue? When you do so, make sure the entire shell UI is visible (with the status bar on the right).

VsDebugConsole_2023-04-28_(12h05m53s)_tR0bcpB4Qw

Also, is this latency a new issue with v3.0.2-pre?

SakiSakiSakiSakiSaki commented 1 year ago

v3.0.0 https://user-images.githubusercontent.com/41088844/235211882-3d2beaba-31cf-49c2-9dee-a09008dd8310.mp4

v3.0.1 https://user-images.githubusercontent.com/41088844/235212643-3fcc78a5-9596-4102-b9ae-8dd1f16ee4e0.mp4

v3.0.2 Ran this a few times: First attempt: https://user-images.githubusercontent.com/41088844/235212779-c989dd43-ce01-4473-99aa-d296b131a211.mp4 Second attempt: https://user-images.githubusercontent.com/41088844/235212921-7ebc0dcb-524b-4234-b18a-a43456fac3f0.mp4

I guess it's working fine now. Wonder what was up with last time.

Decimation commented 1 year ago

I guess it's working fine now. Wonder what was up with last time.

It was probably latency with the upload server. Are there any other problems or suggestions you have?

SakiSakiSakiSakiSaki commented 1 year ago

Are there any other problems or suggestions you have?

Covering our bases,

Other than that, everything else is functioning beautifully.

Decimation commented 1 year ago

In regards to the [Delete] crash, can you try the updated v3.0.2-pre build? I added temporary file logging to diagnose the problem. It should log to smartimage.log.

SakiSakiSakiSakiSaki commented 1 year ago

Doesn't seem to do anything this time, crash nor delete the file:

Decimation commented 1 year ago

Can you try the updated v3.0.2-pre build now? I believe I fixed the [Delete] problem, and I implemented Silent mode which toggles the taskbar flash and notification sound.

SakiSakiSakiSakiSaki commented 1 year ago

[Run] appears to be greyed out for me?

https://user-images.githubusercontent.com/41088844/235229141-f9a9a903-645c-48c3-aeda-d5e0ae0a43a0.mp4

Decimation commented 1 year ago

[Run] appears to be greyed out for me? 2023-04-28.14-48-06.mp4

Sorry, can you try the new build again? I fixed that as well.

SakiSakiSakiSakiSaki commented 1 year ago

Works now! Awesome!

Decimation commented 1 year ago

I'm closing this as it seems everything has been resolved. Feel free to reopen if there are any bugs you encounter. Could you also describe how you wanted the queue to be implemented in #40? Also, v3.0.2 has been released.

SakiSakiSakiSakiSaki commented 1 year ago

I'm closing this as it seems everything has been resolved. Feel free to reopen if there are any bugs you encounter. Could you also describe how you wanted the queue to be implemented in #40? Also, v3.0.2 has been released.

Hey thanks for that. Just wanted to know if managed to get Auto-search working in v3.0.2? It doesn't remain checked when I leave the Config menu.

Clipboard detection also seems to retoggle itself after you close the program. Not sure if that's intentional or not.

Decimation commented 1 year ago

Hey thanks for that. Just wanted to know if managed to get Auto-search working in v3.0.2? It doesn't remain checked when I leave the Config menu.

Clipboard detection also seems to retoggle itself after you close the program. Not sure if that's intentional or not.

I haven't changed Auto-search behavior yet, and Clipboard detection isn't part of the config file (yet).