diff --git a/src/app/app.css b/src/app/app.css index c71d9a27..4be06dc9 100644 --- a/src/app/app.css +++ b/src/app/app.css @@ -458,6 +458,27 @@ button:disabled { font-weight: 600; } +.outliner-item__rename { + flex: 1 1 auto; + min-width: 0; + width: 100%; + padding: 2px 6px; + margin: -2px -6px; + color: var(--color-text); + font: inherit; + font-size: 0.82rem; + font-weight: 600; + background: rgba(7, 9, 13, 0.22); + border: 1px solid transparent; + border-radius: 8px; +} + +.outliner-item__rename:focus { + outline: none; + background: rgba(7, 9, 13, 0.38); + border-color: rgba(207, 123, 66, 0.45); +} + .outliner-item__delete { flex: 0 0 auto; width: 22px; @@ -479,11 +500,6 @@ button:disabled { transform: none; } -.outliner-item__editor { - width: 100%; - gap: 6px; -} - .asset-item--action { display: flex; flex-direction: row; diff --git a/tests/serialization/scene-document-json.test.ts b/tests/serialization/scene-document-json.test.ts index 13f6779c..01b5bc7b 100644 --- a/tests/serialization/scene-document-json.test.ts +++ b/tests/serialization/scene-document-json.test.ts @@ -257,6 +257,7 @@ describe("scene document JSON", () => { it("round-trips a document containing an authored PlayerStart entity", () => { const playerStart = createPlayerStartEntity({ id: "entity-player-start-main", + name: "Main Spawn", position: { x: 4, y: 0, @@ -274,6 +275,32 @@ describe("scene document JSON", () => { expect(parseSceneDocumentJson(serializeSceneDocument(document))).toEqual(document); }); + it("migrates version 14 documents without entity names", () => { + const pointLight = createPointLightEntity({ + id: "entity-point-light-legacy", + position: { + x: 2, + y: 3, + z: 1 + }, + colorHex: "#ffeeaa", + intensity: 1.75, + distance: 9 + }); + const legacyDocument = { + ...createEmptySceneDocument({ name: "Legacy Entity Name Scene" }), + version: 14 as const, + entities: { + [pointLight.id]: pointLight + } + }; + + const migratedDocument = migrateSceneDocument(legacyDocument); + + expect(migratedDocument.version).toBe(SCENE_DOCUMENT_VERSION); + expect(migratedDocument.entities[pointLight.id]).toEqual(pointLight); + }); + it("round-trips the initial typed entity registry without mixing entities into model instances", () => { const playerStart = createPlayerStartEntity({ id: "entity-player-start-main"