Skip to content

Conversation

@vicksey
Copy link
Contributor

@vicksey vicksey commented Nov 15, 2025

Summary

When a user adds Async sections to their schedule, a collapsible dialogue is now added to the bottom right of their calendar.
Alternative to #1310 that's less blaring to the user.
image

When screenshotted:
image

Test Plan

  • Add/remove TBA time sections
  • Add to multiple schedules and switch through them aimlessly

Issues

  • Could argue that its going to block an event on Friday night but tbh no one has anything there anyways

Closes #1181

@alexespejo alexespejo self-requested a review November 17, 2025 23:44
Copy link
Collaborator

@alexespejo alexespejo left a comment

Choose a reason for hiding this comment

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

Pretty cool 😄

@vicksey
Copy link
Contributor Author

vicksey commented Nov 26, 2025

@alexespejo I resolved all your comments, lmk if theres anything else !

@vicksey vicksey requested a review from alexespejo November 26, 2025 23:42
@vicksey vicksey requested a review from alexespejo December 1, 2025 00:29

export default function AsyncCalendarCard() {
const isMobile = useIsMobile();
if (isMobile) return null;
Copy link
Member

@KevinWu098 KevinWu098 Dec 3, 2025

Choose a reason for hiding this comment

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

issue: unless I'm mistaken, I believe this breaks React's rules of hooks in that it makes the amount of hooks rendered variable between renders

suggestion: move the isMobile check below all of the hooks

if (!visble || isMobile) {
	return null;
}

sectionCode: string;
}

export default function AsyncCalendarCard() {
Copy link
Member

Choose a reason for hiding this comment

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

issue: this is a TBA card, right? Not an async card?

edit: I notice the component seems to oscillate between using TBA, Async, or some combination of both — this should be consistent

AppStore.off('clearSchedule', handleUpdate);
AppStore.off('currentScheduleIndexChange', handleUpdate);
};
}, []);
Copy link
Member

Choose a reason for hiding this comment

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

issue: Why do we have a flag that forces a rerender when courses change? My interpretation here is that we want tbaSections to be reactive to the value of AppStore.schedule.getCurrentCourses().

If so, we shouldn't "pipe" reactive events across multiple hooks.

suggestion: we can have this useEffect update the value of tbaSections stored in a useState (this means we don't have to go from "course updated" -> "update trigger" -> "update tbaSections" and instead just say "course updated" -> "update tbaSections"

Comment on lines +40 to +49
const handleScreenshot = () => {
if (collapsed && visible) {
setCollapsed(false);
}
};
AppStore.on('screenshot', handleScreenshot);
return () => {
AppStore.off('screenshot', handleScreenshot);
};
}, [collapsed, visible]);
Copy link
Member

Choose a reason for hiding this comment

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

issue: this doesn't seem to actually work?


useEffect(() => {
const raw = getLocalStorageTempSaveData();
if (!raw) return;
Copy link
Member

Choose a reason for hiding this comment

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

nit: always use braces

Suggested change
if (!raw) return;
if (!raw) {
return;
}

left: 'auto',
right: 16,
zIndex: (theme) => theme.zIndex.drawer - 1,
width: '22rem',
Copy link
Member

Choose a reason for hiding this comment

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

question: why 22 rem? is this specific to some styling of the calendar? is it arbitrary?

Comment on lines +133 to +137
action={
<IconButton size="small" onClick={handleToggleCollapse}>
{collapsed ? <ExpandMore fontSize="small" /> : <ExpandMore fontSize="small" sx={{ transform: 'rotate(180deg)' }} />}
</IconButton>
}
Copy link
Member

Choose a reason for hiding this comment

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

nit (repeat): formatting

you should check your prettier settings and write an issue if it appears to be a problem with AA and not your configuration

px: 1,
width: '100%',
}}
action={
Copy link
Member

Choose a reason for hiding this comment

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

issue: the action button looks misaligned/not respecting the alert padding

Image

</IconButton>
}
>
<AlertTitle sx={{ fontSize: '1em', my: 'auto'}}>
Copy link
Member

Choose a reason for hiding this comment

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

question: em? Although em is more correct in some cases, AA tends to use rem in most cases iirc. was this intentional?

</AlertTitle>

<Collapse in={!collapsed} timeout="auto" unmountOnExit>
<Box sx={{ mt: 0.25, py: 0.25 }}>
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: is 2 pixels of vertical padding noticeable? seems like we could omit these styles and add a gap property to the container if we want to space out the title and the collapse

@github-actions github-actions bot added the Stale label Jan 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AA Calendar Should Indicate Async

4 participants