Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/web/src/pages/skill-detail-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//
// A save is never silent, and never blind:
//
// * "Save…" opens a review step showing the diff between the published
// * "Review" opens a review step showing the diff between the published
// version and what is in the editor; the commit happens only on
// confirm.
// * The save carries the version the editor was seeded from, so if
Expand Down Expand Up @@ -314,7 +314,7 @@ export function SkillDetailPage({
setConfirming(true);
}}
>
Save…
Review
</Button>
);

Expand Down Expand Up @@ -400,7 +400,7 @@ export function SkillDetailPage({
/>
{edited ? (
<p className="mt-2 text-xs text-muted-foreground">
Unsaved changes — “Save…” shows what will change before it is
Unsaved changes — “Review” shows what will change before it is
published.
</p>
) : null}
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/shell/context-menu/items.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function shellMenu(actions: ShellContextMenuActions): ContextMenu {
entries: [
contextMenuItem({
id: "search",
label: "Search…",
label: "Search",
icon: <MagnifyingGlass />,
onSelect: () => openCommandPalette(),
}),
Expand Down
24 changes: 12 additions & 12 deletions apps/web/test/skill-detail-page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,24 +258,24 @@ describe("SkillDetailPage", () => {
expect(buttonNamed(el, "Make it private to me")).toBeDefined();
});

test("Save… is offered only once the editor differs from the published version", async () => {
test("Review is offered only once the editor differs from the published version", async () => {
const el = await mount();
const bar = el.querySelector('[data-testid="stage-top-bar-actions"]');
if (bar === null) throw new Error("no action slot");
expect(buttonNamed(bar, "Save…").disabled).toBe(true);
expect(buttonNamed(bar, "Review").disabled).toBe(true);

await act(async () => {
typeInto("skill-body", `${HEAD_BODY}\nEscalate anything on fire.`);
});
expect(buttonNamed(bar, "Save…").disabled).toBe(false);
expect(buttonNamed(bar, "Review").disabled).toBe(false);
});

test("Save… opens a confirmation showing the diff, and writes nothing yet", async () => {
test("Review opens a confirmation showing the diff, and writes nothing yet", async () => {
const el = await mount();
await act(async () => {
typeInto("skill-body", "Read the report.\nPick two labels.");
});
await click(buttonNamed(el, "Save…"));
await click(buttonNamed(el, "Review"));

expect(document.body.textContent).toContain("Review this save");
const diff = document.body.querySelector('[data-testid="diff-view"]');
Expand All @@ -289,7 +289,7 @@ describe("SkillDetailPage", () => {
await act(async () => {
typeInto("skill-body", "Read the report.\nPick two labels.");
});
await click(buttonNamed(el, "Save…"));
await click(buttonNamed(el, "Review"));
await click(buttonNamed(document.body, "Keep editing"));

expect(document.body.textContent).not.toContain("Review this save");
Expand All @@ -304,7 +304,7 @@ describe("SkillDetailPage", () => {
await act(async () => {
typeInto("skill-body", "Read the report.\nPick two labels.");
});
await click(buttonNamed(el, "Save…"));
await click(buttonNamed(el, "Review"));
await click(buttonNamed(document.body, "Confirm & save"));

expect(saves()).toHaveLength(1);
Expand All @@ -320,7 +320,7 @@ describe("SkillDetailPage", () => {
await act(async () => {
typeInto("skill-description", " Sorts inbound issues by severity. ");
});
await click(buttonNamed(el, "Save…"));
await click(buttonNamed(el, "Review"));
const diff = document.body.querySelector('[data-testid="diff-view"]');
expect(diff?.textContent).toContain("Sorts inbound issues by severity.");
await click(buttonNamed(document.body, "Confirm & save"));
Expand All @@ -340,12 +340,12 @@ describe("SkillDetailPage", () => {
// Same text, different newline convention: nothing to save.
const bar = el.querySelector('[data-testid="stage-top-bar-actions"]');
if (bar === null) throw new Error("no action slot");
expect(buttonNamed(bar, "Save…").disabled).toBe(true);
expect(buttonNamed(bar, "Review").disabled).toBe(true);

await act(async () => {
typeInto("skill-body", "Read the report.\r\nPick two labels.\r");
});
await click(buttonNamed(el, "Save…"));
await click(buttonNamed(el, "Review"));
await click(buttonNamed(document.body, "Confirm & save"));
expect(saves()[0]?.body).toEqual({
description: "Sorts inbound issues.",
Expand Down Expand Up @@ -385,7 +385,7 @@ describe("SkillDetailPage", () => {
await act(async () => {
typeInto("skill-body", "Read the report.\nMy new line.");
});
await click(buttonNamed(el, "Save…"));
await click(buttonNamed(el, "Review"));
await click(buttonNamed(document.body, "Confirm & save"));

// The review is still open, saying what happened, now diffing against
Expand Down Expand Up @@ -509,7 +509,7 @@ describe("SkillDetailPage", () => {
await act(async () => {
typeInto("skill-body", huge);
});
await click(buttonNamed(el, "Save…"));
await click(buttonNamed(el, "Review"));

const summary = document.body.querySelector(
'[data-testid="diff-too-large"]',
Expand Down
Loading