mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-07-26 11:49:16 +00:00
feat: open compose editor in edit mode with one click (#1592)
* feat: open compose editor in edit mode with one click Remove the desktop double edit gate so Anatomy "Edit compose" and empty-stack create land in an immediately editable workspace. Close discards both compose and env buffers; deferred loads keep startInComposeEdit through unsaved confirm. * docs: align compose editor close behavior and Edit compose labels Update stack-management and editor docs for one-click edit mode. Close discards unsaved compose/env edits. Anatomy shortcuts use Edit compose. * fix(e2e): update routing test to use anatomy-edit-compose-btn test id The compose editor env tab routing test was written against the old 'edit' button name. The single-compose-edit-gate branch renamed that button to 'Edit compose' with test id 'anatomy-edit-compose-btn'. Update the selector to match.
This commit is contained in:
@@ -57,11 +57,10 @@ test.describe('EditorView save-and-deploy', () => {
|
||||
await route.continue();
|
||||
});
|
||||
|
||||
// The editor surface has two distinct edit affordances. First click swaps
|
||||
// the right panel from Anatomy to the editor tabs (Monaco mounts read-only);
|
||||
// second click flips Monaco into edit mode and reveals Save & Deploy.
|
||||
await page.getByRole('button', { name: /^edit$/ }).click();
|
||||
await page.getByRole('button', { name: /^Edit$/ }).click();
|
||||
// One click on Anatomy "Edit compose" opens an immediately editable Monaco
|
||||
// workspace with Save & Deploy visible (no second Edit gate).
|
||||
await page.getByTestId('anatomy-edit-compose-btn').click();
|
||||
await expect(page.getByRole('button', { name: 'Save & Deploy', exact: true })).toBeVisible({ timeout: 5_000 });
|
||||
|
||||
// No need to modify Monaco content: saveFile fires the PUT regardless of
|
||||
// dirty state. The route interceptor forces it to 500; the gated handler
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ test.describe('URL routing', () => {
|
||||
await expect(page).toHaveURL(new RegExp(`/nodes/local/stacks/`));
|
||||
await expect(page).not.toHaveURL(/\/compose$/);
|
||||
|
||||
await page.getByRole('button', { name: 'edit', exact: true }).click();
|
||||
await page.getByTestId('anatomy-edit-compose-btn').click();
|
||||
await expect(page).toHaveURL(/\/compose/);
|
||||
const envTab = page.getByRole('tab', { name: '.env' });
|
||||
test.skip(!(await envTab.isEnabled()), 'Stack has no .env file');
|
||||
|
||||
Reference in New Issue
Block a user