Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(views): drop the uncleared Autopilots rail dot (MUL-8533) (#9853)

Jiayuan Zhang24b54bc09ceb
diff --git a/packages/views/layout/app-rail.test.tsx b/packages/views/layout/app-rail.test.tsx
index 14006785fe..d9b44f2927 100644
--- a/packages/views/layout/app-rail.test.tsx
+++ b/packages/views/layout/app-rail.test.tsx
@@ -14,7 +14,6 @@ const state = vi.hoisted(() => ({
chatSessions: [] as { id: string; unread_count?: number }[],
chat: { activeSessionId: null as string | null, isOpen: false },
stuck: [] as unknown[],
- failingAutopilots: [] as unknown[],
}));
vi.mock("../navigation", () => ({
@@ -61,9 +60,6 @@ vi.mock("../common/use-app-foreground", () => ({
vi.mock("./panels/team-status", () => ({
useTeamAgentStatus: () => ({ stuck: state.stuck }),
}));
-vi.mock("./panels/autopilots-panel", () => ({
- useFailingAutopilots: () => state.failingAutopilots,
-}));
vi.mock("./rail-workspaces", () => ({ RailWorkspaces: () => null }));
vi.mock("./help-launcher", () => ({ HelpLauncher: () => null }));
vi.mock("./account-menu", () => ({ AccountMenu: () => null }));
@@ -108,7 +104,6 @@ beforeEach(() => {
state.chatSessions = [];
state.chat = { activeSessionId: null, isOpen: false };
state.stuck = [];
- state.failingAutopilots = [];
});
describe("AppRail global actions", () => {
@@ -160,18 +155,15 @@ describe("AppRail badges", () => {
expect(badge?.animated).toBe(false);
});
- it("shows no attention dots when nothing needs a look", () => {
+ it("shows no attention dot when nothing needs a look", () => {
renderRail();
expect(link("/acme/agents")?.querySelector(".bg-warning")).toBeNull();
- expect(link("/acme/autopilots")?.querySelector(".bg-destructive")).toBeNull();
});
- it("flags Team when an agent is stuck and Autopilot when a run failed", () => {
+ it("flags Team when an agent is stuck", () => {
state.stuck = [{ id: "agent-1" }];
- state.failingAutopilots = [{ id: "ap-1" }];
renderRail();
expect(link("/acme/agents")?.querySelector(".bg-warning")).not.toBeNull();
- expect(link("/acme/autopilots")?.querySelector(".bg-destructive")).not.toBeNull();
});
});
diff --git a/packages/views/layout/app-rail.tsx b/packages/views/layout/app-rail.tsx
index 5b9e1c20c7..cb361c9703 100644
--- a/packages/views/layout/app-rail.tsx
+++ b/packages/views/layout/app-rail.tsx
@@ -25,7 +25,6 @@ import { useAppShell } from "./app-shell-context";
import { NewIssueButton, SearchButton } from "./global-actions";
import { HelpLauncher } from "./help-launcher";
import { isPathWithin } from "./panel-nav";
-import { useFailingAutopilots } from "./panels/autopilots-panel";
import { useTeamAgentStatus } from "./panels/team-status";
import { RAIL_ICON_BUTTON_CLASS } from "./rail-styles";
import { RailWorkspaces } from "./rail-workspaces";
@@ -33,11 +32,12 @@ import { routeIconForPath } from "./route-icon-components";
type RailBadge =
| { kind: "count"; value: number; tone: "brand" | "neutral" }
- | { kind: "dot"; tone: "warning" | "destructive" };
+ | { kind: "dot" };
/**
- * Rail badges. Inbox and Chat count unread; Team and Autopilots only flag
- * that something needs a look — the panel says what.
+ * Rail badges. Inbox and Chat count unread; Team only flags that something
+ * needs a look — the panel says what. A dot must be something the user can
+ * clear, so a failed autopilot run is shown in the Autopilots panel only.
*/
function useRailBadges(): Partial<Record<RailSpaceId, RailBadge>> {
const wsId = useCurrentWorkspace()?.id;
@@ -68,13 +68,11 @@ function useRailBadges(): Partial<Record<RailSpaceId, RailBadge>> {
);
const { stuck } = useTeamAgentStatus(wsId);
- const failingAutopilots = useFailingAutopilots(wsId);
const badges: Partial<Record<RailSpaceId, RailBadge>> = {};
if (inboxUnread > 0) badges.inbox = { kind: "count", value: inboxUnread, tone: "brand" };
if (chatUnread > 0) badges.chat = { kind: "count", value: chatUnread, tone: "neutral" };
- if (stuck.length > 0) badges.team = { kind: "dot", tone: "warning" };
- if (failingAutopilots.length > 0) badges.autopilots = { kind: "dot", tone: "destructive" };
+ if (stuck.length > 0) badges.team = { kind: "dot" };
return badges;
}
@@ -86,9 +84,8 @@ function RailBadgeMark({ badge }: { badge: RailBadge }) {
<span
aria-hidden
className={cn(
- "absolute top-1.5 right-3.5 size-2 rounded-full",
+ "absolute top-1.5 right-3.5 size-2 rounded-full bg-warning",
ring,
- badge.tone === "warning" ? "bg-warning" : "bg-destructive",
)}
/>
);
diff --git a/packages/views/layout/panels/autopilots-panel.tsx b/packages/views/layout/panels/autopilots-panel.tsx
index f053621374..9710806fd1 100644
--- a/packages/views/layout/panels/autopilots-panel.tsx
+++ b/packages/views/layout/panels/autopilots-panel.tsx
@@ -37,19 +37,10 @@ const TRIGGER_ICONS: Record<string, typeof Zap> = {
};
/** Last run failed on an autopilot that is still meant to run. */
-export function isAutopilotFailing(autopilot: Autopilot): boolean {
+function isAutopilotFailing(autopilot: Autopilot): boolean {
return autopilot.status === "active" && autopilot.last_run_status === "failed";
}
-/** Workspace autopilots that need attention, for the rail badge and the panel. */
-export function useFailingAutopilots(wsId: string | undefined) {
- const { data: autopilots = EMPTY_AUTOPILOTS } = useQuery({
- ...autopilotListOptions(wsId ?? ""),
- enabled: !!wsId,
- });
- return useMemo(() => autopilots.filter(isAutopilotFailing), [autopilots]);
-}
-
function hasDescription(autopilot: Autopilot): boolean {
return (
isAutopilotFailing(autopilot) ||