feat: consolidate legacy parity migration baseline

This commit is contained in:
2026-07-20 22:06:12 +09:00
parent 5eb4054120
commit 4a54977341
66 changed files with 5391 additions and 460 deletions

View File

@@ -77,20 +77,20 @@ test("cut focus is roving and scrolls only for keyboard navigation", () => {
assert.equal(rows[1].scrollCount, 1);
});
test("cut key intent preserves Home End bubbling and honors the mutation gate", () => {
test("cut key intent preserves Home End bubbling and stable PROGRAM selection", () => {
const start = app.indexOf("function createCutElement");
const end = app.indexOf("function renderCuts", start);
const factory = app.slice(start, end);
assert.match(factory, /element\.addEventListener\("keydown"/);
assert.match(factory, /event\.preventDefault\(\)/);
assert.match(factory, /if \(playlistMutationLocked\) return/);
assert.match(factory, /if \(!cutSelectionEnabled\) return/);
assert.match(factory, /send\("cut-key-down", \{/);
assert.match(factory, /control: event\.ctrlKey/);
assert.match(factory, /shift: event\.shiftKey/);
assert.doesNotMatch(factory, /stopPropagation/);
assert.match(nativeWindow, /LegacyCutKeyDownIntent key => _controller\.CutKeyDown/);
assert.match(nativePlayout, /LegacyCutKeyDownIntent or/);
assert.doesNotMatch(nativePlayout, /LegacyCutKeyDownIntent or/);
});
test("rendered cut rows expose authoritative focus without replacing DOM rows", () => {

View File

@@ -35,7 +35,10 @@ test("UC4 renders original headings and action order in the Web vertical workspa
assert.doesNotMatch(app, /theme-nxt-session/u);
});
test("UC4 selection is immediate and selection receipts preserve the result DOM", () => {
test("UC4 defers a single click for double-click activation and preserves the result DOM", () => {
const doubleClick = section(
"categoryTree.addEventListener(\"dblclick\"",
"categoryTree.addEventListener(\"click\"");
const click = section(
"categoryTree.addEventListener(\"click\"",
"categoryTree.addEventListener(\"change\"");
@@ -50,8 +53,9 @@ test("UC4 selection is immediate and selection receipts preserve the result DOM"
const updater = section("function updateThemeWorkspace(workspace, theme)", "function renderTheme(state)");
assert.match(themeClick,
/send\("select-theme", \{ resultId: themeResult\.dataset\.themeResultId \}\)/u);
assert.doesNotMatch(themeClick, /setTimeout|themeResultClickTimer/u);
/clearDelayedClick\(themeResultClickTimer\);[\s\S]*const resultId = themeResult\.dataset\.themeResultId;[\s\S]*themeResultClickTimer = window\.setTimeout\(function \(\) \{[\s\S]*themeResultClickTimer = null;[\s\S]*send\("select-theme", \{ resultId: resultId \}\);[\s\S]*\}, 250\);/u);
assert.match(doubleClick,
/clearDelayedClick\(themeResultClickTimer\);[\s\S]*themeResultClickTimer = null;[\s\S]*send\("activate-theme-result", \{/u);
assert.match(render,
/existingWorkspace && structureKey === themeRenderStructureKey[\s\S]*updateThemeWorkspace\(existingWorkspace, theme\);[\s\S]*return;/u);
assert.doesNotMatch(updater, /categoryTree\.replaceChildren|results\.replaceChildren/u);

View File

@@ -0,0 +1,28 @@
const test = require("node:test");
const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const source = fs.readFileSync(path.join(
__dirname,
"..",
"..",
"src",
"MBN_STOCK_WEBVIEW.LegacyParityApp",
"MainWindow.Playout.cs"), "utf8");
test("first PREPARE and TAKE IN freeze fresh PageN plans for every paged row", () => {
assert.ok((source.match(/CreateFreshPagedPlayoutRequestAsync\(/g) || []).length >= 3);
assert.match(source,
/Where\(static entry => entry\.PageNavigation\?\.PageSize\.HasValue == true\)/u);
assert.match(source, /PreflightPagePlansAsync\(/u);
assert.match(source,
/ReflectSuccessfulPlayout\([\s\S]*plan\.EntryId,[\s\S]*pageIndexZeroBased: 0,[\s\S]*plan\.PageCount,[\s\S]*synchronizeOperatorSelection: false\)/u);
});
test("fresh PageN wiring rejects empty or mismatched plans before vendor dispatch", () => {
assert.match(source, /plans\.Count != pagedEntries\.Length/u);
assert.match(source, /plan\.PageSize != \(int\)expectedPageSize/u);
assert.match(source, /plan\.PageCount is < 1 or > ScenePaging\.MaximumPageCount/u);
assert.match(source, /workflow\.State\.CurrentEntryId is not null/u);
});