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

Introduce MVP-level coaching session Note creation/updating #25

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

jhodapp
Copy link
Member

@jhodapp jhodapp commented Jul 25, 2024

Description

This PR creates a new note when a coaching session page first loads and an associated note.id isn't yet set. It also updates the singular Note (for now) associated with this session after a 1 second delay of non-typing.

Note: this requires the use of this backend PR to function correctly

GitHub Issue: None

Changes

  • Introduces a new Note type
  • Create a new Note instance if there isn't one yet for the given coaching_session_id
  • Fetches the Note's body on page render if there is an instance already associated with the given coaching_session_id
  • Updates the Note's body on the backend if the user types any changes

Screenshots / Videos Showing UI Changes (if applicable)

Testing Strategy

  1. Join a coaching session
  2. Observe the Note body text in the textarea if there is already Note text associated with this session
  3. Update the text, notice that a text indicator below the note textarea says "All change saved" if it was able to update the backend, otherwise should say "Failed to save changes" if it couldn't update the backend

Concerns

This PR does not yet automatically update the second user's Note textarea when the first user makes any changes. I haven't tested this across multiple users yet, they will most likely clobber each other's updates if they both make Note changes.

@jhodapp jhodapp added the feature work Specifically implementing a new feature label Jul 25, 2024
@jhodapp jhodapp self-assigned this Jul 25, 2024
@jhodapp jhodapp changed the title Creates a new note when a coaching session page first loads Create a new note when a coaching session page first loads Jul 26, 2024
@jhodapp jhodapp requested review from qafui and calebbourg July 29, 2024 16:30
@jhodapp jhodapp marked this pull request as ready for review July 29, 2024 16:30
@jhodapp jhodapp changed the title Create a new note when a coaching session page first loads Introduce MVP-level coaching session Note creation/updating Jul 29, 2024
Copy link
Collaborator

@calebbourg calebbourg left a comment

Choose a reason for hiding this comment

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

I was able to test this locally. Very cool!!

Screen Shot 2024-08-01 at 6 56 54 AM


await fetchNotesByCoachingSessionId(coachingSessionId)
.then((notes) => {
// Apparently it's normal for this to be triggered twice in modern
Copy link
Collaborator

Choose a reason for hiding this comment

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

interesting

@jhodapp jhodapp merged commit e117c16 into main Aug 1, 2024
1 check passed
@jhodapp jhodapp deleted the create_a_new_note branch August 1, 2024 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature work Specifically implementing a new feature
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants