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:
Anso
2026-07-09 13:53:26 -04:00
committed by GitHub
parent d113004359
commit e2001fed72
16 changed files with 463 additions and 95 deletions
@@ -20,7 +20,11 @@ export interface CreateStackDialogProps {
// sourceNodeId is the active node ID captured at the moment the user clicked
// Create. Parent compares against the current active node before navigating
// so a mid-flight node switch does not land the user on a 404.
onStackCreated: (stackName: string, sourceNodeId: number | null | undefined) => void | Promise<void>;
onStackCreated: (
stackName: string,
sourceNodeId: number | null | undefined,
meta?: { mode: CreateMode },
) => void | Promise<void>;
onStacksChanged: () => void | Promise<void>;
// Mode the dialog opens on. The empty-state entry opens directly on 'import';
// the toolbar Create button opens on 'empty'.
@@ -153,7 +157,7 @@ export function CreateStackDialog({ open, onOpenChange, onStackCreated, onStacks
setNewStackName('');
setCreateMode('empty');
toast.success(`Stack "${stackName}" created.`);
await onStackCreated(stackName, sourceNodeId);
await onStackCreated(stackName, sourceNodeId, { mode: 'empty' });
} catch (error) {
console.error('Failed to create stack:', error);
toast.error((error as Error).message || 'Failed to create stack.');