penpot/frontend
Eva Marco 284ffbc391
✨ Focus a new page when it is added from the Pages list (#13138)
* ✨ Focus a new page when it is added from the Pages list

The "+" button added the page at the end of the list, often out of view,
so nothing showed that it was created. It now opens the new page, scrolls
the list to it and starts renaming it with the default name selected. A
collapsed Pages section expands first.

The new add-page event waits for the page to initialize before it starts
the rename, because page initialization replaces :workspace-local. Only
the user who adds the page gets the focus; other users get the page as a
change. create-page stays as it was for the plugin API. The rename events
move to the pages namespace so add-page can use them.

Closes #12474

AI-assisted-by: claude-opus-5-5

* ✨ Skip the rename commit when a page keeps its name

From the review: a new page now starts in rename mode, so pressing Enter
without changes committed a rename to the same name, and the next undo
did nothing visible instead of removing the page. Renaming a page to its
current name commits nothing now.

Rename add-page to create-page-and-focus, which says what it does and
does not collide with pcb/add-page.

AI-assisted-by: claude-opus-5-5
2026-11-26 09:40:08 +01:00
..
2026-11-20 09:53:37 +01:00
2026-11-20 09:53:37 +01:00