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

Cleanup of useDraftObservation() hook #860

Open
gmaclennan opened this issue Nov 25, 2024 · 1 comment
Open

Cleanup of useDraftObservation() hook #860

gmaclennan opened this issue Nov 25, 2024 · 1 comment

Comments

@gmaclennan
Copy link
Member

Managing draft observations is a critical part of the app, and a part that is really important to get right. Currently the logic for managing a draft observation is split between two hooks useDraftObservation and usePersistedDraftObservation. Some properties from one hook are the same as the other, and some are different. We also return a hook from a hook, which is confusing.

Cleaning up and simplifying this code should make it easier to maintain this part of the app and to write unit tests for the important logic around updating presets and saving photos and audio.

@gmaclennan gmaclennan converted this from a draft issue Nov 25, 2024
@achou11 achou11 moved this from Backlog to In Progress in CoMapeo Refactor Dec 4, 2024
@achou11
Copy link
Member

achou11 commented Dec 5, 2024

what's been done:

  • gregor worked on an initial implementation of revised useDraftObservation() hook that is basically done (no tests yet).
  • gregor worked on an adjacent item around updating the observation draft location in the background, which should remove some logic that's being done in the app
  • we all tried to experiment with the integration in certain parts of the app. gregor + erik looked into Create + Edit observation screens. andrew updated the CameraView and anything that consumes it. our explorations lives on the chore/draft-observation-hooks branch

what's left to do:

  • write tests for the revised useDraftObservation() hook + draft observation location updater
  • integrate new hook into the app without drastically removing unnecessary work that exists. estimate: 2 days
    • follow-up: remove the things that are no longer needed because of the new hook
    • follow-up: addressing bugs we'll find along the way during integration. these should be reported separately and addressed separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants