diff --git a/src/app/(protected)/workorders/_components/list/table/cells/pm-type-cell.tsx b/src/app/(protected)/workorders/_components/list/table/cells/pm-type-cell.tsx
index cbb1f9e3..55a44859 100644
--- a/src/app/(protected)/workorders/_components/list/table/cells/pm-type-cell.tsx
+++ b/src/app/(protected)/workorders/_components/list/table/cells/pm-type-cell.tsx
@@ -61,7 +61,7 @@ export function PMTypeCell({
? serviceNames.filter((p) => p.toLowerCase().includes(search.toLowerCase()))
: serviceNames;
const linkedService = services?.find((service) => String(service.id) === String(serviceId));
- const displayValue = linkedService?.isActive ? linkedService.name : value;
+ const displayValue = !viewOnly && linkedService?.isActive ? linkedService.name : value;
const extras = extraServices ?? [];
const hasDetails = hasServiceNotesDetails(serviceNotes, extras, avetaRequired);
diff --git a/src/test/app/(protected)/workorders/aveta-service-notes.test.tsx b/src/test/app/(protected)/workorders/aveta-service-notes.test.tsx
index ff77c95b..a9fe6360 100644
--- a/src/test/app/(protected)/workorders/aveta-service-notes.test.tsx
+++ b/src/test/app/(protected)/workorders/aveta-service-notes.test.tsx
@@ -77,6 +77,34 @@ describe("Aveta Service & Notes", () => {
expect(screen.queryByRole("button", { name: /Renamed Service/i })).not.toBeInTheDocument();
});
+ it("keeps the completed work-order label when its active service is renamed", () => {
+ renderWithProviders(
+ ,
+ );
+
+ expect(screen.getByRole("button", { name: /Saved Completed Label/i })).toBeInTheDocument();
+ expect(screen.queryByRole("button", { name: /Current Active Name/i })).not.toBeInTheDocument();
+ });
+
it("preserves the historic identity when only service notes change", () => {
const onSaveDetails = vi.fn();
renderWithProviders(
diff --git a/src/test/app/(protected)/workorders/slide-over-info-tab-edit-view-additional-contacts.test.tsx b/src/test/app/(protected)/workorders/slide-over-info-tab-edit-view-additional-contacts.test.tsx
index 53a2654d..b4750b16 100644
--- a/src/test/app/(protected)/workorders/slide-over-info-tab-edit-view-additional-contacts.test.tsx
+++ b/src/test/app/(protected)/workorders/slide-over-info-tab-edit-view-additional-contacts.test.tsx
@@ -65,9 +65,6 @@ vi.mock("@/app/(protected)/workorders/_components/list/table/cells/date-cell", (
vi.mock("@/app/(protected)/workorders/_components/list/table/cells/appt-time-cell", () => ({
ApptTimeCell: () => null,
}));
-vi.mock("@/app/(protected)/workorders/_components/list/table/cells/pm-type-cell", () => ({
- PMTypeCell: () => null,
-}));
vi.mock("@/app/(protected)/workorders/_components/list/table/cells/vendor-cell", () => ({
VendorCell: () => null,
}));
@@ -155,6 +152,39 @@ describe("SlideOverInfoTabEditView additional contacts", () => {
expect(screen.queryByText("Renamed Service")).not.toBeInTheDocument();
});
+ it("keeps a completed slide-over's saved label after its active service is renamed", () => {
+ renderWithProviders(
+ ,
+ { withAuth: false },
+ );
+
+ expect(screen.getByText("Saved Completed Label")).toBeInTheDocument();
+ expect(screen.queryByText("Current Active Name")).not.toBeInTheDocument();
+ });
+
it("saves an incompatible type change only after clearing the registry service", () => {
const baseline = baseRow({ type: "PM", pm: "PM only", serviceId: 701 });
const onSave = vi.fn();