Decimation / SmartImage

Reverse image search tool (SauceNao, IQDB, Ascii2D, trace.moe, and more)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug Report] Some Menu Bugs Encountered

SakiSakiSakiSakiSaki opened this issue · comments

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

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

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?

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.

  • v.3.0.0
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <appSettings>
        <add key="OnTop" value="True" />
        <add key="SearchEngines" value="ImgOps, GoogleImages, TinEye, Iqdb, TraceMoe, KarmaDecay, Yandex, Bing, Tidder, RepostSleuth" />
        <add key="PriorityEngines" value="Auto" />
    </appSettings>
</configuration>
  • v3.0.1
<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <appSettings>
        <add key="SearchEngines" value="All" />
        <add key="OnTop" value="True" />
        <add key="PriorityEngines" value="Auto" />
        <add key="OpenRaw" value="False" />
        <add key="EhUsername" />
        <add key="EhPassword" />
    </appSettings>
</configuration>

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

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?

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?

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?

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.

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.

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.

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!

Please try the v3.0.2-pre prerelease.

Changes

  • Improves the engine selection UX
  • Fixes delete button crash
  • UI/UX improvements
  • Ascii2D seems to be working again (not related to any changes I made; Ascii2D must have made server-sided changes which allows SmartImage to use it again)

Notes

  • Auto-search is still not yet fully operational. I am still working on it.
  • The [Queue] button and its functionality are not yet implemented -- it is just a placeholder for now
  • Other internal changes not yet documented

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!

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.

SmartImage_2023-04-23_.00h53m51s._dzrLUc4NmT.mp4

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

explorer_2023-04-23_.00h55m43s._fwbzPWCjke.mp4

Let me know!

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?

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?

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?

Are there any other problems or suggestions you have?

Covering our bases,

  • Having focus set onto the input field again after pressing [Clear] was something you had planned.
  • Queue is something you're working on as well.
  • I mentioned above that [Delete] would crash the window. Here's another video of that happening:
  • Auto-search not being togglable has also been mentioned above.
  • I mentioned elsewhere, but a toggle to enable/disable the sound effect after a successful search would be great. A single instance is fine, but once you implement the Queue, it would occur once every few seconds.

Other than that, everything else is functioning beautifully.

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.

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.

[Run] appears to be greyed out for me?

2023-04-28.14-48-06.mp4

[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.

Works now! Awesome!

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.

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.

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).