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
@@ -91,6 +91,32 @@ function panel(applying: boolean, onApplyUpdate: () => void = vi.fn(), stackName
);
}
describe('StackAnatomyPanel edit affordance', () => {
it('renders Edit compose with a stable test id when canEdit is true', () => {
render(panel(false));
expect(screen.getByTestId('anatomy-edit-compose-btn')).toBeInTheDocument();
expect(screen.getByRole('button', { name: /edit compose/i })).toBeInTheDocument();
});
it('hides Edit compose when canEdit is false', () => {
render(
<StackAnatomyPanel
stackName="web"
content={COMPOSE}
envContent=""
selectedEnvFile=".env"
gitSourcePending={false}
onEditCompose={vi.fn()}
onOpenGitSource={vi.fn()}
onApplyUpdate={vi.fn()}
canEdit={false}
applying={false}
/>,
);
expect(screen.queryByTestId('anatomy-edit-compose-btn')).not.toBeInTheDocument();
});
});
describe('StackAnatomyPanel update banner', () => {
it('shows the apply button and fires onApplyUpdate when clicked', async () => {
const onApply = vi.fn();