Skip to content

Conversation

@AureliaSindhu
Copy link
Contributor

Summary

Added mobile support for restriction code popovers in RestrictionsCell. On mobile, clicking a restriction code opens a Popover with descriptions and a "University Requirements" link, since hover isn't available.
Screenshot 2026-01-06 at 3 02 53 PM

Test Plan

Use mobile view and click on restrictions for a chosen class.

Issues

Closes #1154

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds mobile support for restriction code popovers in the RestrictionsCell component. On mobile devices where hover interactions aren't available, clicking a restriction code now opens a Popover that displays the restriction descriptions along with a "University Requirements" link.

Key Changes:

  • Added mobile-specific interaction pattern using Popover instead of Tooltip
  • Implemented toggle behavior for opening/closing the popover on mobile
  • Maintained existing desktop tooltip behavior unchanged

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 77 to 86
<Typography
component="a"
href="https://www.reg.uci.edu/enrollment/restrict_codes.html"
target="_blank"
rel="noopener noreferrer"
onClick={handleClick}
sx={{ cursor: 'pointer' }}
>
{restrictions}
</a>
</Typography>
</Tooltip>
</Typography>
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The mobile link element has an href but prevents navigation with event.preventDefault(). This creates a confusing pattern - the link appears clickable but doesn't navigate. Consider either: 1) Removing the href and using role="button" with tabIndex={0} to properly indicate it's a button that opens a popover, or 2) Removing the preventDefault to allow navigation while the popover provides additional context before navigation.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is kinda troll that my review is just what the copilot said lol.

chore: seems like you're repurposing the anchor tag to create the styling for the button. It's clever but a little hacky even though it's a small snippet it's better practice to just mimic the styling with the css classes and make it a button. somn like that correct me if I'm wrong

@KevinWu098 KevinWu098 requested review from alexespejo and removed request for KevinWu098 January 7, 2026 02:39
@KevinWu098
Copy link
Member

Deferring review over to @alexespejo 🫡

@alexespejo
Copy link
Collaborator

/deploy

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.

smol changes

Comment on lines 77 to 86
<Typography
component="a"
href="https://www.reg.uci.edu/enrollment/restrict_codes.html"
target="_blank"
rel="noopener noreferrer"
onClick={handleClick}
sx={{ cursor: 'pointer' }}
>
{restrictions}
</a>
</Typography>
</Tooltip>
</Typography>
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is kinda troll that my review is just what the copilot said lol.

chore: seems like you're repurposing the anchor tag to create the styling for the button. It's clever but a little hacky even though it's a small snippet it's better practice to just mimic the styling with the css classes and make it a button. somn like that correct me if I'm wrong

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.

Restrictions pop-over for mobile

4 participants