Add sub-tabs to records sections (Refs #18)

Records sections can be split into user-named sub-tabs with a General
catch-all. Records and visual sequences move between tabs via a Sub-tab
drop-down; up/down, collapse all and print work per tab.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-21 19:32:05 -05:00
parent 37bdb62baf
commit d7dc098e79
9 changed files with 411 additions and 24 deletions

View File

@@ -127,3 +127,36 @@ test('countSecrets counts secret frames in all places and ignores sequences as r
rs.records[1].frames[0].secret = true; st.items[1].frames[1].secret = true; tx.sequences[0].frames[0].secret = true;
assert.equal(countSecrets(d), 3);
});
test('sub-tabs: valid shapes pass, bad ones are reported', () => {
const withTabs = () => {
const d = good();
const s = d.sections[1];
s.subsections = [{ id: 'sub1', title: 'Online' }];
s.generalTitle = 'Everyday';
s.records[0].subsection = 'sub1';
return d;
};
assert.deepEqual(validate(withTabs()), []);
let d = withTabs(); d.sections[1].records[0].subsection = 'nope';
assert.match(validate(d).join('\n'), /not one of this section's sub-tabs/);
d = withTabs(); d.sections[1].subsections[0].title = ' ';
assert.match(validate(d).join('\n'), /missing title/);
d = withTabs(); d.sections[1].subsections.push({ id: 'sub1', title: 'Dup' });
assert.match(validate(d).join('\n'), /duplicate id "sub1"/);
d = withTabs(); d.sections[1].subsections = {};
assert.match(validate(d).join('\n'), /subsections must be an array/);
d = withTabs(); d.sections[1].generalTitle = '';
assert.match(validate(d).join('\n'), /generalTitle/);
d = good(); d.sections[2].subsections = [];
assert.match(validate(d).join('\n'), /only records sections can have sub-tabs/);
d = good(); d.sections[1].records[0].subsection = 'x';
assert.match(validate(d).join('\n'), /not one of this section's sub-tabs/);
});