fix: hide empty Program elements section when all scopes are anonymous
Author: Aaron Steven White
Commit
f9664e89d9d2936ff11a6ecc016611dd0424468fParent: 26701d8b33
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-cospan1 file changed +11 -11
@@ -422,25 +422,25 @@
422422 </details> 423423 {/if} 424424 425- <!-- Structural change tree --> 426- {#if sd.removedVertices.length > 0 || sd.addedVertices.length > 0 || sd.kindChanges.length > 0} 425+ <!-- Structural change tree (program elements) --> 426+ {#if (() => { 427+ const rg = groupVertices(sd.removedVertices, file.path); 428+ const ag = groupVertices(sd.addedVertices, file.path); 429+ return [...new Set([...rg.map(g => g.scope), ...ag.map(g => g.scope)])].filter(s => s !== '(other)' && s !== '(module)').length > 0; 430+ })()} 427431 {@const removedGroups = groupVertices(sd.removedVertices, file.path)} 428432 {@const addedGroups = groupVertices(sd.addedVertices, file.path)} 433+ {@const filteredScopes = [...new Set([ 434+ ...removedGroups.map(g => g.scope), 435+ ...addedGroups.map(g => g.scope), 436+ ])].filter(s => s !== '(other)' && s !== '(module)')} 429437 <div class="mb-3 space-y-2"> 430- <!-- Kind changes are surfaced via the breaking/compatible 431- change classifications above. No standalone section needed. --> 432- 433- <!-- Show each scope that had changes --> 434- <!-- Scope tree - each element is clickable to show its details --> 435438 <div class="rounded-md border border-border"> 436439 <div class="px-3 py-2 text-xs font-semibold uppercase tracking-wider text-text-muted"> 437440 Program elements 438441 </div> 439442 <div class="space-y-0.5 px-1 pb-1"> 440- {#each [...new Set([ 441- ...removedGroups.map(g => g.scope), 442- ...addedGroups.map(g => g.scope), 443- ])].filter(s => s !== '(other)' && s !== '(module)') as scope (scope)} 443+ {#each filteredScopes as scope (scope)} 444444 {@const removed = removedGroups.find(g => g.scope === scope)} 445445 {@const added = addedGroups.find(g => g.scope === scope)} 446446 {@const scopeKind = removed?.scopeKind ?? added?.scopeKind ?? '·'}