Skip to content

Conversation

jhodapp
Copy link
Member

@jhodapp jhodapp commented Apr 8, 2025

Description

This PR refactors the Dashboard page removing unnecessary components and improving the CoachingSessionList component to display upcoming/previous sessions in two different tabs.

It also improves the logout robustness, but a separate PR will be necessary to fully address #101

Notes

  1. This PR replaces Refactor the Dashboard page #102, instead of merging into main will merge into @calebbourg's update_coaching_sessions branch
  2. Also, this backend PR must also land to ensure logout works well

GitHub Issue: Closes #87

Changes

  • Removes the SelectCoachingRelationship component from the Dashboard page
  • Moves CoachingSessionList left and widens it to the full page width
  • Adds a tab bar splitting sessions out by upcoming/previous sessions in the CoachingSessionList component
  • Move the CoachingSessionSelector into the CoachingSessionList
  • Addresses some of the logout robustness issues which was necessary to fully test the placeholder text of the CoachingSessionSelector component

Screenshots / Videos Showing UI Changes (if applicable)

No relationship selected:
Screenshot 2025-04-07 at 16 50 04

Relationship selected, upcoming sessions:
Screenshot 2025-04-07 at 16 50 25

Relationship selected, previous sessions:
Screenshot 2025-04-07 at 16 50 48

Testing Strategy

  1. Login as a user
  2. Notice the new CoachingSessionList component changes on the Dashboard page that should look like in the screenshots
  3. Notice that the SelectCoachingRelationship component is now removed from the Dashboard page
  4. Logout should work in every circumstance except for when the backend is down/unreachable

Concerns

None

@jhodapp jhodapp added the enhancement Improves existing functionality or feature label Apr 8, 2025
@jhodapp jhodapp added this to the 1.0-beta1 milestone Apr 8, 2025
@jhodapp jhodapp requested a review from calebbourg April 8, 2025 16:26
@jhodapp jhodapp self-assigned this Apr 8, 2025
@jhodapp jhodapp changed the title Remove org and rel selectors and enhance sessions list Refactor Dashboard page - remove org and rel selectors and enhance sessions list Apr 8, 2025
@jhodapp jhodapp requested a review from zgavin1 April 8, 2025 17:47
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.

@jhodapp looks great! I left some thoughts but I don't feel strong enough about any of it to request changes. Curious on your thoughts though.

@@ -19,18 +19,18 @@ export default async function middleware(req: NextRequest) {

// 3. Get the session from the cookie
const sessionCookie = req.cookies.get("id");
const session = sessionCookie?.value;
const validSession = sessionCookie?.value;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if isValidSession would make sense here? Especially since we're treating it as a boolean in, from what I can tell, every use.

The main reason I bring it up is that it feels somewhat misleading to call it validSession when it actually could represent a not valid session.

or if you wanted to be more explicit you could do something maybe like:

Suggested change
const validSession = sessionCookie?.value;
const isValidSession = !!sessionCookie?.value;

That way there is not ambiguity.
Probably not a huge deal either way. I don't consider it a blocker

}

// export function sortCoachingSessionArray(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this removable?

@jhodapp jhodapp merged commit 14ddebb into update_coaching_sessions Apr 9, 2025
@jhodapp jhodapp deleted the remove_org_and_rel_selectors_and_enhance_sessions_list branch April 9, 2025 04:42
@github-project-automation github-project-automation bot moved this from Review to ✅ Done in Refactor Coaching Platform Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves existing functionality or feature
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants