fix: align texthooker and stats formatting with CI expectations

This commit is contained in:
2026-03-18 19:01:29 -07:00
parent ec56970646
commit f4cce31d4a
11 changed files with 225 additions and 46 deletions

View File

@@ -146,15 +146,18 @@ test('extractSessionEventNoteInfo ignores malformed notes without a numeric note
});
test('mergeSessionEventNoteInfos keys previews by both requested and returned note ids', () => {
const noteInfos = mergeSessionEventNoteInfos([111], [
{
noteId: 222,
fields: {
Expression: { value: '呪い' },
Sentence: { value: 'この剣は呪いだ' },
const noteInfos = mergeSessionEventNoteInfos(
[111],
[
{
noteId: 222,
fields: {
Expression: { value: '呪い' },
Sentence: { value: 'この剣は呪いだ' },
},
},
},
]);
],
);
assert.deepEqual(noteInfos.get(111), {
noteId: 222,

View File

@@ -237,17 +237,16 @@ export function collectPendingSessionEventNoteIds(
return next;
}
export function getSessionEventCardRequest(
marker: SessionChartMarker | null,
): { noteIds: number[]; requestKey: string | null } {
export function getSessionEventCardRequest(marker: SessionChartMarker | null): {
noteIds: number[];
requestKey: string | null;
} {
if (!marker || marker.kind !== 'card' || marker.noteIds.length === 0) {
return { noteIds: [], requestKey: null };
}
const noteIds = Array.from(
new Set(
marker.noteIds.filter((noteId) => Number.isInteger(noteId) && noteId > 0),
),
new Set(marker.noteIds.filter((noteId) => Number.isInteger(noteId) && noteId > 0)),
);
return {