Skip to content

Az/if needed backend#415

Merged
alixer-alex merged 10 commits intomainfrom
az/if-needed-backend
Apr 20, 2026
Merged

Az/if needed backend#415
alixer-alex merged 10 commits intomainfrom
az/if-needed-backend

Conversation

@alixer-alex
Copy link
Copy Markdown
Contributor

@alixer-alex alixer-alex commented Apr 19, 2026

Description

If needed functionality implemented

Recording/Screenshots

Before

After

image

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

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
@ethancha0 ethancha0 self-requested a review April 19, 2026 21:14
@ethancha0 ethancha0 marked this pull request as ready for review April 19, 2026 21:16
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

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.

Comment thread src/components/availability/group-availability.tsx Outdated
};
}
}
export async function saveIfNeeded({
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hmmm im not sure, it is 2 different sql queries

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the feedback! I've saved this as a new learning to improve future reviews.

) {
return {
availableMembers: [],
ifNeededMembers: [],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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>

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

leaving this in to display ifneeded seperately later

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Understood—keeping it for a separate ifNeeded display; I won’t flag this as unused here.

@alixer-alex alixer-alex temporarily deployed to staging-415 April 19, 2026 21:28 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-415 April 19, 2026 21:29 Inactive
@alixer-alex alixer-alex temporarily deployed to staging-415 April 19, 2026 21:33 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-415 April 19, 2026 21:33 Inactive
@alixer-alex alixer-alex temporarily deployed to staging-415 April 19, 2026 23:13 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-415 April 19, 2026 23:13 Inactive
Comment thread src/components/availability/header/availability-header.tsx Outdated
Comment thread src/server/actions/availability/save/action.ts Outdated
@ethancha0 ethancha0 self-requested a review April 19, 2026 23:40
@alixer-alex alixer-alex temporarily deployed to staging-415 April 19, 2026 23:40 — with GitHub Actions Inactive
@github-actions github-actions Bot temporarily deployed to staging-415 April 19, 2026 23:41 Inactive
Copy link
Copy Markdown
Collaborator

@ethancha0 ethancha0 left a comment

Choose a reason for hiding this comment

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

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 !

⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⣿⣦⡀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣿⣷⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣠⣤⣤⣼⣿⣿⣿⣿⣿⣿⣿⣿⣷⠀⠀⠀⠀⠀
⠀⠀⠀⢀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀
⠀⠀⠀⠘⣿⣿⣿⣿⠟⠁⠀⠀⠀⠹⣿⣿⣿⣿⣿⠟⠁⠀⠀⠹⣿⣿⣿⠇⠀⠀⠀⠀
⠀⠀⠀⠀⣿⣿⣿⡇⠀⠀⠀⢼⣿⠀⢿⣿⣿⣿⣿⠀⣾⣷⠀⠀⢿⣿⣿⣿⠀⠀⠀⠀
⠀⠀⠀⢠⣿⣿⣿⣷⡀⠀⠀⠈⠋⢀⣿⣿⣿⣿⣿⡀⠙⠋⠀⢀⣾⣿⣿⡇⠀⠀⠀⠀
⢀⣀⣀⣀⣿⣿⣿⣿⣿⣶⣶⣶⣶⣿⣿⣿⣿⣾⣿⣷⣦⣤⣴⣿⣿⣿⣿⣤⠤⢤⣤⡄
⠈⠉⠉⢉⣙⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⣀⣀⣀⡀⠀
⠐⠚⠋⠉⢀⣬⡿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣥⣀⡀⠈⠀⠈⠛
⠀⠀⠴⠚⠉⠀⠀⠀⠉⠛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠋⠁⠀⠀⠀⠉⠛⠢⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢠⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀

@alixer-alex alixer-alex merged commit a6bac9c into main Apr 20, 2026
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.

If-Needed Availabilities

2 participants