🐛 Preserve renamed layer name when re-entering edit mode (#9231)

* 🐛 Preserve renamed layer name when re-entering edit mode

When a layer was renamed and the user clicked its name again to edit
it, the input opened with the type-based default name instead of the user's saved name. Pressing Enter then
silently overwrote the saved name with the default. Read the current
shape :name when seeding the rename input so the user's previous
rename is preserved.

Signed-off-by: jack-stormentswe <crazycoder131@gmail.com>

* 💄 Remove redundant DOM-refresh effect from layer rename input

Signed-off-by: jack-stormentswe <crazycoder131@gmail.com>

---------

Signed-off-by: jack-stormentswe <crazycoder131@gmail.com>
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
Co-authored-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
Jack Storment 2026-04-29 12:07:48 -04:00 committed by GitHub
parent 8821ada1bb
commit 710fd30f78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -54,6 +54,7 @@
### :bug: Bugs fixed
- Fix layers-panel rename input opening with the type-based default (e.g. "Ellipse") instead of the user's saved name when re-entering edit mode on a previously renamed layer; the silent revert could overwrite the saved name on confirm. The `default-value` `mf/with-memo` was missing `shape-name` from its dependency list, so once the memo cached the original default it never refreshed. Adds `shape-name` to the deps and force-syncs the input's DOM value on every entry into edit mode [Github #9230](https://github.com/penpot/penpot/issues/9230)
- Suppress the browser context menu when right-clicking empty space in the workspace sidebars while preserving it on text inputs so paste/select-all still work [Github #5127](https://github.com/penpot/penpot/issues/5127)
- Fix release notes modal appearing behind the dashboard sidebar [Github #8296](https://github.com/penpot/penpot/issues/8296)
- Fix plugin API `fileVersion.restore()` promise hanging indefinitely on restore failure [Github #9092](https://github.com/penpot/penpot/issues/9092)

View File

@ -38,7 +38,7 @@
shape-name)
default-value
(mf/with-memo [variant-id variant-error variant-properties]
(mf/with-memo [variant-id variant-error variant-properties shape-name]
(if variant-id
(or variant-error (ctv/properties-map->formula variant-properties))
shape-name))