forked from flow/vue3js-app-proposal-for-sdk-claude
Show full score top-level in SubObjects: info, tuning, articles, stage, instruments, bars
This commit is contained in:
parent
4afabea837
commit
839ea3f95c
@ -13,10 +13,20 @@ export const PaneSubObjects = {
|
||||
function subItems(node) {
|
||||
if (!node) return [];
|
||||
if (node.type === 'score') {
|
||||
return [
|
||||
...node.instruments.map(i => ({ kind: 'instrument', node: i, label: i.name })),
|
||||
...node.bars.map(b => ({ kind: 'bar', node: b, label: b.id })),
|
||||
];
|
||||
const items = [];
|
||||
if (node.info)
|
||||
items.push({ kind: 'info', node: node.info, label: node.info.title ?? '(no title)', hasChildren: false });
|
||||
if (node.tuning)
|
||||
items.push({ kind: 'tuning', node: node.tuning, label: `base ${node.tuning.base ?? '?'}`, hasChildren: false });
|
||||
for (const a of (node.articles ?? []))
|
||||
items.push({ kind: 'article', node: a, label: a.name, hasChildren: false });
|
||||
for (const sv of (node.stageVoices ?? []))
|
||||
items.push({ kind: 'stage', node: sv, label: sv.name, hasChildren: false });
|
||||
for (const i of node.instruments)
|
||||
items.push({ kind: 'instrument', node: i, label: i.name, hasChildren: true });
|
||||
for (const b of node.bars)
|
||||
items.push({ kind: 'bar', node: b, label: b.id, hasChildren: false });
|
||||
return items;
|
||||
}
|
||||
if (node.type === 'instrument') {
|
||||
return node.variations.map((v, idx) => ({
|
||||
@ -56,7 +66,7 @@ export const PaneSubObjects = {
|
||||
label: item.label,
|
||||
typeTag: item.kind,
|
||||
focused: props.store.focusPath.includes(item.node),
|
||||
hasChildren: item.kind !== 'bar' && item.kind !== 'voice',
|
||||
hasChildren: item.hasChildren ?? (item.kind !== 'bar' && item.kind !== 'voice'),
|
||||
onFocus: () => props.store.pushFocus(item.node),
|
||||
onDrillDown: () => props.store.pushFocus(item.node),
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user