fix(web): drop the Close button from the read-only preset view

A shipped preset has nothing to commit or abandon, and the back link above
already leaves the screen; a lone Close button below the composition was a
second way out of the same place. The action row now renders only when the
draft is writable, where Cancel and Save are both real choices.

The composition label named `cordis.yml`; the file a preset actually holds
is `agent.cordis.yml`.
This commit is contained in:
Yichen Jiang
2026-08-05 17:13:52 +08:00
parent 64fc536982
commit 4bb9836abe
3 changed files with 17 additions and 12 deletions

View File

@@ -239,7 +239,10 @@ describe('the composition editor', () => {
expect(screen.getByLabelText(en.composition)).toHaveProperty('readOnly', true)
expect(screen.getByText(en.readOnlyNotice)).toBeTruthy()
expect(screen.queryByText(en.save)).toBeNull()
expect(screen.getByText(en.close)).toBeTruthy()
// Nothing to commit or abandon, and the back link above already leaves —
// a lone Close button would be a second way out of the same screen.
expect(screen.queryByText(en.cancel)).toBeNull()
expect(screen.getByRole('button', { name: `${en.backToList}` })).toBeTruthy()
})
it('titles the panel by what it is doing', () => {