Az/if needed backend#415
Conversation
availability selection state is now inside availability.ts
if needed saved in the backend
changed color of zotmeet availabilities to pink
if needed is now shown!
cancel now works with if needed
There was a problem hiding this comment.
3 issues found across 18 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/components/availability/group-responses.tsx">
<violation number="1" location="src/components/availability/group-responses.tsx:96">
P3: `ifNeededMembers` is computed and returned but never used, which adds unnecessary work on each memo recomputation.</violation>
</file>
<file name="src/components/availability/group-availability.tsx">
<violation number="1" location="src/components/availability/group-availability.tsx:543">
P2: Guard `ifNeededDate` before accessing `.groupAvailability`; it can be null when the last page is padded, which will throw during render.</violation>
</file>
<file name="src/server/actions/availability/save/action.ts">
<violation number="1" location="src/server/actions/availability/save/action.ts:88">
P2: `saveIfNeeded` duplicates most of `saveAvailability`; extract shared persistence logic to avoid divergence bugs.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| }; | ||
| } | ||
| } | ||
| export async function saveIfNeeded({ |
There was a problem hiding this comment.
P2: saveIfNeeded duplicates most of saveAvailability; extract shared persistence logic to avoid divergence bugs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/server/actions/availability/save/action.ts, line 88:
<comment>`saveIfNeeded` duplicates most of `saveAvailability`; extract shared persistence logic to avoid divergence bugs.</comment>
<file context>
@@ -76,3 +85,76 @@ export async function saveAvailability({
};
}
}
+export async function saveIfNeeded({
+ meetingId,
+ availabilityTimes,
</file context>
There was a problem hiding this comment.
hmmm im not sure, it is 2 different sql queries
There was a problem hiding this comment.
Thanks for the feedback! I've saved this as a new learning to improve future reviews.
| ) { | ||
| return { | ||
| availableMembers: [], | ||
| ifNeededMembers: [], |
There was a problem hiding this comment.
P3: ifNeededMembers is computed and returned but never used, which adds unnecessary work on each memo recomputation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/components/availability/group-responses.tsx, line 96:
<comment>`ifNeededMembers` is computed and returned but never used, which adds unnecessary work on each memo recomputation.</comment>
<file context>
@@ -90,6 +93,7 @@ export function GroupResponses({
) {
return {
availableMembers: [],
+ ifNeededMembers: [],
};
}
</file context>
There was a problem hiding this comment.
leaving this in to display ifneeded seperately later
There was a problem hiding this comment.
Understood—keeping it for a separate ifNeeded display; I won’t flag this as unused here.
ethancha0
left a comment
There was a problem hiding this comment.
Great Job Alex! Working with the availability components can be super tricky. I'm really glad we were able to get this feature merged in for our MVP! The If-Needed logic seems to mirror how adding personal availabilities works. As for the blue design, we can adjust this in a future PR after consulting the designers.
I really appreciate the hard work Alex !
⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣠⣤⣤⣼⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀
⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀
⠀⠀⠀⠘⣿⣿⣿⣿⠟⠁⠀⠀⠀⠹⣿⣿⣿⣿⣿⠟⠁⠀⠀⠹⣿⣿⣿⠇⠀⠀⠀⠀
⠀⠀⠀⠀⣿⣿⣿⡇⠀⠀⠀⢼⣿⠀⢿⣿⣿⣿⣿⠀⣾⣷⠀⠀⢿⣿⣿⣿⠀⠀⠀⠀
⠀⠀⠀⢠⣿⣿⣿⣷⡀⠀⠀⠈⠋⢀⣿⣿⣿⣿⣿⡀⠙⠋⠀⢀⣾⣿⣿⡇⠀⠀⠀⠀
⢀⣀⣀⣀⣿⣿⣿⣿⣿⣶⣶⣶⣶⣿⣿⣿⣿⣾⣿⣷⣦⣤⣴⣿⣿⣿⣿⣤⠤⢤⣤⡄
⠈⠉⠉⢉⣙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⣀⣀⣀⡀⠀
⠐⠚⠋⠉⢀⣬⡿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣥⣀⡀⠈⠀⠈⠛
⠀⠀⠴⠚⠉⠀⠀⠀⠉⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠋⠁⠀⠀⠀⠉⠛⠢⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀
Description
If needed functionality implemented
Recording/Screenshots
Before
After
Test Plan
Every use case that could use if needed:
draw if needed
draw if needed over availabilities sections
draw availabilities over if needed sections
cancel
Issues
Needs the figma design for if needed, specifically the stripes