Skip to content

Conversation

@roomote
Copy link
Collaborator

@roomote roomote commented Jun 17, 2025

Closes #4794

  • Fixed state management issue in MarketplaceViewStateManager where displayItems was not properly initialized
  • Improved handling of marketplace items when no filters are active to ensure all items are displayed
  • Enhanced initial state loading logic to prevent infinite loops and ensure proper state updates
  • Fixed getState method to fall back to allItems when displayItems is empty

The issue was caused by displayItems being set to an empty array when marketplace items were loaded,
even when no filters were applied. This caused the marketplace to appear blank after loading completed.


Important

Fixes marketplace blanking issue by ensuring displayItems are properly initialized and updated in MarketplaceViewStateManager.

  • Behavior:
    • Fixes displayItems initialization in MarketplaceViewStateManager to prevent marketplace blanking when no filters are active.
    • Updates getState to ensure displayItems defaults to allItems if undefined.
    • Enhances state change handling in MarketplaceView to prevent infinite loops.
  • Tests:
    • Adds tests in MarketplaceViewStateManager.spec.ts to verify displayItems initialization and state change notifications.
    • Tests ensure displayItems is never empty when allItems has content and no filters are active.
    • Verifies that state changes do not cause infinite loops and handle errors gracefully.

This description was created by Ellipsis for 5ff1732. You can customize this summary. It will automatically update as commits are pushed.

@roomote roomote requested review from cte, jr and mrubens as code owners June 17, 2025 18:53
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jun 17, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jun 17, 2025
@RooCodeInc RooCodeInc deleted a comment from roomote Jun 17, 2025
@RooCodeInc RooCodeInc deleted a comment from roomote Jun 17, 2025
@cte
Copy link
Collaborator

cte commented Jun 17, 2025

@roomote Add a test for this.

roomote added a commit that referenced this pull request Jun 17, 2025
- Add tests for displayItems initialization fix that prevents marketplace blanking
- Test state management scenarios including filtering, tab switching, and error handling
- Verify that displayItems properly falls back to allItems when no filters are active
- Test infinite loop prevention and proper state change notifications
- Ensure immutability of state objects returned by getState()

Addresses comment in PR #4796: #4796 (comment)
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Jun 17, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Jun 18, 2025
@daniel-lxs daniel-lxs moved this from PR [Draft / In Progress] to PR [Needs Prelim Review] in Roo Code Roadmap Jun 18, 2025
@daniel-lxs
Copy link
Member

This looks like it might be a proper fix, I'll move it so I can polish it up if needed

@hannesrudolph hannesrudolph added PR - Needs Preliminary Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jun 18, 2025
Copy link
Member

@daniel-lxs daniel-lxs left a comment

Choose a reason for hiding this comment

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

I was not able to replicate the issue but this change looks like it's good to have. I tested the marketplace and works correctly.

I ran pnpm check-types and pnpm test and didn't find any issues, I'm unsure what's causing the tests to fail on this PR.

Edit: the test needed to be updated to use vitest.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 19, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Jun 19, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Review] to PR [Needs Prelim Review] in Roo Code Roadmap Jun 19, 2025
roomote and others added 3 commits June 19, 2025 10:53
- Fixed state management issue in MarketplaceViewStateManager where displayItems was not properly initialized
- Improved handling of marketplace items when no filters are active to ensure all items are displayed
- Enhanced initial state loading logic to prevent infinite loops and ensure proper state updates
- Fixed getState method to fall back to allItems when displayItems is empty

The issue was caused by displayItems being set to an empty array when marketplace items were loaded,
even when no filters were applied. This caused the marketplace to appear blank after loading completed.
- Add tests for displayItems initialization fix that prevents marketplace blanking
- Test state management scenarios including filtering, tab switching, and error handling
- Verify that displayItems properly falls back to allItems when no filters are active
- Test infinite loop prevention and proper state change notifications
- Ensure immutability of state objects returned by getState()

Addresses comment in PR #4796: #4796 (comment)
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Needs Review] in Roo Code Roadmap Jun 19, 2025
@mrubens mrubens merged commit d598fc3 into main Jun 20, 2025
13 checks passed
@mrubens mrubens deleted the fix-4794 branch June 20, 2025 19:42
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 20, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jun 20, 2025
cte pushed a commit that referenced this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Review size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Marketplace blanks after populating

6 participants