feat: show schema import progress on repo overview When panproto is still parsing a repository after a push, the repo page now shows a prominent "Schema analysis in progress" banner with a spinner. This tells users that structural data (language breakdown, breaking change detection, schema graphs) will appear once the background import completes. New XRPC endpoint: dev.panproto.node.getImportStatus - Reports ready/importing/pending/no_repo status - Checks for import marks file and vcs store presence
Author: Aaron Steven White
Commit
5225ce0b2db950c34e6a3f5af6f693dd9269132cParent: 3017d114e4
Structural diff unavailable
These commits were pushed via plain git push, so no pre-parsed
schemas are available. Install git-remote-cospan and re-push via panproto:// to
see scope-level changes, breaking change detection, and semantic diffs.
brew install panproto/tap/git-remote-cospan9 files changed +137 -5
@@ -122,6 +122,12 @@ export interface DependencyGraphResponse {
122122 edges: DependencyEdge[]; 123123 } 124124 125+export interface ImportStatusResponse { 126+ status: 'ready' | 'importing' | 'pending' | 'no_repo'; 127+ message: string; 128+ ready: boolean; 129+} 130+ 125131 // ── API functions ────────────────────────────────────────────────── 126132 127133 export function getProjectSchema(params: {
@@ -182,6 +188,16 @@ export function compareBranchSchemas(params: {
182188 ); 183189 } 184190 191+export function getImportStatus(params: { 192+ did: string; 193+ repo: string; 194+}): Promise<ImportStatusResponse> { 195+ return xrpcQuery<ImportStatusResponse>( 196+ 'dev.panproto.node.proxy.getImportStatus', 197+ params 198+ ); 199+} 200+ 185201 export function getDependencyGraph(params: { 186202 did: string; 187203 repo: string;
@@ -1,12 +1,14 @@
11 <script lang="ts"> 2- import type { ProjectSchemaResponse, CommitSchemaStatsResponse } from '$lib/api/schema.js'; 2+ import type { ProjectSchemaResponse, CommitSchemaStatsResponse, ImportStatusResponse } from '$lib/api/schema.js'; 33 44 let { 55 projectSchema, 66 schemaStats, 7+ importStatus, 78 }: { 89 projectSchema: ProjectSchemaResponse | null; 910 schemaStats: CommitSchemaStatsResponse | null; 11+ importStatus: ImportStatusResponse | null; 1012 } = $props(); 1113 1214 // Language hue mapping (same as RepoCard protocol hues)
@@ -30,6 +32,20 @@
3032 ); 3133 </script> 3234 35+{#if importStatus && !importStatus.ready} 36+ <div class="mb-4 rounded-lg border border-amber-500/30 bg-amber-500/5 p-4"> 37+ <div class="flex items-center gap-3"> 38+ <div class="h-4 w-4 animate-spin rounded-full border-2 border-amber-400/30 border-t-amber-400"></div> 39+ <div> 40+ <span class="text-sm font-medium text-amber-400">Schema analysis in progress</span> 41+ <p class="mt-0.5 text-xs text-text-muted"> 42+ panproto is parsing your repository. Structural data (language breakdown, breaking change detection, schema graphs) will appear once processing completes. This can take a few minutes for large repositories. 43+ </p> 44+ </div> 45+ </div> 46+ </div> 47+{/if} 48+ 3349 {#if projectSchema || schemaStats} 3450 <div class="mb-4 rounded-lg border border-border bg-surface-1 p-4"> 3551 <h3 class="mb-3 text-xs font-semibold uppercase tracking-wider text-text-muted">
@@ -5,8 +5,10 @@ import { listCommits, type Commit } from '$lib/api/vcs.js';
55 import { 66 getProjectSchema, 77 getCommitSchemaStats, 8+ getImportStatus, 89 type ProjectSchemaResponse, 910 type CommitSchemaStatsResponse, 11+ type ImportStatusResponse, 1012 } from '$lib/api/schema.js'; 1113 1214 export const load: PageServerLoad = async ({ params }) => {
@@ -19,11 +21,9 @@ export const load: PageServerLoad = async ({ params }) => {
1921 let commits: Commit[] = []; 2022 let projectSchema: ProjectSchemaResponse | null = null; 2123 let schemaStats: CommitSchemaStatsResponse | null = null; 24+ let importStatus: ImportStatusResponse | null = null; 2225 2326 if (repo && repo.source !== 'tangled') { 24- // Fetch commit graph, project schema, and schema stats in parallel. 25- // All are best-effort: if the node is unreachable, the page 26- // still renders with what we have. 2727 const results = await Promise.allSettled([ 2828 listCommits({ 2929 did: params.did,
@@ -33,6 +33,7 @@ export const load: PageServerLoad = async ({ params }) => {
3333 }), 3434 getProjectSchema({ did: params.did, repo: params.repo }), 3535 getCommitSchemaStats({ did: params.did, repo: params.repo, limit: 30 }), 36+ getImportStatus({ did: params.did, repo: params.repo }), 3637 ]); 3738 3839 if (results[0].status === 'fulfilled') {
@@ -44,11 +45,14 @@ export const load: PageServerLoad = async ({ params }) => {
4445 if (results[2].status === 'fulfilled') { 4546 schemaStats = results[2].value; 4647 } 48+ if (results[3].status === 'fulfilled') { 49+ importStatus = results[3].value; 50+ } 4751 } 4852 4953 return { 5054 repo, refUpdates, commits, 51- projectSchema, schemaStats, 55+ projectSchema, schemaStats, importStatus, 5256 did: params.did, repoName: params.repo, 5357 }; 5458 } catch (err) {
@@ -59,6 +63,7 @@ export const load: PageServerLoad = async ({ params }) => {
5963 commits: [] as Commit[], 6064 projectSchema: null as ProjectSchemaResponse | null, 6165 schemaStats: null as CommitSchemaStatsResponse | null, 66+ importStatus: null as ImportStatusResponse | null, 6267 did: params.did, 6368 repoName: params.repo 6469 };
@@ -100,6 +100,7 @@
100100 <SchemaHealthCard 101101 projectSchema={data.projectSchema} 102102 schemaStats={data.schemaStats} 103+ importStatus={data.importStatus} 103104 /> 104105 105106 {#if (data.schemaStats?.commits?.length ?? 0) > 1}
@@ -180,6 +180,10 @@ pub fn router(state: Arc<AppState>) -> Router {
180180 "/xrpc/dev.panproto.node.proxy.getDependencyGraph", 181181 get(node_proxy::proxy_get_dependency_graph), 182182 ) 183+ .route( 184+ "/xrpc/dev.panproto.node.proxy.getImportStatus", 185+ get(node_proxy::proxy_get_import_status), 186+ ) 183187 // --- Procedures (POST) --- 184188 .route( 185189 "/xrpc/dev.cospan.feed.star.toggle",