Dashboard editor undo: ⌘Z / ⇧⌘Z over a 50-entry history of commits, folding keystrokes and the grid's own correction as the flow editor does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
2026-10-15 00:07:58 +02:00
co-authored by Claude Opus 5.5
parent 0a9ea24b93
commit 98416dc516
3 changed files with 87 additions and 3 deletions
+24
View File
@@ -11,6 +11,8 @@ import { api, apiPage, deleteAll } from "./utils/api"
*
* The third is what a widget drawn without its title is dragged by, since the
* header it used to be dragged by is the thing that is gone.
*
* The last is the undo a mis-click needs: a removed widget comes back.
*/
const dashboardName = `test_editor_${Date.now().toString(36)}`
@@ -201,3 +203,25 @@ test("a palette is pasted as a link and read as roles", async ({ page }) => {
"",
)
})
test("a removed widget comes back on undo and goes again on redo", async ({
page,
}) => {
await openEditor(page)
const frames = page.getByTestId("widget-frame")
const top = frames.filter({ hasText: "Top" })
await top.click()
await page.getByTestId("delete-widget").click()
await expect(top).toHaveCount(0)
// Removing closes the panel, so the keys reach the canvas rather than a
// field, which keeps its own undo.
await page.keyboard.press("ControlOrMeta+z")
await expect(top).toBeVisible()
await expect(frames).toHaveCount(2)
await page.keyboard.press("ControlOrMeta+Shift+z")
await expect(top).toHaveCount(0)
await expect(frames).toHaveCount(1)
})