Skip to content

Speed up namespace landing data loading#2297

Merged
shangyian merged 1 commit into
DataJunction:mainfrom
shangyian:perf/ui-landing-data
Jul 5, 2026
Merged

Speed up namespace landing data loading#2297
shangyian merged 1 commit into
DataJunction:mainfrom
shangyian:perf/ui-landing-data

Conversation

@shangyian

@shangyian shangyian commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

A batch of independent optimizations to how the namespace landing page (NamespacePage) fetches and renders its data.

DJService.js

  • users() drops with_activity: The landing page and owner/edited-by dropdowns only use usernames, but with_activity=true made the endpoint join the entire history table.
  • listNamespacesWithGit caching: the namespace list is cached for 60s with an invalidateNamespacesCache() escape hatch, so re-entering namespace pages doesn't refetch it every mount.
  • nodeTypeCounts uses the new generic nodeCounts(groupBy: TYPE) query (one grouped scan) instead of 6 aliased per-type counts.

NamespacePage/index.jsx

  • Lazy load filter data: users and tags (for the Edited By / Owner / Tags dropdowns) are fetched on first dropdown open, not on mount. They still fetch eagerly when a matching filter is already active in the URL, so a pre-applied filter renders its label.
  • Gate table + count fetches on gitConfigLoaded: for git-root namespaces the table used to fetch a provisional namespace, then refetch after the redirect to the default branch. Waiting for git config resolves that duplicate.
  • Filters mount-guard: the URL to filters sync effect no longer refetches on first mount (state is already seeded from the URL).
  • Invalidate the namespace cache when a sub-namespace is created.

CompactSelect.jsx

Add a windowed menu list (cap rendered options at 100) so large lists like the full user list don't make the dropdown super slow and unusable.

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify

netlify Bot commented Jul 5, 2026

Copy link
Copy Markdown

Deploy Preview for thriving-cassata-78ae72 canceled.

Name Link
🔨 Latest commit fab9331
🔍 Latest deploy log https://app.netlify.com/projects/thriving-cassata-78ae72/deploys/6a4a87fde3779800089e1f3d

@shangyian shangyian force-pushed the perf/ui-landing-data branch from f88abab to 54de945 Compare July 5, 2026 16:04
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@shangyian shangyian force-pushed the perf/ui-landing-data branch from 54de945 to fab9331 Compare July 5, 2026 16:36
@shangyian shangyian changed the title Lazy-load filter data and gate namespace fetches on git config Speed up namespace landing data loading Jul 5, 2026
@shangyian shangyian marked this pull request as ready for review July 5, 2026 16:42
@shangyian shangyian merged commit 6e44935 into DataJunction:main Jul 5, 2026
21 checks passed
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.

1 participant