diff --git a/changelog.d/1724-stories.md b/changelog.d/1724-stories.md index 0d02d5d1b..f02c33761 100644 --- a/changelog.d/1724-stories.md +++ b/changelog.d/1724-stories.md @@ -3,6 +3,6 @@ from AUTHORING, or drafts) with a pin each and an idle tour between them; a story plays with chapters, key moments and its data sources, and Close puts the person's view, clock and layers back. Play after a pause, a seek or a - paused story link goes on from that exact moment. AUTHORING starts - with no scene and gains THUMBNAIL, topic tags and SAVE TO STORIES + paused story link goes on from that exact moment. AUTHORING gains + THUMBNAIL, topic tags and SAVE TO STORIES (Manjunath, @manjunath22466; Kevin Rajan, @kvnloo; #1724). diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index 2b0b68143..00a8f0d28 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -723,7 +723,7 @@ DATA_SOURCES.md lists for it. The Nepal story carries the event pack's own facts and sources (Vantor imagery and the GeoPera reconstruction, CC BY-NC 4.0), and its key moments are the chapters that show them. Topic chips and region choices are the ones the listed stories carry. Closing Stories after -a story played puts AUTHORING's own selection back (usually none); +a story played puts AUTHORING's own selection back; Open in GEV leaves the story's scene selected there. Entering Stories cancels in-flight Authoring work before it captures the view it will restore. Dragging the timeline previews the time, and releasing @@ -2294,22 +2294,19 @@ native double-click rename. Replacing rows revokes their old listeners. Disposal late file and failed-action completions cannot update removed presentation. The panel is titled Authoring and is laid out in four labelled steps: SCENE -(the name of the scene being edited, read-only on its own row, or "No scene -yet"; then NEW SCENE and DELETE), SHOTS (+ CAPTURE SHOT, UPDATE SHOT, the -numbered shot list and a select/rename hint), PREVIEW (PLAY, STOP, NEXT) and -SAVE & SHARE (a row of Stories tag chips; the thumbnail preview, CAPTURE -THUMBNAIL and SAVE TO STORIES on one row; then EXPORT, IMPORT, RUN LOG, then -the EDIT DETAILS / SHARE SCENE row). There is no scene picker, and on load no -scene is selected: the panel reads "No scene yet" with an empty shot list. The -built-in scenes stay in the project, where Stories plays them, but are never -selected on their own. A scene becomes current through NEW SCENE, through -CAPTURE SHOT with no scene (which asks for a name as NEW SCENE does, creates -the scene and captures into it; the director's `captureShot()` names it -"Scene N" itself), or when it is selected elsewhere (Stories' "Open in GEV" -calls `SceneDirector.selectShot`), and the name follows that selection. -Deleting the current scene goes back to no scene. An IMPORT keeps the scene -being edited when the file still has it, else selects the file's first scene -that is not a built-in one, else none. Playback still moves the selection to +(picker on its own row listing every scene in the project, NEW SCENE, DELETE), +SHOTS (+ CAPTURE SHOT, UPDATE SHOT, the numbered shot list and a select/rename +hint), PREVIEW (PLAY, STOP, NEXT) and SAVE & SHARE (a row of Stories tag chips; +the thumbnail preview, CAPTURE THUMBNAIL and SAVE TO STORIES on one row; then +EXPORT, IMPORT, RUN LOG, then the EDIT DETAILS / SHARE SCENE row). On load the +project's first scene and its first shot are selected, and deleting the +selected scene selects the first scene again. Stories' "Open in GEV" selects a +scene and shot through `SceneDirector.selectShot`, and the picker follows. +With no scene at all (an imported empty project), CAPTURE SHOT asks for a name +as NEW SCENE does, creates the scene and captures into it; the director's +`captureShot()` names it "Scene N" itself. An IMPORT keeps the scene being +edited when the file still has it, else selects the file's first scene that is +not a built-in one, else its first scene. Playback still moves the selection to the shot it plays, as before. SAVE TO STORIES marks the scene as published to the Stories page and then reads REMOVE FROM STORIES, which clears the mark; the status line confirms either. diff --git a/docs/VUE-MIGRATION.md b/docs/VUE-MIGRATION.md index 560b12251..91a9d4228 100644 --- a/docs/VUE-MIGRATION.md +++ b/docs/VUE-MIGRATION.md @@ -155,7 +155,7 @@ a feature supplying only its accent. keep their imperative entry points until their owners are components: the rail cards and card blocks (`src/ui/rail/`) render through Vue's synchronous `render()` behind `createRailCards()` and - `createRailCardBlocks()`. Order: Scenes (done: the scene name and + `createRailCardBlocks()`. Order: Scenes (done: `SceneOptions` and `SceneShotList` over the `gev-scenes` store; the panel's buttons, status line, progress bar and the runtime chip render the panel SceneControls presents there, and the buttons and file chooser call its actions), Weather (done: the owner diff --git a/scripts/package-boundaries.json b/scripts/package-boundaries.json index 6ab88cfb8..e882b9977 100644 --- a/scripts/package-boundaries.json +++ b/scripts/package-boundaries.json @@ -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", diff --git a/scripts/qa-form-fields.mjs b/scripts/qa-form-fields.mjs index a65f81187..c2d3af6e5 100644 --- a/scripts/qa-form-fields.mjs +++ b/scripts/qa-form-fields.mjs @@ -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( diff --git a/scripts/qa-scene-controls.mjs b/scripts/qa-scene-controls.mjs index fc9bf1606..7247123d5 100644 --- a/scripts/qa-scene-controls.mjs +++ b/scripts/qa-scene-controls.mjs @@ -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( diff --git a/scripts/qa-stories.mjs b/scripts/qa-stories.mjs index bc62ea2c1..25e900405 100644 --- a/scripts/qa-stories.mjs +++ b/scripts/qa-stories.mjs @@ -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(); diff --git a/src/i18n/locales/ar.json b/src/i18n/locales/ar.json index 5c205a2d5..9962df76a 100644 --- a/src/i18n/locales/ar.json +++ b/src/i18n/locales/ar.json @@ -3392,6 +3392,7 @@ "scene|PLAY": "تشغيل", "Create and edit scenes": "إنشاء المشاهد وتعديلها", "SCENE": "المشهد", + "Scene": "المشهد", "Start a new, empty scene": "بدء مشهد جديد فارغ", "NEW SCENE": "مشهد جديد", "Delete this scene and all of its shots": "حذف هذا المشهد وكل لقطاته", @@ -4104,8 +4105,6 @@ "Stories could not load. Check the connection and try again.": "تعذّر تحميل القصص. تحقّق من الاتصال ثم حاول مرة أخرى.", "Shot {n} of {total}": "لقطة {n} من {total}", "GEV scene": "مشهد GEV", - "Empty drafts": "المسودات الفارغة", - "No scene yet": "لا يوجد مشهد بعد", "SAVE TO STORIES": "حفظ في STORIES", "REMOVE FROM STORIES": "إزالة من STORIES", "Show this scene on the Stories page": "عرض هذا المشهد في صفحة Stories", diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index 9494cf7a5..0d448ad69 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -3100,6 +3100,7 @@ "AUTHORING": "SZENEN", "Create and edit scenes": "Szenen erstellen und bearbeiten", "SCENE": "SZENE", + "Scene": "Szene", "NEW SCENE": "NEUE SZENE", "Start a new, empty scene": "Neue, leere Szene beginnen", "DELETE": "LÖSCHEN", @@ -3744,8 +3745,6 @@ "Stories could not load. Check the connection and try again.": "Storys konnten nicht geladen werden. Prüfen Sie die Verbindung und versuchen Sie es erneut.", "Shot {n} of {total}": "Aufnahme {n} von {total}", "GEV scene": "GEV-Szene", - "Empty drafts": "Leere Entwürfe", - "No scene yet": "Noch keine Szene", "SAVE TO STORIES": "IN STORIES SPEICHERN", "REMOVE FROM STORIES": "AUS STORIES ENTFERNEN", "Show this scene on the Stories page": "Diese Szene auf der Stories-Seite zeigen", diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index 50fca21fd..7cc179c1b 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -3195,6 +3195,7 @@ "AUTHORING": "CREACIÓN", "Create and edit scenes": "Crea y edita escenas", "SCENE": "ESCENA", + "Scene": "Escena", "NEW SCENE": "NUEVA ESCENA", "Start a new, empty scene": "Empieza una escena nueva y vacía", "DELETE": "ELIMINAR", @@ -3834,8 +3835,6 @@ "Stories could not load. Check the connection and try again.": "No se pudieron cargar las Historias. Comprueba la conexión e inténtalo de nuevo.", "Shot {n} of {total}": "Plano {n} de {total}", "GEV scene": "Escena de GEV", - "Empty drafts": "Borradores vacíos", - "No scene yet": "Aún no hay escena", "SAVE TO STORIES": "GUARDAR EN STORIES", "REMOVE FROM STORIES": "QUITAR DE STORIES", "Show this scene on the Stories page": "Mostrar esta escena en la página Stories", diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index e40948f40..682d2a7a1 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -3175,6 +3175,7 @@ "AUTHORING": "CRÉATION", "Create and edit scenes": "Créer et modifier des scènes", "SCENE": "SCÈNE", + "Scene": "Scène", "NEW SCENE": "NOUVELLE SCÈNE", "Start a new, empty scene": "Commencer une nouvelle scène vide", "DELETE": "SUPPRIMER", @@ -3834,8 +3835,6 @@ "Stories could not load. Check the connection and try again.": "Impossible de charger les Récits. Vérifiez la connexion et réessayez.", "Shot {n} of {total}": "Plan {n} sur {total}", "GEV scene": "Scène GEV", - "Empty drafts": "Brouillons vides", - "No scene yet": "Aucune scène pour l'instant", "SAVE TO STORIES": "ENREGISTRER DANS STORIES", "REMOVE FROM STORIES": "RETIRER DE STORIES", "Show this scene on the Stories page": "Afficher cette scène sur la page Stories", diff --git a/src/i18n/locales/he.json b/src/i18n/locales/he.json index d8e338e82..41c2dd579 100644 --- a/src/i18n/locales/he.json +++ b/src/i18n/locales/he.json @@ -2335,6 +2335,7 @@ "Directions, drawing and your own files": "דרכי הגעה, שרטוט והקבצים שלך", "Create and edit scenes": "יצירה ועריכה של סצנות", "SCENE": "סצנה", + "Scene": "סצנה", "Start a new, empty scene": "התחלת סצנה חדשה וריקה", "NEW SCENE": "סצנה חדשה", "Delete this scene and all of its shots": "מחיקת סצנה זו וכל שוטיה", @@ -3834,8 +3835,6 @@ "Stories could not load. Check the connection and try again.": "לא ניתן לטעון את הסיפורים. בדוק את החיבור ונסה שוב.", "Shot {n} of {total}": "שוט {n} מתוך {total}", "GEV scene": "סצנת GEV", - "Empty drafts": "טיוטות ריקות", - "No scene yet": "עדיין אין סצנה", "SAVE TO STORIES": "שמירה ב-STORIES", "REMOVE FROM STORIES": "הסרה מ-STORIES", "Show this scene on the Stories page": "הצגת הסצנה בדף Stories", diff --git a/src/i18n/locales/it.json b/src/i18n/locales/it.json index 53030602a..a39d67c1f 100644 --- a/src/i18n/locales/it.json +++ b/src/i18n/locales/it.json @@ -3175,6 +3175,7 @@ "AUTHORING": "CREAZIONE", "Create and edit scenes": "Crea e modifica le scene", "SCENE": "SCENA", + "Scene": "Scena", "NEW SCENE": "NUOVA SCENA", "Start a new, empty scene": "Inizia una nuova scena vuota", "DELETE": "ELIMINA", @@ -3834,8 +3835,6 @@ "Stories could not load. Check the connection and try again.": "Impossibile caricare le Storie. Controlla la connessione e riprova.", "Shot {n} of {total}": "Scatto {n} di {total}", "GEV scene": "Scena GEV", - "Empty drafts": "Bozze vuote", - "No scene yet": "Ancora nessuna scena", "SAVE TO STORIES": "SALVA IN STORIES", "REMOVE FROM STORIES": "RIMUOVI DA STORIES", "Show this scene on the Stories page": "Mostra questa scena nella pagina Stories", diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index 6b3f24206..01b5e4137 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -3025,6 +3025,7 @@ "AUTHORING": "シーン作成", "Create and edit scenes": "シーンを作成・編集", "SCENE": "シーン", + "Scene": "シーン", "NEW SCENE": "新規シーン", "Start a new, empty scene": "空の新しいシーンを作成", "DELETE": "削除", @@ -3654,8 +3655,6 @@ "Stories could not load. Check the connection and try again.": "ストーリーを読み込めませんでした。接続を確認して、もう一度お試しください。", "Shot {n} of {total}": "ショット {n}/{total}", "GEV scene": "GEVシーン", - "Empty drafts": "空の下書き", - "No scene yet": "シーンはまだありません", "SAVE TO STORIES": "STORIESに保存", "REMOVE FROM STORIES": "STORIESから外す", "Show this scene on the Stories page": "このシーンをStoriesページに表示", diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json index b155e7699..7b42e2e90 100644 --- a/src/i18n/locales/pt.json +++ b/src/i18n/locales/pt.json @@ -3175,6 +3175,7 @@ "AUTHORING": "CRIAÇÃO", "Create and edit scenes": "Criar e editar cenas", "SCENE": "CENA", + "Scene": "Cena", "NEW SCENE": "NOVA CENA", "Start a new, empty scene": "Começar uma nova cena vazia", "DELETE": "EXCLUIR", @@ -3834,8 +3835,6 @@ "Stories could not load. Check the connection and try again.": "Não foi possível carregar as Histórias. Verifique a conexão e tente novamente.", "Shot {n} of {total}": "Plano {n} de {total}", "GEV scene": "Cena do GEV", - "Empty drafts": "Rascunhos vazios", - "No scene yet": "Nenhuma cena ainda", "SAVE TO STORIES": "SALVAR EM STORIES", "REMOVE FROM STORIES": "REMOVER DE STORIES", "Show this scene on the Stories page": "Mostrar esta cena na página Stories", diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index 2f699dfb7..8d2f14b5d 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -3270,6 +3270,7 @@ "AUTHORING": "РЕДАКТОР", "Create and edit scenes": "Создание и редактирование сцен", "SCENE": "СЦЕНА", + "Scene": "Сцена", "NEW SCENE": "НОВАЯ СЦЕНА", "Start a new, empty scene": "Создать новую пустую сцену", "DELETE": "УДАЛИТЬ", @@ -3924,8 +3925,6 @@ "Stories could not load. Check the connection and try again.": "Не удалось загрузить Истории. Проверьте подключение и повторите попытку.", "Shot {n} of {total}": "Кадр {n} из {total}", "GEV scene": "Сцена GEV", - "Empty drafts": "Пустые черновики", - "No scene yet": "Сцены пока нет", "SAVE TO STORIES": "СОХРАНИТЬ В STORIES", "REMOVE FROM STORIES": "УБРАТЬ ИЗ STORIES", "Show this scene on the Stories page": "Показать эту сцену на странице Stories", diff --git a/src/i18n/locales/sv.json b/src/i18n/locales/sv.json index e15bc2cc1..a15149989 100644 --- a/src/i18n/locales/sv.json +++ b/src/i18n/locales/sv.json @@ -3017,6 +3017,7 @@ "AUTHORING": "REDIGERING", "Create and edit scenes": "Skapa och redigera scener", "SCENE": "SCEN", + "Scene": "Scen", "NEW SCENE": "NY SCEN", "Start a new, empty scene": "Börja en ny, tom scen", "DELETE": "RADERA", @@ -3744,8 +3745,6 @@ "Stories could not load. Check the connection and try again.": "Berättelser kunde inte läsas in. Kontrollera anslutningen och försök igen.", "Shot {n} of {total}": "Tagning {n} av {total}", "GEV scene": "GEV-scen", - "Empty drafts": "Tomma utkast", - "No scene yet": "Ingen scen ännu", "SAVE TO STORIES": "SPARA I STORIES", "REMOVE FROM STORIES": "TA BORT FRÅN STORIES", "Show this scene on the Stories page": "Visa scenen på Stories-sidan", diff --git a/src/i18n/locales/uk.json b/src/i18n/locales/uk.json index 1047e7a84..14ced1242 100644 --- a/src/i18n/locales/uk.json +++ b/src/i18n/locales/uk.json @@ -3263,6 +3263,7 @@ "AUTHORING": "РЕДАКТОР", "Create and edit scenes": "Створення й редагування сцен", "SCENE": "СЦЕНА", + "Scene": "Сцена", "NEW SCENE": "НОВА СЦЕНА", "Start a new, empty scene": "Створити нову порожню сцену", "DELETE": "ВИДАЛИТИ", @@ -3924,8 +3925,6 @@ "Stories could not load. Check the connection and try again.": "Не вдалося завантажити Історії. Перевірте з’єднання та спробуйте ще раз.", "Shot {n} of {total}": "Кадр {n} з {total}", "GEV scene": "Сцена GEV", - "Empty drafts": "Порожні чернетки", - "No scene yet": "Сцени ще немає", "SAVE TO STORIES": "ЗБЕРЕГТИ В STORIES", "REMOVE FROM STORIES": "ПРИБРАТИ ЗІ STORIES", "Show this scene on the Stories page": "Показати цю сцену на сторінці Stories", diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index 2697e08fd..06c893fa2 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -3045,6 +3045,7 @@ "AUTHORING": "创作", "Create and edit scenes": "创建和编辑场景", "SCENE": "场景", + "Scene": "场景", "NEW SCENE": "新建场景", "Start a new, empty scene": "新建一个空场景", "DELETE": "删除", @@ -3654,8 +3655,6 @@ "Stories could not load. Check the connection and try again.": "无法加载故事。请检查网络连接后重试。", "Shot {n} of {total}": "镜头 {n}/{total}", "GEV scene": "GEV 场景", - "Empty drafts": "空草稿", - "No scene yet": "尚无场景", "SAVE TO STORIES": "保存到 STORIES", "REMOVE FROM STORIES": "从 STORIES 移除", "Show this scene on the Stories page": "在 Stories 页面显示此场景", diff --git a/src/i18n/locales/zh-Hant.json b/src/i18n/locales/zh-Hant.json index 333f3a2be..6808994c2 100644 --- a/src/i18n/locales/zh-Hant.json +++ b/src/i18n/locales/zh-Hant.json @@ -3032,6 +3032,7 @@ "AUTHORING": "創作", "Create and edit scenes": "創建和編輯場景", "SCENE": "場景", + "Scene": "場景", "NEW SCENE": "新建場景", "Start a new, empty scene": "新建一個空場景", "DELETE": "刪除", @@ -3654,8 +3655,6 @@ "Stories could not load. Check the connection and try again.": "無法載入故事。請檢查網路連線後重試。", "Shot {n} of {total}": "鏡頭 {n}/{total}", "GEV scene": "GEV 場景", - "Empty drafts": "空白草稿", - "No scene yet": "尚無場景", "SAVE TO STORIES": "儲存到 STORIES", "REMOVE FROM STORIES": "從 STORIES 移除", "Show this scene on the Stories page": "在 Stories 頁面顯示此場景", diff --git a/src/scenes/director.js b/src/scenes/director.js index 97c3b2ec4..c13fe55b1 100644 --- a/src/scenes/director.js +++ b/src/scenes/director.js @@ -189,10 +189,8 @@ export class SceneDirector { this._lastRunJson = ''; this._project = this._loadProject(); - // Authoring starts with no scene: the built-in scenes stay in the project - // (Stories plays them) but only NEW SCENE or selectShot makes one current. - this._selectedSceneId = null; - this._selectedShotId = null; + this._selectedSceneId = this._project.scenes[0]?.id || null; + this._selectedShotId = this._project.scenes[0]?.shots[0]?.id || null; /** @type {string|null} Scene whose layer state most recently landed. */ this._loadedSceneId = null; @@ -234,9 +232,6 @@ export class SceneDirector { } } } - // Upgrading a pack selects its scene; on load nothing is selected. - this._selectedSceneId = null; - this._selectedShotId = null; } this._initUI(); // A status the director wrote itself follows the language; one it was @@ -492,16 +487,12 @@ export class SceneDirector { }); } - /** - * Keep the selection on an existing scene, or on none, and present the - * scene's name. - */ + /** Rebuild the scene dropdown options and sync the selected value. */ _renderSceneSelect() { if ( !this._project.scenes.some((scene) => scene.id === this._selectedSceneId) ) { - this._selectedSceneId = null; - this._selectedShotId = null; + this._selectedSceneId = this._project.scenes[0]?.id || null; } this._publish({ type: 'scene-options-changed' }); } @@ -564,10 +555,7 @@ export class SceneDirector { this._publish({ type: 'scene-created', scene }); } - /** - * Delete the currently selected scene after user confirmation and select - * none. Resets to defaults if empty. - */ + /** Delete the currently selected scene after user confirmation. Resets to defaults if empty. */ _deleteSelectedScene() { const scene = this._getSelectedScene(); if (!scene) return; @@ -580,9 +568,8 @@ export class SceneDirector { this._project = createDefaultProject(); } - // Authoring goes back to no scene. - this._selectedSceneId = null; - this._selectedShotId = null; + this._selectedSceneId = this._project.scenes[0]?.id || null; + this._selectedShotId = this._project.scenes[0]?.shots[0]?.id || null; this._saveProject(); this._publish({ type: 'scene-deleted', scene }); if (scene.stories) this._publish({ type: 'stories-changed' }); @@ -2001,14 +1988,6 @@ export class SceneDirector { * @returns {boolean} False when the scene is not installed. */ selectShot(sceneId, shotId = null) { - // No scene: AUTHORING goes back to "No scene yet". - if (sceneId == null) { - this._selectedSceneId = null; - this._selectedShotId = null; - this._renderSceneSelect(); - this._renderShotList(); - return true; - } const scene = this._project.scenes.find(({ id }) => id === sceneId); if (!scene) return false; this._selectedSceneId = scene.id; @@ -2543,12 +2522,13 @@ export class SceneDirector { ); this._storageReadError = null; // Keep authoring on the named or current scene, else the first scene - // that is not a built-in one, else none. + // that is not a built-in one, else the first scene. const builtIn = new Set(SCENE_RECIPES.map(({ id }) => id)); const selected = project.scenes.find(({ id }) => id === selection?.sceneId) || project.scenes.find(({ id }) => id === this._selectedSceneId) || project.scenes.find(({ id }) => !builtIn.has(id)) || + project.scenes[0] || null; this._selectedSceneId = selected?.id ?? null; this._selectedShotId = diff --git a/src/scenes/director.test.mjs b/src/scenes/director.test.mjs index 6a1dd569d..705bcf04e 100644 --- a/src/scenes/director.test.mjs +++ b/src/scenes/director.test.mjs @@ -732,9 +732,8 @@ test('a legacy three-shot Nepal browser project bootstraps to the current 25-sho for (const shot of scene.shots.slice(0, 8)) { assert.equal(scene.appliedShotPacks[0].shotBindings[shot.title], shot.id); } - // The upgrade selects nothing: authoring starts with no scene. - assert.equal(director._selectedSceneId, null); - assert.equal(director._selectedShotId, null); + assert.equal(director._selectedSceneId, scene.id); + assert.equal(director._selectedShotId, scene.shots[0].id); } finally { restore(); } @@ -2174,9 +2173,9 @@ test('selectShot selects a scene and shot for authoring, falling back to the fir }); assert.equal(director.hasScene(scene.id), true); assert.equal(director.hasScene('no-such-scene'), false); - // No scene: back to "No scene yet". - assert.equal(director.selectShot(null), true); - assert.deepEqual(director.selection(), { sceneId: null, shotId: null }); + // No scene id changes nothing. + assert.equal(director.selectShot(null), false); + assert.equal(director._selectedSceneId, scene.id); } finally { restore(); } @@ -2391,22 +2390,20 @@ test('deleting a scene or its last shot in Stories publishes stories-changed', ( } }); -test('authoring selects no scene on load, with or without a saved project', () => { +test('authoring selects the first scene and shot on load, with or without a saved project', () => { for (const options of [{}, { storage: {} }]) { const { director, restore } = makeDirector(options); try { - assert.ok( - director._project.scenes.length > 0, - 'the scenes stay in the project', - ); - assert.equal(director._selectedSceneId, null); - assert.equal(director._selectedShotId, null); - assert.equal(director._getSelectedScene(), null); + const [first] = director._project.scenes; + assert.ok(first, 'the project has scenes'); + assert.equal(director._selectedSceneId, first.id); + assert.equal(director._selectedShotId, first.shots[0]?.id ?? null); + director._selectedSceneId = 'gone'; director._renderSceneSelect(); assert.equal( director._selectedSceneId, - null, - 'nothing falls back to the first scene', + first.id, + 'a missing scene falls back to the first scene', ); } finally { restore(); @@ -2417,6 +2414,9 @@ test('authoring selects no scene on load, with or without a saved project', () = test('capture with no scene starts a new scene and captures into it', () => { const { director, restore } = makeDirector(); try { + // An imported empty project leaves nothing selected. + director._selectedSceneId = null; + director._selectedShotId = null; const changes = recordChanges(director); const before = director._project.scenes.length; director.captureShot(); @@ -2442,6 +2442,7 @@ test('capture with no scene and no camera creates nothing', () => { const { director, styleManager, restore } = makeDirector(); try { styleManager.getCameraState = () => null; + director._selectedSceneId = null; const before = director._project.scenes.length; director.captureShot(); assert.equal(director._project.scenes.length, before); @@ -2451,15 +2452,15 @@ test('capture with no scene and no camera creates nothing', () => { } }); -test('deleting the current scene selects none', () => { +test('deleting the current scene selects the first scene', () => { const project = structuredClone(PROJECT_FIXTURE); project.scenes.push({ id: 'scene-2', title: 'Second', shots: [] }); const { director, restore } = makeDirector({ project }); try { director.selectShot('scene-2'); director._deleteSelectedScene(); - assert.equal(director._selectedSceneId, null); - assert.equal(director._selectedShotId, null); + assert.equal(director._selectedSceneId, 'scene-1'); + assert.equal(director._selectedShotId, 'shot-a'); assert.deepEqual( director._project.scenes.map(({ id }) => id), ['scene-1'], @@ -2469,7 +2470,7 @@ test('deleting the current scene selects none', () => { } }); -test('an import keeps the current scene, else picks a non-built-in scene, else none', async () => { +test('an import keeps the current scene, else picks a non-built-in scene, else the first', async () => { const { director, restore } = makeDirector(); try { const exported = stringifySceneDocument(director._project); @@ -2494,8 +2495,8 @@ test('an import keeps the current scene, else picks a non-built-in scene, else n ); assert.equal( director._selectedSceneId, - null, - 'a built-in scene is never picked', + SCENE_RECIPES[0].id, + 'a built-in scene only when there is nothing else', ); } finally { restore(); diff --git a/src/ui/sceneControls.js b/src/ui/sceneControls.js index 2bde14a45..3a00f5c66 100644 --- a/src/ui/sceneControls.js +++ b/src/ui/sceneControls.js @@ -64,7 +64,7 @@ export class SceneControls { this.run(this.actions.reviewImport ? 'reviewImport' : 'import', file), }); this.presentPanel({}); - // Scene and shot titles are shown translated; the scene name and the list + // Scene and shot titles are shown translated; the select and the list // show them again. this.offLocale = onLocaleChange(() => { this.presentPanel({ playLabel: t('PLAY', { context: 'scene' }) }); @@ -173,9 +173,9 @@ export class SceneControls { } } - /** Publish the project to the scene name and the SceneShotList view. */ + /** Publish the project to the SceneOptions and SceneShotList views. */ renderSceneSelect() { - if (!this.destroyed) this.store.publish(this.read()); + if (!this.destroyed) this.store.publishOptions(this.read()); } /** NEW SCENE: ask for a name and create the scene. @returns {boolean} */ diff --git a/src/ui/sceneControls.test.mjs b/src/ui/sceneControls.test.mjs index a3e3f2057..90db2c00a 100644 --- a/src/ui/sceneControls.test.mjs +++ b/src/ui/sceneControls.test.mjs @@ -37,7 +37,7 @@ function fixture() { const byId = (id) => document.getElementById(id); const elements = { panel: byId('scene-panel'), - name: byId('scene-name'), + select: byId('scene-select'), new: byId('scene-new-btn'), delete: byId('scene-delete-btn'), capture: byId('scene-capture-btn'), @@ -80,6 +80,7 @@ function fixture() { const calls = []; const actions = Object.fromEntries( [ + 'selectScene', 'selectShot', 'renameShot', 'create', @@ -128,8 +129,8 @@ test('Scene controls render the supplied selection and running/download states', const f = fixture(); try { await nextTick(); - assert.equal(f.elements.name.textContent, ''); - assert.equal(document.getElementById('scene-select'), null); + assert.equal(f.elements.select.children[0].textContent, ''); + assert.equal(f.elements.select.value, 'scene-a'); assert.equal(f.label().textContent, ''); assert.equal( f.elements.shots.children[0].children[1].textContent, @@ -410,7 +411,6 @@ test('the real director preserves a selected shot label for the following double }, }); director = new SceneDirector({ camera: { cancelFlight() {} } }, {}, {}); - director.selectShot('scene-a'); await nextTick(); const label = f.label(); label.click(); @@ -432,7 +432,7 @@ test('the real director preserves a selected shot label for the following double } }); -test('the real director names the scene it selects and saves it to Stories', async () => { +test('the real director shows the scene it selects and saves it to Stories', async () => { const f = fixture(); const previousStorage = globalThis.localStorage; let saved = null; @@ -452,15 +452,12 @@ test('the real director names the scene it selects and saves it to Stories', asy }); director = new SceneDirector({ camera: { cancelFlight() {} } }, {}, {}); await nextTick(); - // Nothing is selected on load. - assert.equal(f.elements.name.textContent, 'No scene yet'); + // The first scene is selected on load, as before Stories. + assert.equal(f.elements.select.value, 'scene-a'); assert.equal( f.elements.shots.querySelectorAll('.scene-shot-row').length, - 0, + 1, ); - director.selectShot('scene-a'); - await nextTick(); - assert.equal(f.elements.name.textContent, ''); assert.equal(f.elements.stories.textContent, 'SAVE TO STORIES'); f.elements.stories.click(); await nextTick(); @@ -468,10 +465,10 @@ test('the real director names the scene it selects and saves it to Stories', asy assert.equal(f.elements.status.textContent, 'Saved to Stories'); assert.equal(f.elements.stories.textContent, 'REMOVE FROM STORIES'); - // Stories' "Open in GEV" selects programmatically; the name follows. + // Stories' "Open in GEV" selects programmatically; the select follows. assert.equal(director.selectShot('scene-b'), true); await nextTick(); - assert.equal(f.elements.name.textContent, 'Scene B'); + assert.equal(f.elements.select.value, 'scene-b'); assert.equal(f.elements.stories.textContent, 'SAVE TO STORIES'); assert.equal(f.elements.stories.disabled, true); @@ -555,22 +552,40 @@ test('a rename keeps typed text across republishing and ends with its scene', as } }); -test('the read-only scene name follows the selected scene', async () => { +test('the scene select follows option renders, as before', async () => { const f = fixture(); try { await nextTick(); f.state.scenes.push({ id: 'scene-b', title: 'B', shots: [] }); - f.state.selectedSceneId = 'scene-b'; f.owner.renderSceneSelect(); await nextTick(); - assert.equal(f.elements.name.textContent, 'B'); - assert.equal(f.elements.name.classList.contains('scene-name-empty'), false); - f.state.scenes = []; - f.state.selectedSceneId = null; + f.state.selectedSceneId = 'scene-b'; f.owner.renderShotList(); await nextTick(); - assert.equal(f.elements.name.textContent, 'No scene yet'); - assert.equal(f.elements.name.classList.contains('scene-name-empty'), true); + assert.equal(f.elements.select.value, 'scene-a'); + f.owner.renderSceneSelect(); + await nextTick(); + assert.equal(f.elements.select.value, 'scene-b'); + } finally { + f.restore(); + } +}); + +test('an option render restores the published scene after a local pick', async () => { + const f = fixture(); + try { + f.state.scenes.push({ id: 'scene-b', title: 'B', shots: [] }); + f.owner.renderSceneSelect(); + await nextTick(); + assert.equal(f.elements.select.value, 'scene-a'); + // The person picks B; the owner re-renders the shot list only. + f.elements.select.value = 'scene-b'; + f.owner.renderShotList(); + await nextTick(); + // Something reloads A and renders the options with the same choice. + f.owner.renderSceneSelect(); + await nextTick(); + assert.equal(f.elements.select.value, 'scene-a'); } finally { f.restore(); } @@ -777,7 +792,6 @@ test('CAPTURE SHOT with no scene asks for a name, creates the scene, then captur f.owner.renderSceneSelect(); f.owner.setButtons(false); await nextTick(); - assert.equal(f.elements.name.textContent, 'No scene yet'); let asked = 0; window.prompt = () => (asked++ ? null : 'Harbour'); f.elements.capture.click(); @@ -862,7 +876,7 @@ test('Stories tag chips and THUMBNAIL follow the current scene', async () => { } }); -test('authoring can reopen a saved empty draft and capture from an empty panel', async () => { +test('after a reload, authoring picks any scene, and PLAY and NEXT work', async () => { const f = fixture(); const previousStorage = globalThis.localStorage; let saved = null; @@ -879,6 +893,11 @@ test('authoring can reopen a saved empty draft and capture from an empty panel', scenes: [ ...f.state.scenes, { id: 'empty-draft', title: 'Empty draft', shots: [] }, + { + id: 'scene-c', + title: 'Scene C', + shots: [{ id: 'shot-c', title: 'Shot C' }], + }, ], }), setItem: (_key, value) => { @@ -901,18 +920,59 @@ test('authoring can reopen a saved empty draft and capture from an empty panel', }, { getAll: () => [], getLayerParams: () => null }, ); + const runs = []; + director.startScene = (id) => runs.push(['start', id]); + director.runNextScene = () => runs.push(['next']); await nextTick(); - assert.equal(f.elements.name.textContent, 'No scene yet'); - const drafts = document.getElementById('empty-scene-select'); - assert.ok(drafts); - drafts.value = 'empty-draft'; - drafts.dispatchEvent(new Event('change')); + // The first scene and its first shot are selected, as before a reload. + assert.deepEqual(director.selection(), { + sceneId: 'scene-a', + shotId: 'shot-a', + }); + assert.equal(f.elements.start.disabled, false); + assert.equal(f.elements.next.disabled, false); + f.elements.start.click(); + f.elements.next.click(); + assert.deepEqual(runs, [['start', 'scene-a'], ['next']]); + + // The select lists every scene, with shots or not. + assert.deepEqual( + [...f.elements.select.options].map(({ value }) => value), + ['scene-a', 'empty-draft', 'scene-c'], + ); + f.elements.select.value = 'scene-c'; + f.elements.select.dispatchEvent(new Event('change')); await nextTick(); - assert.equal(f.elements.name.textContent, 'Empty draft'); + assert.deepEqual(director.selection(), { + sceneId: 'scene-c', + shotId: 'shot-c', + }); + + f.elements.select.value = 'empty-draft'; + f.elements.select.dispatchEvent(new Event('change')); + await nextTick(); + assert.equal(director.selection().sceneId, 'empty-draft'); assert.equal( director.draftScenes().some(({ id }) => id === 'empty-draft'), false, ); + // CAPTURE SHOT adds to the picked scene without asking for a name. + window.prompt = () => { + throw new Error('no name is asked for'); + }; + f.elements.capture.click(); + await nextTick(); + const draft = saved.scenes.find(({ id }) => id === 'empty-draft'); + assert.equal(draft.shots.length, 1); + assert.equal(f.elements.thumb.disabled, false); + f.chips()[0].click(); + await nextTick(); + assert.deepEqual( + saved.scenes.find(({ id }) => id === 'empty-draft').storyTags, + ['Floods'], + ); + + // Deleting it selects the first scene again. window.confirm = () => true; f.elements.delete.click(); await nextTick(); @@ -920,29 +980,8 @@ test('authoring can reopen a saved empty draft and capture from an empty panel', saved.scenes.some(({ id }) => id === 'empty-draft'), false, ); - window.prompt = () => 'Harbour'; - f.elements.capture.click(); - await nextTick(); - assert.equal(f.elements.name.textContent, 'Harbour'); - assert.equal(saved.scenes.at(-1).title, 'Harbour'); - assert.equal(saved.scenes.at(-1).shots.length, 1); - assert.equal( - f.elements.shots.querySelectorAll('.scene-shot-row').length, - 1, - ); - assert.equal(f.elements.thumb.disabled, false); - - f.chips()[0].click(); - await nextTick(); - assert.deepEqual(saved.scenes.at(-1).storyTags, ['Floods']); - assert.equal(f.chips()[0].getAttribute('aria-pressed'), 'true'); - - // Deleting it goes back to no scene. - window.confirm = () => true; - f.elements.delete.click(); - await nextTick(); - assert.equal(f.elements.name.textContent, 'No scene yet'); - assert.equal(f.elements.delete.disabled, true); + assert.equal(f.elements.select.value, 'scene-a'); + assert.equal(director.selection().sceneId, 'scene-a'); } finally { await director?.destroy(); Object.defineProperty(globalThis, 'localStorage', { diff --git a/src/ui/scenePresentation.js b/src/ui/scenePresentation.js index d1b1e6c9f..8ed67259d 100644 --- a/src/ui/scenePresentation.js +++ b/src/ui/scenePresentation.js @@ -81,6 +81,7 @@ export function sceneButtonsDisabled( for (const name of [ 'start', 'next', + 'select', 'new', 'delete', 'capture', diff --git a/src/ui/stores/scenes.js b/src/ui/stores/scenes.js index 5630c5fd0..ebc2443c9 100644 --- a/src/ui/stores/scenes.js +++ b/src/ui/stores/scenes.js @@ -3,7 +3,7 @@ import { computed, markRaw, shallowRef } from 'vue'; /** * @typedef {object} SceneRowHandlers - * @property {(sceneId: string) => void} selectScene + * @property {(sceneId: string) => void} selectScene The select's choice. * @property {(shotId: string) => void} select * @property {(sceneId: string, shotId: string, title: string) => void} rename * @property {(sceneId: string, shotId: string) => void} load @@ -24,7 +24,12 @@ export const useSceneStore = defineStore('gev-scenes', () => { const scenes = shallowRef(markRaw([])); const selectedSceneId = shallowRef(null); const selectedShotId = shallowRef(null); - /** The scene being edited, whose name the panel shows, or null. */ + // The select's choice, updated only when its options are rendered. + const listedSceneId = shallowRef(null); + // Counts option renders: each one re-applies the select's choice, which + // the person may have changed since. + const listedRevision = shallowRef(0); + /** The selected scene, whose Stories details the panel shows, or null. */ const currentScene = computed( () => scenes.value.find((scene) => scene.id === selectedSceneId.value) ?? null, @@ -64,6 +69,13 @@ export const useSceneStore = defineStore('gev-scenes', () => { selectedShotId.value = state.selectedShotId ?? null; } + /** Publish the project and the select's choice. */ + function publishOptions(state) { + publish(state); + listedSceneId.value = state.selectedSceneId ?? null; + listedRevision.value++; + } + /** @param {string|null} id */ function selectShot(id) { selectedShotId.value = id ?? null; @@ -77,7 +89,7 @@ export const useSceneStore = defineStore('gev-scenes', () => { if (token !== owner) return; owner = null; attached.value = false; - publish({}); + publishOptions({}); } /** @returns {boolean} Whether `token` is the owner presenting now. */ @@ -98,12 +110,15 @@ export const useSceneStore = defineStore('gev-scenes', () => { scenes, selectedSceneId, selectedShotId, + listedSceneId, + listedRevision, currentScene, attached, panel, publishPanel, attach, publish, + publishOptions, selectShot, detach, owns, diff --git a/src/ui/styles/english-css-parity.test.mjs b/src/ui/styles/english-css-parity.test.mjs index 3e9bb74b9..f04a4a1b4 100644 --- a/src/ui/styles/english-css-parity.test.mjs +++ b/src/ui/styles/english-css-parity.test.mjs @@ -92,8 +92,8 @@ test('SCENES actions stay on one line in English', () => { .length, 0, ); - const [name] = unguardedRules(css('scenes.css'), '#scene-name'); - assert.equal(declaration(name, 'white-space'), undefined); + const [select] = unguardedRules(css('scenes.css'), '#scene-select'); + assert.equal(declaration(select, 'white-space'), undefined); }); test('Display and parameter rows keep their English layout', () => { diff --git a/src/ui/styles/scenes.css b/src/ui/styles/scenes.css index d86456265..1aec7d54f 100644 --- a/src/ui/styles/scenes.css +++ b/src/ui/styles/scenes.css @@ -162,24 +162,21 @@ flex-wrap: wrap; } -/* The scene being edited, read-only, takes its own row; NEW SCENE / DELETE - share the next. A long name wraps. */ -#scene-name { +/* The scene's name takes its own row; NEW SCENE / DELETE share the next. */ +#scene-select { flex: 1 1 100%; min-width: 0; - margin: 0; + min-height: 32px; font-size: 12px; - line-height: 1.4; - overflow-wrap: anywhere; } -#scene-name.scene-name-empty { - color: var(--scene-quiet); -} - -#empty-scene-select { - flex: 1 1 100%; - min-width: 0; +html:not([lang='en']) #scene-select { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-family: var(--font-mono); + font-size: 10px; + letter-spacing: 0.04em; } /* A translated action longer than its button wraps inside the button instead diff --git a/src/ui/views/LayerPanelsView.vue b/src/ui/views/LayerPanelsView.vue index 6ab3c358b..1835a99b3 100644 --- a/src/ui/views/LayerPanelsView.vue +++ b/src/ui/views/LayerPanelsView.vue @@ -1,5 +1,4 @@ + +