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 load on enter #332

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open

Fix load on enter #332

wants to merge 11 commits into from

Conversation

AbhiramTadepalli
Copy link
Contributor

Overview

After https://github.com/UTDNebula/utd-trends/pull/298/files, since searching is initiated quicker, user feels some lag while waiting for search results

What Changed

Set the loading state quicker, and add a loading icon in the search button

Copy link

vercel bot commented Nov 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
utd-trends ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 27, 2024 6:52pm

@AbhiramTadepalli
Copy link
Contributor Author

I am calling setSearchResultsLoading() inside the useEffect that has searchResultsLoading as a dependency. Is this bad practice?

@AbhiramTadepalli
Copy link
Contributor Author

I don't really like the solution. It works but it introduces an unnecessary state I feel like combining it with results.state is probable better but idk how to fully.

@AbhiramTadepalli
Copy link
Contributor Author

Another problem:

On search from landing page to dashboard, it calls DashboardEmpty and then DashboardError before the searchResultsTable Skeletons

If I modify:

    contentComponent = <DashboardEmpty />;```
and Remove the DashboardError elseif, then for a second, it shows the "No Results" state from searchResultsTable.tsx

Ideally:
Initiate search from landing -> directly shows srt's loading state, nothing in between

@TyHil
Copy link
Member

TyHil commented Nov 25, 2024

Can revert but lmk what you think of these changes to use results.state and remove the flashing DashboardError and DashboardEmpty.

Opinion: I don't feel the spinner in the search bar is all that necessary when the whole page changes to a loading state.

Current issue (possibly unsolvable): There's also an issue when reloading/opening the dashboard (but not when navigating to it from the homepage) where the searchResultsTable and RHS cards flash white. I seems this is just in the split second before CSS is loaded but it is odd

@TyHil
Copy link
Member

TyHil commented Nov 25, 2024

Opinion: I don't feel the spinner in the search bar is all that necessary when the whole page changes to a loading state.

nvm the spinners grown on me

Current issue (possibly unsolvable): There's also an issue when reloading/opening the dashboard (but not when navigating to it from the homepage) where the searchResultsTable and RHS cards flash white. I seems this is just in the split second before CSS is loaded but it is odd

solved via a new MUI feature

the topMenu does still jump around because CSS seems to be rendering it as mobile first and it doesn't update until JS is run. there might be a css solution

@TyHil
Copy link
Member

TyHil commented Nov 25, 2024

the topMenu does still jump around because SSR seems to be rendering it as mobile first because of the media query it uses. there might be a css solution

solved! turns out using an actual media query instead of useMediaQuery fixes this. Probably since CSS is faster than JS

@AbhiramTadepalli
Copy link
Contributor Author

  • Do not search when user clicks on an autocomplete suggestion
  • If you type out cs 1200, space, cs2337, space, clicking enter does not search

@AbhiramTadepalli
Copy link
Contributor Author

Everything else works perfectly. Searches appear faster because there is less lag in between and code-wise it's very simple

@TyHil
Copy link
Member

TyHil commented Nov 27, 2024

Do not search when user clicks on an autocomplete suggestion
If you type out cs 1200, space, cs2337, space, clicking enter does not search

I think #298 caused both of these issues as they are present on that PR, dev, and prod.

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.

2 participants