fix: prevent empty state flash and add skeleton loading for app list#30616
fix: prevent empty state flash and add skeleton loading for app list#30616crazywoola merged 6 commits intomainfrom
Conversation
- Add keepPreviousData to useInfiniteAppList to retain previous data during filter changes - Add isFetching state handling in list.tsx to show proper loading states - Create AppCardSkeleton component for loading placeholder - Add isLoading prop to NewAppCard to show loading state during permission loading - Show NewAppCard during isLoadingCurrentWorkspace to prevent layout shifts Closes #30614 Closes #30615
Summary of ChangesHello @lyzno1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the user experience on the Apps list page by resolving two key UI issues. It prevents the 'empty state flash' that occurred when switching filters by intelligently retaining previous data during new data fetches. Additionally, it introduces comprehensive skeleton loading states and refines the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively resolves two user experience issues on the Apps list page: the flashing of an empty state during filter changes and the absence of a proper loading indicator. The implementation correctly uses keepPreviousData from TanStack Query to maintain the previous dataset while fetching new data, which is an excellent approach. Additionally, the introduction of a skeleton loader and appropriate loading states for cards significantly improves the perceived performance and provides better visual feedback to the user. The code is well-structured, but I've identified an area with code duplication in the rendering logic that could be refactored for better maintainability.
There was a problem hiding this comment.
Pull request overview
This PR addresses two UX issues in the Apps list page: preventing empty state flashes during filter transitions and adding proper skeleton loading states. The solution leverages TanStack Query's keepPreviousData feature to retain previous data during refetches, combined with improved loading state handling and a new skeleton component.
Key changes:
- Implemented
placeholderData: keepPreviousDatain the infinite query to prevent data flashing during filter changes - Added comprehensive loading state logic with
showSkeletonandshowEmptycomputed values - Created a new
AppCardSkeletoncomponent for loading placeholders - Enhanced
NewAppCardto show in a loading/disabled state during permission checks
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| web/service/use-apps.ts | Adds keepPreviousData to useInfiniteAppList to retain previous data during filter transitions |
| web/app/components/apps/new-app-card.tsx | Adds isLoading prop with opacity and pointer-events styling for loading state |
| web/app/components/apps/list.tsx | Implements improved loading state logic with skeleton rendering and handles isLoadingCurrentWorkspace |
| web/app/components/apps/app-card-skeleton.tsx | New skeleton placeholder component matching AppCard layout |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ist conditional rendering logic.
- Fix skeleton styling to match AppCard (border-[0.5px] border-components-card-border bg-components-card-bg) - Simplify IIFE logic by removing showEmpty variable and using fallthrough to Empty - Fix edge case where nothing rendered during empty-to-fetch transition - Change to named export for AppCardSkeleton (ESM compliance)
| /gemini review |
There was a problem hiding this comment.
Code Review
This pull request effectively addresses two user experience issues on the Apps list page by preventing the empty state flash and adding a skeleton loading state. The use of TanStack Query's keepPreviousData is appropriate for the first issue, and the new skeleton components improve the perceived performance during loading. The code changes are well-implemented. I've provided a couple of suggestions for the list.tsx component to enhance code readability and maintainability.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary
This PR fixes two UX issues with the Apps list page:
keepPreviousDatato retain previous data while new data is being fetchedChanges
web/service/use-apps.tskeepPreviousDataimport from TanStack QueryplaceholderData: keepPreviousDatatouseInfiniteAppListhookweb/app/components/apps/list.tsxisFetchingandisLoadingCurrentWorkspacestate handlingshowSkeletonandshowEmptycomputed values for cleaner conditional renderingisLoadingpropisCurrentWorkspaceEditorto(isCurrentWorkspaceEditor || isLoadingCurrentWorkspace)web/app/components/apps/new-app-card.tsxisLoadingprop (default: false)opacity-50andpointer-events-nonewhen loadingweb/app/components/apps/app-card-skeleton.tsx(NEW)Skeletonbase componentsScreenshots
Related Issues
Closes #30614
Closes #30615