Skip to content

πŸ™Œ OpenHands: AI-Driven Development

fix: link home automation rows to the automation view (#17466)

Hiep Le9f5c8fe0af8a
diff --git a/__tests__/components/features/home/featured-automations-section.test.tsx b/__tests__/components/features/home/featured-automations-section.test.tsx
index 2b38cf9369..346c20f623 100644
--- a/__tests__/components/features/home/featured-automations-section.test.tsx
+++ b/__tests__/components/features/home/featured-automations-section.test.tsx
@@ -276,7 +276,7 @@ describe("home automations composer layout", () => {
);
});
- it("lists enabled automations with live run status and conversation links", async () => {
+ it("lists enabled automations with live run status and automation links", async () => {
vi.mocked(AutomationService.getAutomations).mockResolvedValue({
automations: [
makeAutomation({ id: "auto-1", name: "Daily digest" }),
@@ -320,7 +320,7 @@ describe("home automations composer layout", () => {
expect(screen.getByRole("link", { name: /Daily digest/ })).toHaveAttribute(
"href",
- "/conversations/conv-1",
+ "/automations/auto-1",
);
expect(screen.getByRole("link", { name: /PR review/ })).toHaveAttribute(
"href",
diff --git a/src/components/features/home/featured-automations/home-automation-activity.ts b/src/components/features/home/featured-automations/home-automation-activity.ts
index f2ac91ee00..b530c07685 100644
--- a/src/components/features/home/featured-automations/home-automation-activity.ts
+++ b/src/components/features/home/featured-automations/home-automation-activity.ts
@@ -1,5 +1,6 @@
import type { LatestAutomationRunState } from "#/hooks/query/use-latest-automation-runs";
import { I18nKey } from "#/i18n/declaration";
+import { automationDetailPath } from "#/manifests/automation-interface";
import { AutomationRunStatus, type Automation } from "#/types/automation";
import {
getAutomationRunDisplay,
@@ -20,7 +21,6 @@ export interface HomeAutomationActivityItem {
status: AutomationRunBadgeStatus | null;
/** Relative time label, or null when there is no usable timestamp. */
whenLabel: string | null;
- conversationId: string | null;
}
type Translate = (key: I18nKey, options?: Record<string, unknown>) => string;
@@ -41,7 +41,6 @@ export function buildHomeAutomationActivityItem(
triggerSummary: getTriggerSummary(automation),
status: display?.badgeStatus ?? null,
whenLabel: timestamp ? formatRelativeTime(timestamp, locale, t) : null,
- conversationId: latestRun?.conversation_id ?? null,
};
}
@@ -89,8 +88,10 @@ export function buildHomeAutomationActivityItems(
);
}
+/**
+ * Home rows always open the automation view. Run conversations belong to the
+ * automation's creator, so linking to them 404s for other org members.
+ */
export function hrefForActivityItem(item: HomeAutomationActivityItem): string {
- return item.conversationId
- ? `/conversations/${item.conversationId}`
- : `/automations/${item.id}`;
+ return automationDetailPath(item.id);
}