Articles: key by label across subtypes, scope per property, FO toggle widget

A single article label (e.g. 'f') may emit on multiple `articles.<subtype>`
lines — `defaults` today, `overwrites` planned — with disjoint property
sets that apply at different stages. Model now merges those emissions:

  { name: 'f', properties: [{ name, value, scope: 'defaults'|'overwrites' }] }

Per-label entries in the AR pane show a property-count breakdown
(`f (1 defaults, 2 overwrites)`). The Article FO pane lists each property
with a `(O-) default` / `(-O) overwrite` toggle — click flips the scope
and marks the score dirty. ASCII glyph mimics a physical switch position
so the active scope is visible at a glance.

Fixture tests cover both the existing single-subtype shape and a synthetic
two-subtype merge (177 assertions total).
This commit is contained in:
c0dev0id
2026-06-28 19:11:01 +02:00
parent 913114bb02
commit 133117922a
4 changed files with 66 additions and 15 deletions

View File

@@ -43,9 +43,13 @@ export function getKindGroups(node) {
}
if ((node.articles ?? []).length) {
groups.push({ kind: 'articles', items: node.articles.map(a => ({
kind: 'articles', node: a, label: `${a.subtype}: ${a.name}`, hasChildren: false,
}))});
groups.push({ kind: 'articles', items: node.articles.map(a => {
const counts = a.properties.reduce((acc, p) => {
acc[p.scope] = (acc[p.scope] ?? 0) + 1; return acc;
}, {});
const suffix = Object.entries(counts).map(([s, n]) => `${n} ${s}`).join(', ');
return { kind: 'articles', node: a, label: `${a.name} (${suffix})`, hasChildren: false };
})});
}
if (node.bars.length) {