diff --git a/desktop/src/features/agents/ui/RelaySkillPreviewButton.tsx b/desktop/src/features/agents/ui/RelaySkillPreviewButton.tsx
index 66e3798e9f..621edf6416 100644
--- a/desktop/src/features/agents/ui/RelaySkillPreviewButton.tsx
+++ b/desktop/src/features/agents/ui/RelaySkillPreviewButton.tsx
@@ -60,6 +60,10 @@ export function RelaySkillPreviewButton({
const [open, setOpen] = React.useState(false);
const [previewState, setPreviewState] = React.useState
- {detail.content}
+ {currentDetail.content}
) : null}
diff --git a/desktop/src/testing/e2eBridge.ts b/desktop/src/testing/e2eBridge.ts
index 9104e497aa..8562253d51 100644
--- a/desktop/src/testing/e2eBridge.ts
+++ b/desktop/src/testing/e2eBridge.ts
@@ -14034,14 +14034,40 @@ export function maybeInstallE2eTauriMocks() {
}
).input;
const [, publisher = "", slug = ""] = input.coordinate.split(":", 3);
+ const eventId = "de".repeat(32);
+ const updatedAt = 1_700_000_001;
+ const mock = getConfig()?.mock;
+ const cover = mock?.relaySkills?.find(
+ (candidate) => candidate.coordinate === input.coordinate,
+ );
+ if (cover) {
+ Object.assign(cover, {
+ title: input.title,
+ summary: input.summary,
+ eventId,
+ updatedAt,
+ });
+ }
+ const detail = mock?.relaySkillDetails?.find(
+ (candidate) => candidate.coordinate === input.coordinate,
+ );
+ if (detail) {
+ Object.assign(detail, {
+ title: input.title,
+ summary: input.summary,
+ content: input.instructions,
+ eventId,
+ updatedAt,
+ });
+ }
return {
coordinate: input.coordinate,
publisher,
slug,
title: input.title,
summary: input.summary,
- eventId: "de".repeat(32),
- updatedAt: 1_700_000_001,
+ eventId,
+ updatedAt,
compatible: true,
incompatibilities: [],
};
diff --git a/desktop/tests/e2e/agents.spec.ts b/desktop/tests/e2e/agents.spec.ts
index a7f40e46ac..2757d27bda 100644
--- a/desktop/tests/e2e/agents.spec.ts
+++ b/desktop/tests/e2e/agents.spec.ts
@@ -1058,6 +1058,21 @@ test("shared instruction editing is author-only and does not leak into creation"
await editDialog.getByRole("button", { name: "Save changes" }).click();
await expect(editDialog).toBeHidden();
+ await personaDialog
+ .getByRole("button", { name: "Add shared instructions" })
+ .click();
+ await page.getByRole("menuitemcheckbox", { name: /Design review/ }).hover();
+ const refreshedPreview = page.getByRole("region", {
+ name: "Design review shared instruction preview",
+ });
+ await expect(refreshedPreview).toContainText(
+ "Review interface decisions against product intent and evidence.",
+ );
+ await refreshedPreview.getByRole("button", { name: "Edit" }).click();
+ await editDialog.locator("#relay-skill-title").fill("Design review v2");
+ await editDialog.getByRole("button", { name: "Save changes" }).click();
+ await expect(editDialog).toBeHidden();
+
const updateInput = await page.evaluate(() => {
const call = [...(window.__BUZZ_E2E_COMMAND_PAYLOADS__ ?? [])]
.reverse()
@@ -1076,13 +1091,10 @@ test("shared instruction editing is author-only and does not leak into creation"
| undefined
)?.input;
});
- expect(updateInput).toEqual({
+ expect(updateInput).toMatchObject({
coordinate: ownedCoordinate,
- expectedEventId: "a1".repeat(32),
- title: "Design review",
- summary: "Use when reviewing interface decisions.",
- instructions:
- "Review interface decisions against product intent and evidence.",
+ expectedEventId: "de".repeat(32),
+ title: "Design review v2",
});
await personaDialog