profiler scan: check/uncheck-all toggle for the ignore-contents list

Adds an 'All' header checkbox next to 'Ignore contents of files:' that
checks or unchecks every file; it reflects the list state (checked only
when all are checked, indeterminate on a mixed selection) and updates on
individual checkbox changes. RU label: 'Все'. Docs synced, tests for the
toggle/state helpers. SW cache v77 -> v78.
This commit is contained in:
2026-09-11 21:52:57 +03:00
parent 88f67f5e13
commit 36281e02fd
5 changed files with 60 additions and 6 deletions
+33 -1
View File
@@ -21,7 +21,7 @@ function extractFunc(src, name, asyncFn) {
return (asyncFn ? 'async ' : '') + src.slice(m.index, i + 1);
}
const FNS = ['profilerNormHex', 'profilerNormHexStrict', 'profilerMatch', 'profilerMatchMin', 'profilerMaskPrefix4', 'profilerFileFields', 'profilerContentKindForFileType', 'profilerEmptyRecordContent', 'profilerValidateProfile', 'profilerCustomNameForPath', 'profilerUpdateRulePath', 'profilerResultAspects', 'profilerAspectSummary', 'profilerNumRanges', 'esc', 'escHtml', 'profilerRawDataCheck', 'profilerRenderReport', 'parseBerLen', 'parseTlvList', 'fcpInt', 'fcpParseTlvs', 'fcpFileDescriptor', 'fcpLifeCycle', 'fcpSfi', 'fcpDo', 'fcpDecode', 'fcpDiffHtml', 'profilerFciPreviewItems', 'profilerUpdateFciPreview', 'profilerUpdateRule', 'profilerFciInput'];
const FNS = ['profilerNormHex', 'profilerNormHexStrict', 'profilerMatch', 'profilerMatchMin', 'profilerMaskPrefix4', 'profilerFileFields', 'profilerContentKindForFileType', 'profilerEmptyRecordContent', 'profilerValidateProfile', 'profilerCustomNameForPath', 'profilerUpdateRulePath', 'profilerResultAspects', 'profilerAspectSummary', 'profilerNumRanges', 'esc', 'escHtml', 'profilerRawDataCheck', 'profilerRenderReport', 'parseBerLen', 'parseTlvList', 'fcpInt', 'fcpParseTlvs', 'fcpFileDescriptor', 'fcpLifeCycle', 'fcpSfi', 'fcpDo', 'fcpDecode', 'fcpDiffHtml', 'profilerFciPreviewItems', 'profilerUpdateFciPreview', 'profilerUpdateRule', 'profilerFciInput', 'profilerScanToggleAll', 'profilerScanIgnoreAllState'];
let code = '';
for (const f of FNS) code += extractFunc(html, f) + '\n';
code += extractFunc(html, 'profilerBuildFileRule', true) + '\n';
@@ -787,3 +787,35 @@ test('fcpDiffHtml appends decode-failure notes for corrupt sides', () => {
assert.strictEqual(fcpDiffHtml('', ''), '');
delete global.t;
});
test('profilerScanToggleAll / profilerScanIgnoreAllState manage the ignore checkboxes', () => {
const boxes = [{ checked: true }, { checked: false }, { checked: true }];
const header = { checked: false, indeterminate: false };
global.document = {
querySelectorAll: sel => (sel === '#profiler-scan-ignore input[data-ignore-fid]' ? boxes : []),
getElementById: id => (id === 'profiler-scan-ignore-all' ? header : null),
};
profilerScanIgnoreAllState();
assert.strictEqual(header.checked, false);
assert.strictEqual(header.indeterminate, true);
boxes[1].checked = true;
profilerScanIgnoreAllState();
assert.strictEqual(header.checked, true);
assert.strictEqual(header.indeterminate, false);
profilerScanToggleAll(false);
assert.ok(boxes.every(b => !b.checked));
profilerScanIgnoreAllState();
assert.strictEqual(header.checked, false);
assert.strictEqual(header.indeterminate, false);
profilerScanToggleAll(true);
assert.ok(boxes.every(b => b.checked));
profilerScanIgnoreAllState();
assert.strictEqual(header.checked, true);
assert.strictEqual(header.indeterminate, false);
delete global.document;
});