From 29ef10877a39ec873ec6a6bd7d75ea72c1169d97 Mon Sep 17 00:00:00 2001
From: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Date: Thu, 27 Aug 2026 19:32:39 -0700
Subject: [PATCH] Rename `note` to `moveWarning` for automation host moves
Clarifies that the field specifically warns when an automation would move to another host, replacing the plain storage line.
---
.../AutomationDestinationField.test.tsx | 18 ++++++++++++------
.../automations/AutomationDestinationField.tsx | 4 ++--
...AutomationsPage.create-destination.test.tsx | 4 ++--
.../components/automations/AutomationsPage.tsx | 2 +-
.../use-automation-create-destination.ts | 4 ++--
5 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/src/renderer/src/components/automations/AutomationDestinationField.test.tsx b/src/renderer/src/components/automations/AutomationDestinationField.test.tsx
index 48eff9cc900..29d71acf0b8 100644
--- a/src/renderer/src/components/automations/AutomationDestinationField.test.tsx
+++ b/src/renderer/src/components/automations/AutomationDestinationField.test.tsx
@@ -62,11 +62,11 @@ const LEGACY_ENTRY: AutomationHostCatalogEntry = {
function control(
projects: Repo[],
entries: AutomationHostCatalogEntry[] = [ENTRY],
- note?: string
+ moveWarning?: string
): AutomationCreateDestinationControl {
return {
entries,
- note,
+ moveWarning,
resolution: {
status: 'ready',
authority: OWNER.authority,
@@ -78,11 +78,15 @@ function control(
}
}
-function render(projects: Repo[], entries?: AutomationHostCatalogEntry[], note?: string): void {
+function render(
+ projects: Repo[],
+ entries?: AutomationHostCatalogEntry[],
+ moveWarning?: string
+): void {
act(() => {
root.render(
- {control.note} + {control.moveWarning}
) : (diff --git a/src/renderer/src/components/automations/AutomationsPage.create-destination.test.tsx b/src/renderer/src/components/automations/AutomationsPage.create-destination.test.tsx index fdfdb7d7ff0..a0778029ef9 100644 --- a/src/renderer/src/components/automations/AutomationsPage.create-destination.test.tsx +++ b/src/renderer/src/components/automations/AutomationsPage.create-destination.test.tsx @@ -464,7 +464,7 @@ describe('AutomationsPage edit destination', () => { expect(mocks.editorDialog?.editDestination?.entries.map((entry) => entry.stableKey)).toContain( RUNTIME_SELF_KEY ) - expect(mocks.editorDialog?.editDestination?.note).toBeFalsy() + expect(mocks.editorDialog?.editDestination?.moveWarning).toBeFalsy() }) it('moves the record across authorities by creating there and deleting here', async () => { @@ -484,7 +484,7 @@ describe('AutomationsPage edit destination', () => { mocks.editorDialog?.editDestination?.onSelect(RUNTIME_SELF_KEY) }) - expect(mocks.editorDialog?.editDestination?.note).toBeTruthy() + expect(mocks.editorDialog?.editDestination?.moveWarning).toBeTruthy() await act(async () => { mocks.editorDialog?.onDraftChange((current) => ({ diff --git a/src/renderer/src/components/automations/AutomationsPage.tsx b/src/renderer/src/components/automations/AutomationsPage.tsx index 69d69c815ea..1ff12cf347a 100644 --- a/src/renderer/src/components/automations/AutomationsPage.tsx +++ b/src/renderer/src/components/automations/AutomationsPage.tsx @@ -1143,7 +1143,7 @@ export default function AutomationsPage(): React.JSX.Element { onSelect: handleEditHostChange, projects: editHostProjects, // Replacer fn: a literal replacement would expand `$` patterns in host labels. - note: editMoveTargetEntry + moveWarning: editMoveTargetEntry ? translate( 'auto.components.automations.createDestination.move', 'Saving creates this automation on {host} and deletes the original and its run history.' diff --git a/src/renderer/src/components/automations/use-automation-create-destination.ts b/src/renderer/src/components/automations/use-automation-create-destination.ts index 9ae52aa6729..a47faa37c71 100644 --- a/src/renderer/src/components/automations/use-automation-create-destination.ts +++ b/src/renderer/src/components/automations/use-automation-create-destination.ts @@ -35,8 +35,8 @@ export type AutomationCreateDestinationControl = { onSelect: (stableKey: string) => void /** Projects the resolved destination can hold; the whole list until one resolves. */ projects: readonly Repo[] - /** Stated consequence of saving here, when it is not the plain one. */ - note?: string | null + /** Set when saving would move the record to another host; replaces the plain line. */ + moveWarning?: string | null } export type AutomationCreateDestinationCheck =