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

feat: display photos in observations #344

Merged
merged 9 commits into from
May 20, 2024

Conversation

CDFN
Copy link
Collaborator

@CDFN CDFN commented May 14, 2024

Part of #229

@CDFN CDFN requested a review from ErikSin May 14, 2024 11:08
@CDFN CDFN self-assigned this May 14, 2024
@CDFN CDFN added enhancement New feature or request swmansion labels May 14, 2024
@ErikSin ErikSin requested a review from EvanHahn May 14, 2024 18:16
Copy link
Contributor

@EvanHahn EvanHahn left a comment

Choose a reason for hiding this comment

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

I think this is a good change but three additional things are needed:

  1. This doesn't completely address Show photos in observation #229 because tapping a photo doesn't open a modal. See the screen recording in the issue for a reference. (I assume you'll need to fill in handlePhotoPress in ThumbnailScrollView.tsx to accomplish this.)
  2. ThumbnailScrollView bug: when photos take a long time to load,
  3. ThumbnailScrollView bug: when photos take a long time to load, there is no UI for this. A grayed-out square, or some other placeholder, should be shown.

All of these can be done in a followup PR.

src/frontend/screens/Observation/index.tsx Outdated Show resolved Hide resolved
src/frontend/screens/Observation/index.tsx Outdated Show resolved Hide resolved
src/frontend/screens/Observation/index.tsx Outdated Show resolved Hide resolved
src/frontend/screens/Observation/index.tsx Outdated Show resolved Hide resolved
@CDFN
Copy link
Collaborator Author

CDFN commented May 14, 2024

Thanks for quick review, Evan 😃 You're right, this PR doesn't implement opening modal when you click a photo. I should have noted we're going to do this in another PR which also implements delete button in spoken modal. I'll address 3) (and 2) perhaps as I guess it's just typo) probably tomorrow morning for us.

Also, is it okay for us to include modal changes along with observation editing (#65) or you'd like to see that in completely separate PR?

@bohdanprog bohdanprog requested a review from EvanHahn May 15, 2024 07:04
Copy link
Contributor

@EvanHahn EvanHahn left a comment

Choose a reason for hiding this comment

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

  1. perhaps as I guess it's just typo

Whoops, sorry for the typo.

When photos take a long time to load, ThumbnailScrollView will jump around unexpectedly. I reproduced this by adding 10 photos to an observation.

Again, this can probably be fixed in a followup PR.

Also, is it okay for us to include modal changes along with observation editing (#65) or you'd like to see that in completely separate PR?

I'd prefer a separate, smaller PR. Does that work for you?

src/frontend/screens/Observation/index.tsx Show resolved Hide resolved
@@ -58,10 +64,9 @@ export const Thumbnail = ({photo, style, size, onPress}: ThumbnailProps) => {
);
};

export const ThumbnailScrollView = () => {
export const ThumbnailScrollView = (props: {photos: (Photo | undefined)[]}) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

It feels a little weird that we'd allow an array with undefined in it. What's the use case for that?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's so we can keep placeholders for still loading images

Comment on lines 37 to 39
const isCapturing =
(photo && 'capturing' in photo && (photo.capturing as boolean)) ||
undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: I would expect isCapturing to be a boolean, not undefined | boolean. Can you make sure it's always a bool?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah good point 👍


const spacing = 10;
const minSize = 150;
const log = debug('Thumbnail');

type ThumbnailProps = {
photo: Photo;
photo?: Photo;
Copy link
Contributor

Choose a reason for hiding this comment

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

When would this happen?

@CDFN
Copy link
Collaborator Author

CDFN commented May 16, 2024

This PR will most likely need to be put on hold until #335 is approved as points made there are also applicable for this PR.

@EvanHahn
Copy link
Contributor

EvanHahn commented May 16, 2024 via email

@CDFN CDFN requested a review from EvanHahn May 20, 2024 13:34
@CDFN CDFN merged commit 719c2b4 into feat/observation-sharing May 20, 2024
3 checks passed
@CDFN CDFN deleted the feat/display-photos-in-observations branch May 20, 2024 19:21
@bohdanprog bohdanprog restored the feat/display-photos-in-observations branch May 24, 2024 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request swmansion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants