Skip to content

feat(planet): implement progressive loading for project cards#6101

Open
subhraneel2005 wants to merge 2 commits intosugarlabs:masterfrom
subhraneel2005:master
Open

feat(planet): implement progressive loading for project cards#6101
subhraneel2005 wants to merge 2 commits intosugarlabs:masterfrom
subhraneel2005:master

Conversation

@subhraneel2005
Copy link
Contributor

Summary

Implements progressive loading while fetching Planet server projects in Global. Projects now appear incrementally as they load instead of waiting for all the 25 API requests to complete.
Fixes #6072

PR Category

  • Bug Fix
  • Feature
  • Performance
  • Tests
  • Documentation

Problem

When scrolling to load more projects in Global:

  1. downloadProjectList returns ~25 project IDs
  2. Code makes 25 separate getProjectDetails API calls
  3. UI waits for ALL requests to complete before showing anything
  4. Users sees loader for 5-10 seconds

Solution

Modified GlobalPlanet.js to render each project card immediately after its details are fetched:

  • Added renderSingleProject(id) - renders individual card without clearing container
  • Modified downloadProjectsToCache() - accepts onEachComplete and onAllComplete callbacks
  • Modified addProjectToCache() - triggers render immediately on each completion
  • Updated addProjects() - uses progressive callbacks

Benefits

  • Immediate feedback (first project visible within ~200ms)
  • Better perceived performance
  • No breaking changes to API
  • Follows progressive loading UX pattern

Testing

  • Verified cards appear one-by-one as they load
  • Load More button still works correctly
  • Cached projects still render immediately
  • Search functionality unaffected
  • All Jest tests passed
  • No linting issues

Attachments

Before: Loading spinner shows for several seconds, then all cards appear at once

mar.4.2026.14_41.mp4

After: Cards appearing one-by-one as they load

mar.4.2026.14_54.mp4

@github-actions github-actions bot added the feature Adds new functionality label Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

✅ All Jest tests passed! This PR is ready to merge.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

✅ All Jest tests passed! This PR is ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Adds new functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI/UX] Planet server projects in Global load one-by-one causing long wait times

1 participant