Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: better error and loading handling on programs page #1012

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Nov 8, 2023

  1. fix: handle query errors in ChooseSession

    The error and loading messages are just placeholders for now. The
    crucial change here is to let the student know when we can't display
    up-to-date session information for some reason.
    
    Note that we show data if it's available, without first checking for
    `isLoading` or `isError`. This means we may show stale data, but we prefer
    this over showing a loading message or an error for short server
    outages. For some justification of this approach, see:
    
    https://tkdodo.eu/blog/status-checks-in-react-query
    
    Note that React Query will not show stale data indefinitely, and will
    eventually show an error message if the data is stale for too long.
    
    Signed-off-by: Drew Hess <[email protected]>
    dhess committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    ee2280a View commit details
    Browse the repository at this point in the history
  2. fix: always render the session page nav bar

    The previous commit improved matters on the session page by handling
    `isError` and `isLoading` conditions, but has annoying behavior when
    the student is typing a program name into the search bar and we're
    doing live search, because the sessions page was rendered
    all-or-nothing.
    
    Now we always show the nav bar. This means we no longer have a nice
    single component for the sessions page (i.e., the `SessionsPage`
    component is no more), but `ChooseSession` is now more or less the
    same thing, only with better error and loading behavior. I haven't
    bothered to add a Storybook story for it, but it would be easyenough
    to add later if we need it.
    
    Signed-off-by: Drew Hess <[email protected]>
    dhess committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    630dd7c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0de9678 View commit details
    Browse the repository at this point in the history
  4. fix: disable exactOptionalPropertyTypes TypeScript option

    This setting is causing problems with one of `react-aria`'s
    dependencies, and we've found it to be probably more annoying than
    it's worth anyway, on balance.
    
    Signed-off-by: Drew Hess <[email protected]>
    dhess committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    904f050 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7a3ef55 View commit details
    Browse the repository at this point in the history
  6. fix: show more helpful messages when no programs are found

    Signed-off-by: Drew Hess <[email protected]>
    dhess committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    4f489a6 View commit details
    Browse the repository at this point in the history