Computed flow layout, and mobile written into the design
The canvas lays itself out: a layered graph, left to right on a desktop and top to bottom on a phone, with room reserved for the value each edge carries. Nodes cannot be dragged and `NodeDef.position` is gone from the document — a graph nobody can arrange is one worth keeping small, which is what keeps flows atomic. Endpoints join the same layout, so their lanes and the localStorage that remembered where they were dragged go too. Mobile, per the new Responsive section of DESIGN-GUIDELINES.md: the dock caps its width and wraps instead of running off the screen, the dashboard stacks into one column rather than shrinking a wall panel to a fifth of its size, and Home stops widening its grid track past the viewport. A Playwright project at a phone's width fails the build when a screen no longer fits. Along the way: publish is the checkmark that was already there rather than a button that appears and disappears, with discard beside it on both the flow and the dashboard; the brain reveals a neuron's name on the first tap; and the port sparklines get room to breathe. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDSXaRhvqHYNevgDGmNAto
This commit is contained in:
@@ -33,7 +33,9 @@ test("a draft stays off the engine until it is published", async ({ page }) => {
|
||||
// Adding a node opens its panel, and the floating chrome steps aside for it.
|
||||
await page.keyboard.press("Escape")
|
||||
|
||||
await expect(page.getByTestId("publish-flow")).toBeVisible()
|
||||
// The publish glyph never moves; it is enabled only while there is
|
||||
// something to put live.
|
||||
await expect(page.getByTestId("publish-flow")).toBeEnabled()
|
||||
|
||||
// Nothing of this flow is loaded while it is only a draft.
|
||||
await page.waitForTimeout(1500)
|
||||
@@ -41,7 +43,11 @@ test("a draft stays off the engine until it is published", async ({ page }) => {
|
||||
expect(before.nodes).toHaveLength(0)
|
||||
|
||||
await page.getByTestId("publish-flow").click()
|
||||
await expect(page.getByTestId("publish-flow")).toBeHidden()
|
||||
// Discard is what marks a draft: it goes when the publish has landed. The
|
||||
// publish glyph disables while the request is in flight too, so waiting on
|
||||
// that would not wait for anything.
|
||||
await expect(page.getByTestId("discard-draft")).toBeHidden()
|
||||
await expect(page.getByTestId("publish-flow")).toBeDisabled()
|
||||
|
||||
const after = await (await api(page, `/flows/${flowName}/state`)).json()
|
||||
expect(after.nodes.length).toBeGreaterThan(0)
|
||||
@@ -76,11 +82,11 @@ test("discarding a draft goes back to the published flow", async ({ page }) => {
|
||||
await page.goto(`/flows/${flowName}`)
|
||||
await page.waitForSelector(".react-flow__node")
|
||||
|
||||
await page.getByTestId("edit-flow").click()
|
||||
await page.getByTestId("discard-draft").click()
|
||||
await page.getByTestId("confirm-discard-draft").click()
|
||||
|
||||
await expect(page.getByTestId("publish-flow")).toBeHidden()
|
||||
await expect(page.getByTestId("discard-draft")).toBeHidden()
|
||||
await expect(page.getByTestId("publish-flow")).toBeDisabled()
|
||||
const detail = await (await api(page, `/flows/${flowName}`)).json()
|
||||
expect(detail.has_draft).toBe(false)
|
||||
expect(detail.definition.title).not.toBe("Theirs")
|
||||
|
||||
Reference in New Issue
Block a user