Authoring: pick any scene again, and select the first scene on load

Restores the scene picker and its selection on load, after a delete and
after an import, so PLAY and NEXT work after a reload. Open in GEV
selecting a shot and NEW SCENE stay as they are.
This commit is contained in:
Sameh Khamis committed 2026-11-16 13:30:22 -08:00
1 parent 1cb3e88027
commit 0a39b05cdb
30 files changed
+301 -210

No files matched your search

+5
View File
@@ -136,6 +136,7 @@
"src/ui/views/ProviderSettingsView.vue",
"src/ui/views/SceneChromeView.vue",
"src/ui/views/WelcomeView.vue",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/ui/stores/scenes.js",
"src/ui/scenePresentation.js",
@@ -1225,6 +1226,7 @@
"src/ui/sceneControls.js",
"src/ui/scenePresentation.js",
"src/ui/stores/scenes.js",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/i18n/index.js",
"src/i18n/locale.js",
@@ -1428,6 +1430,7 @@
"src/ui/sceneControls.js",
"src/ui/scenePresentation.js",
"src/ui/stores/scenes.js",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/ui/scenes.js",
"src/ui/shareFollow.js",
@@ -1727,6 +1730,7 @@
"src/ui/sceneControls.js",
"src/ui/scenePresentation.js",
"src/ui/stores/scenes.js",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/contextModePolicy.js",
"src/director/clock.js",
@@ -4696,6 +4700,7 @@
"src/ui/sceneControls.js",
"src/ui/scenePresentation.js",
"src/ui/stores/scenes.js",
"src/ui/views/SceneOptions.vue",
"src/ui/views/SceneShotList.vue",
"src/ui/scenes.js",
"src/ui/shareFollow.js",
+67 -19
View File
@@ -36,6 +36,7 @@ try {
);
const inventory = await page.evaluate(() => {
const selects = [
'scene-select',
'cctv-camera-select',
'hud-layout-select',
'radio-filter',
@@ -44,7 +45,7 @@ try {
return {
ids: selects.map((node) => node.id),
shared:
selects.length === 4 &&
selects.length === 5 &&
selects.every((node) => node.classList.contains('gev-field')),
native: selects.every(
(node) =>
@@ -56,7 +57,7 @@ try {
};
});
check(
'all four panel dropdowns retain native select semantics and shared surface',
'all five panel dropdowns retain native select semantics and shared surface',
inventory.shared && inventory.native,
inventory,
);
@@ -75,6 +76,12 @@ try {
persist: false,
syncShare: false,
});
window.__qaFormChanges = [];
document
.getElementById('scene-select')
.addEventListener('change', (event) =>
window.__qaFormChanges.push(event.target.value),
);
});
const ownerSetup = await page.evaluate(() => {
const owner = window.__godsEyeView.styleManager._cctvControls;
@@ -169,7 +176,7 @@ try {
window.__qaFormCalls = [];
document.getElementById('cctv-camera-select').disabled = true;
});
await page.focus('#hud-layout-select');
await page.focus('#scene-select');
await page.focus('#cctv-camera-select');
check(
'disabled native selects cannot receive keyboard focus',
@@ -281,7 +288,7 @@ try {
for (const width of [1440, 620, 390]) {
await page.setViewport({ width, height: 900 });
const layout = await page.evaluate(() => {
const ids = ['cctv-camera-select', 'hud-layout-select'];
const ids = ['scene-select', 'cctv-camera-select', 'hud-layout-select'];
return ids.map((id) => {
const node = document.getElementById(id),
rect = node.getBoundingClientRect(),
@@ -310,7 +317,7 @@ try {
document.documentElement.dataset.uiTheme = 'cyber';
});
const cyber = await page.$eval(
'#cctv-camera-select',
'#scene-select',
(node) => getComputedStyle(node).backgroundColor,
);
check(
@@ -333,23 +340,62 @@ try {
window.__qaFormCalls.length === 2,
),
);
// Authoring has no scene picker: NEW SCENE selects the scene it creates and
// the panel names it. Exercise it after the fixture-owned CCTV phase.
// Scene selection can restore application settings. Exercise it after the
// fixture-owned CCTV phase so those asynchronous effects cannot replace ports.
page.once('dialog', (dialog) => dialog.accept('Baseline selection fixture'));
await page.click('#scene-new-btn');
await page.waitForFunction(() =>
[...document.querySelectorAll('#scene-select option')].some(
(option) => option.textContent === 'Baseline selection fixture',
),
);
page.once('dialog', (dialog) => dialog.accept('QA selection fixture'));
await page.click('#scene-new-btn');
await page.waitForFunction(
() =>
document.getElementById('scene-name')?.textContent ===
'QA selection fixture',
() => document.querySelectorAll('#scene-select option').length > 1,
);
const targetSceneId = await page.$eval(
'#scene-select',
(node) =>
[...node.options].find(
(option) => option.textContent === 'QA selection fixture',
).value,
);
const baselineSceneId = await page.$eval(
'#scene-select',
(node) =>
[...node.options].find(
(option) => option.textContent === 'Baseline selection fixture',
).value,
);
await page.select('#scene-select', baselineSceneId);
await page.waitForFunction(
(id) => window.__godsEyeView.sceneDirector._getSelectedScene().id !== id,
{},
targetSceneId,
);
await page.evaluate(() => {
window.__qaFormChanges = [];
});
await page.focus('#scene-select');
// Typeahead is native even when headless Chrome does not drive OS popups.
await page.keyboard.press('q');
const sceneSelection = await page.evaluate(() => ({
id: document.getElementById('scene-select').value,
selected: window.__godsEyeView.sceneDirector._getSelectedScene().id,
changes: window.__qaFormChanges,
focus: document.activeElement.id,
outline: getComputedStyle(document.activeElement).outlineStyle,
}));
check(
'NEW SCENE selects and names the new scene',
await page.evaluate(
() =>
window.__godsEyeView.sceneDirector._getSelectedScene().title ===
'QA selection fixture' && !document.getElementById('scene-select'),
),
'native typeahead reaches the Scene owner and keeps focus',
sceneSelection.id === targetSceneId &&
sceneSelection.selected === targetSceneId &&
sceneSelection.changes.at(-1) === targetSceneId &&
sceneSelection.focus === 'scene-select',
sceneSelection,
);
check('keyboard focus remains visible', sceneSelection.outline === 'solid');
const localized = new URL(page.url());
localized.searchParams.set('lang', 'ru');
await page.goto(localized.href, { waitUntil: 'domcontentloaded' });
@@ -374,9 +420,11 @@ try {
});
});
const translated = await page.evaluate(() => {
const nodes = ['cctv-camera-select', 'hud-layout-select'].map((id) =>
document.getElementById(id),
);
const nodes = [
'scene-select',
'cctv-camera-select',
'hud-layout-select',
].map((id) => document.getElementById(id));
return (
document.documentElement.lang === 'ru' &&
nodes.every(
+7 -6
View File
@@ -48,7 +48,9 @@ try {
await page.click('[data-rail-item="scene-panel"]');
await page.click('#scene-new-btn');
await page.waitForFunction(
() => document.querySelector('#scene-name')?.textContent === 'QA Scene',
() =>
document.querySelector('#scene-select option:checked')?.textContent ===
'QA Scene',
);
check(
'New creates and selects a persisted empty scene',
@@ -366,7 +368,7 @@ try {
await page.screenshot({ path: path.join(shots, 'narrow.png') });
check(
'Scene controls stay inside the narrow viewport',
await page.$eval('#scene-name', (element) => {
await page.$eval('#scene-select', (element) => {
const rect = element.getBoundingClientRect();
return rect.width > 0 && rect.left >= 0 && rect.right <= innerWidth;
}),
@@ -389,15 +391,14 @@ try {
() =>
!window.__godsEyeView.sceneDirector._project.scenes.some(
(item) => item.title === 'QA Scene',
) && document.querySelector('#scene-name.scene-name-empty'),
),
);
check(
'Deleting the final scene restores the built-in recipes and clears Authoring',
'Deleting the final scene restores the built-in recipes',
await page.evaluate(
() =>
window.__godsEyeView.sceneDirector._project.scenes.length > 0 &&
window.__godsEyeView.sceneDirector._getSelectedScene() === null &&
document.querySelector('#scene-name.scene-name-empty') !== null,
document.querySelectorAll('#scene-select option').length > 0,
),
);
check(
+1 -1
View File
@@ -96,7 +96,7 @@ try {
() =>
!document.body.classList.contains('stories-mode') &&
document
.querySelector('#scene-name')
.querySelector('#scene-select option:checked')
?.textContent.includes('Global Flights Radar'),
);
const after = await pose();