The Sources view — a catalog grouped by folder, not a namespace tree
/{plugin}/Sources (Store/Plugin/Source/PluginSourcesArea.cs) lists every Code node a package
ships. It used to query those nodes in the area, fold them into a folder tree by path segment and
emit the tree as hand-built <details> HTML through Controls.Html — structured data as markup,
which the platform forbids. It is now a MeshSearchControl over ONE declared, live query:
namespace:{plugin} scope:descendants nodeType:Code limit:2000 select:path,id,namespace,name,description,nodeType,icon,order
rendered Grouped by namespace — one collapsible section per folder (a NodeType's Source/ or
Test/ pool, the partition-shared pool, …) with its file count, each file a card that opens its
Code node. The area itself reads only the package node, for the heading, the gating note and the
chrome language.
Why not MeshSearchRenderMode.NamespaceTree
It reads as the obvious fit ("sub-namespaces render as nested collapsible sections with counts"),
and it renders nothing here. The tree loads lazily: each level is namespace:{level} with the
hidden query's other filters — nodeType:Code included — and a child becomes a folder only if it
is a NODE matching that filter with children of its own. A package's code lives under pure path
segments — {pkg}/{Type}/Source/{File}, with no node at {Type}/Source — so the root level of
the tree is empty.
Measured on memex.meshweaver.cloud, on the Approvals package:
| Query | What it stands for | Count |
|---|---|---|
namespace:Approvals nodeType:Code |
the tree's root level | 0 |
namespace:Approvals/Desk |
the children of a NodeType, unfiltered | 0 |
namespace:Approvals scope:descendants nodeType:Code |
the query this view runs | 11 |
DataModelling/DataModelExplorer met the same limit from the other side (its type filter excluded
the plugin roots that should have been folders). The tree's typed-text mode does build folders from
path segments, but reaching it by pre-filling the search box would be a workaround, not a use.
What the grouped catalog does not carry over
- Nesting. A folder is one section labelled by its full path (
Approvals/Desk/Source), not a node in a nested tree. The label order still reads as the tree read. - The NodeType chip. The old tree put a "NodeType ↗" link on each type's folder; a section header is not a link. The type is one segment up from the section's label and one click up from any file's page.
- The total file count in the intro; each section carries its own count.
- The empty wording. A package with no visible source gets the platform's own localized empty message. A gated package carries its note — a purchased package's source files become visible after enrollment — above the catalog whether or not the viewer has enrolled, because the area no longer runs its own query to know the list is empty.
If the nested tree matters, the fix belongs in the platform: a NamespaceTree that folds pure
namespace segments the way the graph navigator already does ("skipping empty namespace hops"), not
another tree built in a package.