Skip to content

294 alex graduate guest mode#335

Merged
denniwang merged 1 commit intomainfrom
294-alex-graduate-guest-mode
Apr 5, 2026
Merged

294 alex graduate guest mode#335
denniwang merged 1 commit intomainfrom
294-alex-graduate-guest-mode

Conversation

@yeejord
Copy link
Copy Markdown

@yeejord yeejord commented Mar 13, 2026

Pull Request

This PR creates a 'guest-plan' in local storage to store a single plan for someone who is not signed into Search. When creating a new plan, the guest-plan will be updated with the most recent plan. This is done using useLocalStorage that has been migrated from the Graduate codebase and updating the handleCreatePlan of the newPlanModal. It does not cover updating the plan as edits are made.

dennis todo : need to integrate /guest page to display the plan from localstorage later in future ticket

Closes PR #294

Type of Change

Please tick the boxes that best match your changes.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change requires a PCP (ie changes in deps, database, infrastructure, or package exports)

Testing

Please describe how you tested this PR (both manually and with tests) Provide instructions so we can reproduce.

  • To test first sign out if you are logged in to Search. Pull up 'Storage' in dev tools and view 'LocalStorage'. Create a new plan and see it show up under 'guest-plan' after clicking Create. If you create a new plan that new plan will replace the previous one (we only want a guest to be able to have 1 plan).

Checklist

  • I have performed a self-review of my own code
  • I have commented my code where needed
  • I have made corresponding changes to the documentation
  • I have run a build for the entire monorepo
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • All commits are atomic and my branch is cleaned (no WIP commits)

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
searchneu Error Error Apr 5, 2026 10:32pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
searchneu-docs Skipped Skipped Apr 5, 2026 10:32pm

Request Review

Copy link
Copy Markdown

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

Introduces a reusable localStorage React hook and uses it in the graduate “New Plan” modal to persist a newly created plan locally for unauthenticated (guest) users.

Changes:

  • Added useLocalStorage hook for SSR-safe localStorage read/write.
  • Updated NewPlanModal to detect auth session and store a “guest plan” locally when no user session exists.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
apps/searchneu/lib/graduate/useLocalStorage.ts Adds a generic hook for reading/writing JSON-serialized values in localStorage.
apps/searchneu/components/graduate/modal/NewPlanModal.tsx Uses session state to decide between server plan creation vs. local guest plan persistence.
Comments suppressed due to low confidence (1)

apps/searchneu/components/graduate/modal/NewPlanModal.tsx:62

  • authClient.useSession() can return data: undefined while the session is still loading. As written, !session?.user will treat “loading” as “guest”, so a signed-in user who clicks quickly could end up storing the plan in localStorage instead of creating it server-side. Consider also reading isPending from useSession() and blocking submission (or showing a spinner) until session resolution, and only treating session === null as unauthenticated.
  const { data: session } = authClient.useSession();

  //majors
  const { data: supportedMajorsData, error: majorsError } =
    useSupportedMajors();


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

You can also share your feedback on Copilot code review. Take the survey.

@denniwang denniwang linked an issue Mar 16, 2026 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 18, 2026

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: searchneu.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@vercel vercel bot temporarily deployed to Preview – searchneu-docs March 18, 2026 22:11 Inactive
@vercel vercel bot temporarily deployed to Preview – searchneu-docs March 18, 2026 22:15 Inactive
@yeejord yeejord force-pushed the 294-alex-graduate-guest-mode branch from 6d33146 to e90d277 Compare March 19, 2026 14:51
@vercel vercel bot temporarily deployed to Preview – searchneu-docs March 19, 2026 14:51 Inactive
@vercel vercel bot temporarily deployed to Preview – searchneu-docs March 19, 2026 17:15 Inactive
@vercel vercel bot temporarily deployed to Preview – searchneu-docs March 19, 2026 17:18 Inactive
@yeejord yeejord force-pushed the 294-alex-graduate-guest-mode branch from 3f1b96a to 0fe15ab Compare March 20, 2026 17:59
@vercel vercel bot temporarily deployed to Preview – searchneu-docs March 20, 2026 17:59 Inactive
@denniwang denniwang force-pushed the 294-alex-graduate-guest-mode branch from 0fe15ab to 45ada38 Compare March 27, 2026 18:32
@vercel vercel bot temporarily deployed to Preview – searchneu-docs March 27, 2026 18:32 Inactive
@vercel vercel bot temporarily deployed to Preview – searchneu March 27, 2026 18:33 Inactive
@vercel vercel bot temporarily deployed to Preview – searchneu-docs March 27, 2026 18:33 Inactive
@denniwang denniwang removed the request for review from mehallhm March 27, 2026 18:34
@denniwang denniwang force-pushed the 294-alex-graduate-guest-mode branch 2 times, most recently from 45ada38 to 74bbe2d Compare March 30, 2026 21:45
@vercel vercel bot temporarily deployed to Preview – searchneu-docs March 30, 2026 21:45 Inactive
@denniwang denniwang force-pushed the 294-alex-graduate-guest-mode branch from 74bbe2d to 54065a1 Compare April 5, 2026 20:36
@vercel vercel bot temporarily deployed to Preview – searchneu-docs April 5, 2026 20:36 Inactive
Copy link
Copy Markdown
Contributor

@denniwang denniwang left a comment

Choose a reason for hiding this comment

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

lgtm

@denniwang denniwang force-pushed the 294-alex-graduate-guest-mode branch from 54065a1 to 04e2a83 Compare April 5, 2026 22:25
@vercel vercel bot temporarily deployed to Preview – searchneu-docs April 5, 2026 22:25 Inactive
+dennis 3/30 using server side to get user auth status
@denniwang denniwang force-pushed the 294-alex-graduate-guest-mode branch from 04e2a83 to f2d875f Compare April 5, 2026 22:31
@vercel vercel bot temporarily deployed to Preview – searchneu-docs April 5, 2026 22:31 Inactive
@denniwang denniwang removed the request for review from 23langloisj April 5, 2026 22:33
Copy link
Copy Markdown
Contributor

@denniwang denniwang left a comment

Choose a reason for hiding this comment

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

lgtm

@denniwang denniwang merged commit 0e88d21 into main Apr 5, 2026
7 of 8 checks passed
@denniwang denniwang deleted the 294-alex-graduate-guest-mode branch April 5, 2026 22:47
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.

[alex] guest mode

4 participants