Skip to content

perf(marketplace): reduce tab-switch lag with async CLI list and expl…#50

Merged
RealZST merged 2 commits into
RealZST:mainfrom
Orchardxyz:perf/marketplace-tab-switch-lag
May 14, 2026
Merged

perf(marketplace): reduce tab-switch lag with async CLI list and expl…#50
RealZST merged 2 commits into
RealZST:mainfrom
Orchardxyz:perf/marketplace-tab-switch-lag

Conversation

@Orchardxyz
Copy link
Copy Markdown
Contributor

Summary

  • Made list_cli_marketplace async via spawn_blocking so the Tauri event loop
    is not blocked during CLI registry loading
  • Moved loadTrending trigger from the store's setTab into the component
    useEffect, passing tab explicitly to avoid stale state

Test plan

  • First switch to AGENT-first CLI tab no longer causes noticeable UI lag
  • Trending section updates correctly when switching between tabs
  • CLI marketplace list loads asynchronously without blocking the UI

Before

PixPin_2026-05-13_11-15-11

After

PixPin_2026-05-13_11-16-08

Orchardxyz and others added 2 commits May 13, 2026 11:10
useEffect dep is [tab], so clicking the active tab does not re-fire
the load. Without this guard, setting trendingLoading: true in setTab
strands the spinner when the cache is empty (e.g. after a failed
initial fetch left trendingCache[tab] = []).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@RealZST RealZST merged commit 34cad2a into RealZST:main May 14, 2026
3 checks passed
@RealZST
Copy link
Copy Markdown
Owner

RealZST commented May 14, 2026

Thanks for the PR!

Added a follow-up commit (be5cd10): clicking the active tab leaves trendingLoading: true stuck because useEffect([tab]) doesn't re-fire on the same value. Most visible after a failed initial fetch when the user re-clicks the tab to retry. Guarded with tab !== prevTab.

Merged.

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