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: ✨ add group availability tab content #66

Merged
merged 10 commits into from
Mar 31, 2024

Conversation

seancfong
Copy link
Member

@seancfong seancfong commented Mar 7, 2024

Summary

  • A density map of group members with indicated availability shown on Group Availability tab

Desktop:
image
Mobile (iPhone 14 Pro Max shown):
image

  • Hovering over cells on desktop will dynamically update the side drawer to display available members.

  • Clicking on a cell on desktop will toggle lock and unlock of a selected cell to prevent updates on hovering.
    2024-03-09 17 28 56

  • Tapping on a cell on mobile will toggle a drawer to display available members (iPhone 14 Pro Max shown).

    • When the drawer is displayed, the user can scroll down to select cells on the bottom rows.
      2024-03-09 17 31 49

@seancfong seancfong linked an issue Mar 7, 2024 that may be closed by this pull request
@seancfong seancfong marked this pull request as ready for review March 10, 2024 01:34
@seancfong seancfong requested a review from MinhxNguyen7 March 10, 2024 01:34
Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

Looks great, works great, and you write very nice code.

You do need to resolve the merge conflicts though. Sorry about that

@seancfong
Copy link
Member Author

@MinhxNguyen7 Re-requesting review after resolving merge conflict.

Regarding your comment on GroupAvailability.svelte:42: Svelte's reactive block (the $: syntax) is at the component scope, meaning that the logic must be encapsulated inside a function to bail out on when null:

Just a tip: It's easier to read if you write if (selectedZotDateIndex === null || selectedBlockIndex === null) return, which indicates that you don't update if either aren't initialized yet. Won't hold up review, but it's just a tidbit for you.

  // Triggers on every selection change
  $: {
    const updateSelection = () => {
      if (selectedZotDateIndex === null || selectedBlockIndex === null) return;

      const availableMemberIndices: number[] =
        $availabilityDates[selectedZotDateIndex].getGroupAvailabilityBlock(selectedBlockIndex) ??
        [];

      availableMembersOfSelection = availableMemberIndices.map(
        (availableMemberIndex) => $groupMembers[availableMemberIndex].name,
      );

      notAvailableMembersOfSelection = $groupMembers
        .filter((_, index) => !availableMemberIndices.includes(index))
        .map((notAvailableMember) => notAvailableMember.name);
    };
    updateSelection();
  }

For now, I just left it how it originally was prior to the review. I think it seems to defeat the purpose of "not nesting" the conditional logic if we have to nest it in a function anyway :L

@MinhxNguyen7
Copy link
Member

MinhxNguyen7 commented Mar 30, 2024

The page isn't loading after the merge. /availability is throwing 500 on staging

I actually tried to merge, but I left it to you because I couldn't figure out why it was erroring. I tried rebasing, and the first commit seemed to be the problematic one.

Not sure what the problem is, and I figured you'd have a better idea.

@seancfong
Copy link
Member Author

The page isn't loading after the merge. /availability is throwing 500 on staging

I actually tried to merge, but I left it to you because I couldn't figure out why it was erroring. I tried rebasing, and the first commit seemed to be the problematic one.

Not sure what the problem is, and I figured you'd have a better idea.

@MinhxNguyen7 Did some classic commenting process of elimination to see what's causing the problem.

Looks like commenting line 295 in PersonalAvailability.svelte that imports @KevinWu098 's login flow resolved the issue. He may know more about what's going on. Here's the pr that contains the code: #62

Not sure if there's a missing dependency or environment variable that needs updating. Regardless, that was what worked for me in order to get the group tab up on my end.

image

@KevinWu098
Copy link
Member

The page isn't loading after the merge. /availability is throwing 500 on staging

I actually tried to merge, but I left it to you because I couldn't figure out why it was erroring. I tried rebasing, and the first commit seemed to be the problematic one.

Not sure what the problem is, and I figured you'd have a better idea.

@MinhxNguyen7 Did some classic commenting process of elimination to see what's causing the problem.

Looks like commenting line 295 in PersonalAvailability.svelte that imports @KevinWu098 's login flow resolved the issue. He may know more about what's going on. Here's the pr that contains the code: #62

Not sure if there's a missing dependency or environment variable that needs updating. Regardless, that was what worked for me in order to get the group tab up on my end.

image

Oh! The problem is with loginModalData. I renamed it when we were first going over the LoginFlow, but I forgot that data is a reserved word for passing values between server and client.

If you swap all instances of loginModalData back to just data, it'll work!

@seancfong
Copy link
Member Author

seancfong commented Mar 31, 2024

Oh! The problem is with loginModalData. I renamed it when we were first going over the LoginFlow, but I forgot that data is a reserved word for passing values between server and client.

If you swap all instances of loginModalData back to just data, it'll work!

Just to minimize the amount I touch your potential work, I aliased the data prop from Svelte to the variable you used to pass to the personal availability component.

image

image

All systems seem to go on my local branch: re-requesting review @MinhxNguyen7

Copy link
Member

@MinhxNguyen7 MinhxNguyen7 left a comment

Choose a reason for hiding this comment

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

This is cursed

@MinhxNguyen7 MinhxNguyen7 merged commit 324595e into main Mar 31, 2024
2 checks passed
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.

Style Availability Groups Tab
3 participants