From 276b19a30d18540bfbfb837fa791d368773bf403 Mon Sep 17 00:00:00 2001 From: Oleg Isonen Date: Thu, 9 Mar 2023 19:47:19 +0000 Subject: [PATCH] Keep the label from old instance (#1215) Fixes https://github.com/webstudio-is/webstudio-builder/issues/1214 ## Description We ended up removing instance labels when sorting instances, is there more situations like this? ## Steps for reproduction 1. name instance 2. sort it in navigator or on canvas ## Code Review - [ ] hi @TrySound , I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 5de6) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env.example` and the `builder/env-check.js` if mandatory --- apps/builder/app/shared/nano-states/nano-states.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/builder/app/shared/nano-states/nano-states.ts b/apps/builder/app/shared/nano-states/nano-states.ts index e2c2ca1b48..9e22187c4f 100644 --- a/apps/builder/app/shared/nano-states/nano-states.ts +++ b/apps/builder/app/shared/nano-states/nano-states.ts @@ -75,6 +75,7 @@ export const patchInstancesMutable = ( type: "instance", id: oldInstance.id, component: oldInstance.component, + label: oldInstance.label, children: oldInstance.children.map((child) => { if (child.type === "text") { return child;