Skip to content

Deck: default to nodeType:Slide scope:subtree; parser understands [path1, path2, …] - #460

Merged
rbuergi merged 1 commit into
mainfrom
fix/contentas-jsonelement-strip-type
Jul 13, 2026
Merged

rbuergi merged 1 commit into
mainfrom
fix/contentas-jsonelement-strip-type

Conversation

@rbuergi

@rbuergi rbuergi commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

The report

A deck rendered "This deck has no slides yet" even though its slide nodes exist. I first mis-diagnosed this as a ContentAs/JsonElement deserialization bug and wrote a hack — that was wrong (reverted): the deck's manifest deserializes fine, and the data was never corrupt. The real gap: a deck whose slides are simply its children had no way to find them without a hardcoded array.

Two changes, both test-first (red test → implement → green):

1. Query parser understands [path1, path2, …]

An explicit ordered path list is now a recognized query form, populating the existing ParsedQuery.Paths order-preserving — so GetQuery / IMeshService.Query resolve exactly those nodes in that order. It's the array surface of the existing path:a|b|c alternation — the "alternatively, specify the exact slides in order" form.

Tests: Parse_BracketList_PopulatesOrderedPaths, Parse_BracketList_SingleEntry.

2. Deck defaults to nodeType:Slide scope:subtree

When a deck carries no explicit manifest, its slide set now defaults to the live query nodeType:Slide scope:subtree under the deck path, ordered by MeshNode.Order. A deck can be just "a folder of slides" — no hardcoded array required. An explicit manifest still rules when present.

Test: DeckPresent_NoManifest_DefaultsToSubtreeSlideQuery_InOrder — a deck with two child slides and no manifest was red ("no slides yet"), now presents them in Order.

Verification

QueryParserTests 79/79, DeckLayoutAreaTest 6/6, SlideLayoutAreaTest 3/3; full solution builds Release -warnaserror.

🤖 Generated with Claude Code

…ds [path1, path2, …]

A Deck whose slides are simply its children — no hardcoded Slides manifest — rendered
"This deck has no slides yet" even though the slide nodes exist. The data was never
corrupt (the manifest, when present, deserializes fine); the deck just had no way to
find its slides without an explicit array.

Two changes, both test-first:

1. QueryParser recognizes an explicit ORDERED path list `[a, b, c]` and populates the
   existing ParsedQuery.Paths (order-preserving), so GetQuery / IMeshService.Query
   resolve exactly those nodes in that order — the "alternatively specify the exact
   slides" surface, the array form of path:a|b|c.
   Tests: Parse_BracketList_PopulatesOrderedPaths, Parse_BracketList_SingleEntry.

2. DeckLayoutAreas: when a deck carries no explicit manifest, its slide set DEFAULTS to
   the live query `nodeType:Slide scope:subtree` under the deck path, ordered by
   MeshNode.Order — a deck can be just "a folder of slides", no hardcoded array. An
   explicit manifest still rules when present.
   Test: DeckPresent_NoManifest_DefaultsToSubtreeSlideQuery_InOrder (was red — deck with
   two child slides and no manifest now presents them in Order).

Verified: QueryParserTests 79/79, DeckLayoutAreaTest 6/6, SlideLayoutAreaTest 3/3;
full solution builds Release -warnaserror.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes Deck rendering when no explicit slide manifest is present, and extends the query language with an ordered “explicit path list” form to support order-sensitive consumers.

Changes:

  • Added whole-query bracket list parsing ([path1, path2, ...]) that populates ParsedQuery.Paths in order.
  • Updated Deck slide resolution to fall back to a live nodeType:Slide scope:subtree query under the deck path (ordered by MeshNode.Order) when DeckContent.Slides is empty.
  • Added tests covering bracket-list parsing and the “no-manifest deck defaults to subtree slides” behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
test/MeshWeaver.Query.Test/QueryParserTests.cs Adds coverage for the new bracket-list query syntax and its ordered Paths output.
test/MeshWeaver.Hosting.Monolith.Test/DeckLayoutAreaTest.cs Adds a regression test proving decks without a manifest still present child slides in Order.
src/MeshWeaver.Mesh.Contract/Query/QueryParser.cs Implements whole-query bracket-list parsing that maps to ParsedQuery.Paths.
src/MeshWeaver.Graph/DeckLayoutAreas.cs Implements default slide discovery via subtree query when the deck has no explicit manifest.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +32 to +33
if (TryParseBracketPathList(query, out var listPaths))
return ParsedQuery.Empty with { Paths = listPaths, Path = listPaths[0] };
@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

888 tests  ±0   879 ✅ ±0   4m 26s ⏱️ +2s
  4 suites ±0     9 💤 ±0 
  4 files   ±0     0 ❌ ±0 

Results for commit 544b963. ± Comparison against base commit d603a4d.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

1 248 tests  ±0   1 145 ✅ ±0   4m 58s ⏱️ -1s
   11 suites ±0     103 💤 ±0 
   11 files   ±0       0 ❌ ±0 

Results for commit 544b963. ± Comparison against base commit d603a4d.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

1 649 tests  +2   1 647 ✅ +2   5m 42s ⏱️ +19s
   12 suites ±0       2 💤 ±0 
   12 files   ±0       0 ❌ ±0 

Results for commit 544b963. ± Comparison against base commit d603a4d.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

 12 files  ±0   12 suites  ±0   4m 2s ⏱️ +33s
873 tests ±0  873 ✅ ±0  0 💤 ±0  0 ❌ ±0 
921 runs  ±0  921 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 544b963. ± Comparison against base commit d603a4d.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

813 tests  +317   626 ✅ +316   4m 36s ⏱️ + 3m 21s
 10 suites +  1   187 💤 +  1 
 10 files   +  1     0 ❌ ±  0 

Results for commit 544b963. ± Comparison against base commit d603a4d.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

1 238 tests  ±0   1 237 ✅ ±0   4m 53s ⏱️ -23s
   13 suites ±0       1 💤 ±0 
   13 files   ±0       0 ❌ ±0 

Results for commit 544b963. ± Comparison against base commit d603a4d.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

   62 files  +  1     62 suites  +1   28m 40s ⏱️ + 3m 51s
6 709 tests +319  6 407 ✅ +318  302 💤 +1  0 ❌ ±0 
6 757 runs  +319  6 455 ✅ +318  302 💤 +1  0 ❌ ±0 

Results for commit 544b963. ± Comparison against base commit d603a4d.

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