-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 UI not updating when thumbtable image is rejected #16486
base: master
Are you sure you want to change the base?
Conversation
Fixes the following bug: Steps to reproduce: - Enter darkroom view - Scale bottom panel UI small enough that rating overlay does not display on thumbnail mouseover - Hover over an image, and press R. - Observe that the image does not appear to be rejected until we enter another view where the rating overlay is displayed. Previously, _image_get_infos short-circuited when a thumbnail did not have an overlay. When using keyboard shortcuts, there are situations where we still need to call _image_get_infos to appropriately update the UI.
What do you mean by this? A screenshot would help I suppose. TIA. |
@TurboGit - Here is a video where I demonstrate the bug. This video shows four tests:
|
I see, I could reproduce and thinks that the PR is ok. I'll let @AlicVB validate this part. TIA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR.
You've spotted the code problem, but I think we should be able to get a change with less impact on perfs (even if current proposal is not horrible)
Ping me if you need help !
Now, we only check for rejection, then short-circuit if overlay is DT_THUMBNAIL_OVERLAYS_NONE. Then, continue gathering all other info if overlay is something else.
Hi @AlicVB , let me know if you think the newest commit addresses your concerns. The new logic is:
Thanks in advance! |
@AlicVB : We are approaching the release, can you do a quick review and let me know if we can merge this in 4.8 or postpone for 5.0? TIA. |
@AlicVB : When you have some free cycle for a review :) TIA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, I'm really sorry for the extra long delay. I've completely forgotten that PR...
Your proposal is far better, but I have a more "global" interrogation here
thumb->rating = img->flags & DT_IMAGE_REJECTED | ||
? DT_VIEW_REJECT | ||
: (img->flags & DT_VIEW_RATINGS_MASK); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason to close the if(img)
condition here (and reopen it after) ?
I think it would even break the dt_image_cache_release
just after (in case of OVERLAYS_NONE
)
In fact I even think that current code in master is not fully right : in the case we fail to get the image cache, it actually "reset" the thumb->rating
to 0. I would have said that in this case, we have to let everything untouched...
So for our case that would means :
- removing the
thumb->rating = 0
line - let all your change inside the
if(img)
condition - add another check after that condition to exit if no overlay
What would you think of suvh a change ? @TurboGit : I would also like your opinion as I fail to trigger a case where we don't get the image cache...
Thanks !
This needs to be properly tested to ensure there is no side effects. We maybe depends on the rating being 0 to report that an image is not found for example.
Right, seems better indeed.
Ok with that too. |
Fixes the following bug:
Steps to reproduce:
- Enter darkroom view
- Scale bottom panel UI small enough that rating overlay does not display on
thumbnail mouseover
- Hover over an image, and press R.
- Observe that the image does not appear to be rejected until we
enter another view where the rating overlay is displayed.
Previously, _image_get_infos short-circuited when a thumbnail did not have an overlay. When using keyboard shortcuts, there are situations where we still need to call _image_get_infos to appropriately update the UI.