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

Feature/update grouped images #106

Merged
merged 3 commits into from
Oct 5, 2023
Merged

Conversation

capetillo
Copy link
Contributor

FEATURE FIX UPDATE: Added exposure fields under Projects tab with conditional adjustments

DESCRIPTION

Background:
After successfully having grouped images and only displaying the latest one from each smart stack (if it was a part of a smart stack), a new issue arose. @wrosing noticed that when he was taking smart stack photos, the first one would come in just fine. But if he selected the new image of the smart stack and it was (e.g.) 1 of 10 and then it updated to 2 of 10, the yellow border that surrounds the selected image thumbnail would disappear and some other erratic behavior would occur.

In the ThumbnailRow component, we assign the class of selected_thumbnail if item.image_id is equal to selected_image. This class creates the yellow border. However, because the new updated image's image_id from the smart stack was not the same value as selected_image, the class was no longer assigned and therefore, the surrounding yellow border would disappear.

Implementation:

In images.js under the update_new_image action, we are now reassigning the value of current_image to new_image. This happens only if certain conditions are met:

  1. If current_image has a SMARTSTK that's not equal to 'no'. AND
  2. If new_image has a SMARTSTK and is equal to current_image's SMARTSTK

Features Fixes :

After having implemented changes to the ThumbnailRow component so that images could be grouped (details here), the new issue of the selected thumbnail not having a yellow border if it was a new image and a part of a smart stack arose. Reassigning the value of new_image to current_image should fix this feature and it should all behave as expected.

Important Note:
This has not been 100% tested because I cannot take smart stack photos unless it's nighttime. I will wait for @wrosing's feedback, but I believe this should fix all issues related to updating images.

VISUALS

No visuals yet, but will add them tonight if I'm able to test with smart stack :-)

@capetillo capetillo requested a review from markBowman October 5, 2023 22:55
Copy link

@markBowman markBowman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds reasonable :-) Sorry, I have nothing more insightful to say, other than congratulations on another fine PR description.

@capetillo capetillo merged commit 240233e into dev Oct 5, 2023
1 check passed
const current_image_SMARTSTK = current_image.header && current_image.header.SMARTSTK
const new_image_SMARTSTK = new_image.header && new_image.header.SMARTSTK
if (current_image_SMARTSTK && current_image_SMARTSTK !== 'no' && current_image_SMARTSTK === new_image_SMARTSTK) {
current_image = new_image
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modifying state in vuex needs to happen by calling a mutation, so direct modifications like line 207 won't work like we want. However, replacing it with commit('setCurrentImage', new_image) should do the trick!

(I was trying out these changes with the send_test_image script I mentioned that uploads simulated smart stacks to the tst site. As far as I can tell, everything should work after making this change).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update--decided to push this fix directly since it's such a minor change and might make observing easier for Wayne over this weekend. Verified it works with the send_test_image script as well as live observations at aro1, so likely no further action needed.

@wrosing
Copy link

wrosing commented Oct 7, 2023 via email

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.

4 participants