-
- {draft.writable
- ? (
+ {/* Read-only has nothing to commit or abandon, and leaving is already the
+ back link above — a lone Close button would be a second way out. */}
+ {draft.writable
+ ? (
+
+
- )
- : null}
-
+
+ )
+ : null}
)
}
diff --git a/packages/client/ui-agent-preset/src/client/locales.ts b/packages/client/ui-agent-preset/src/client/locales.ts
index 3dc6c5fa02..b39df23781 100644
--- a/packages/client/ui-agent-preset/src/client/locales.ts
+++ b/packages/client/ui-agent-preset/src/client/locales.ts
@@ -44,7 +44,7 @@ export const en: Record = {
customGroup: 'Custom',
noDescription: 'No description.',
copyOf: 'Copied from',
- composition: 'Composition (cordis.yml)',
+ composition: 'Composition (agent.cordis.yml)',
readOnlyNotice: 'This preset ships with the deployment and cannot be edited. Duplicate it to make your own.',
save: 'Save',
saving: 'Saving…',
@@ -92,7 +92,7 @@ export const zh: Record = {
customGroup: '自定义',
noDescription: '暂无描述。',
copyOf: '复制自',
- composition: '组装(cordis.yml)',
+ composition: '组装(agent.cordis.yml)',
readOnlyNotice: '该预设随部署提供,不可编辑。复制一份即可改成自己的。',
save: '保存',
saving: '正在保存…',
diff --git a/packages/client/ui-agent-preset/tests/section.spec.tsx b/packages/client/ui-agent-preset/tests/section.spec.tsx
index e24cf8f467..bedfcb3ded 100644
--- a/packages/client/ui-agent-preset/tests/section.spec.tsx
+++ b/packages/client/ui-agent-preset/tests/section.spec.tsx
@@ -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', () => {