mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-17 15:19:00 +02:00
refactor(views): remove Runtimes tab CLI-update red dot (#5228)
The sidebar Runtimes nav item showed a red dot (introduced in #533) whenever the current user owned a local, CLI-launched runtime whose reported cli_version was older than the latest GitHub release. Remove the dot and the now-unused useMyRuntimesNeedUpdate hook. The per-runtime update indicator on the Runtimes page (useUpdatableRuntimeIds) is unchanged. Co-authored-by: Lambda <lambda@multica.ai> Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
@@ -41,23 +41,6 @@ function runtimeNeedsUpdate(
|
||||
return isNewer(latestVersion, cliVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the current user has any local runtime with an outdated CLI version.
|
||||
* Accepts wsId as parameter so callers outside WorkspaceIdProvider can use it safely.
|
||||
*/
|
||||
export function useMyRuntimesNeedUpdate(wsId: string | undefined): boolean {
|
||||
const userId = useAuthStore((s) => s.user?.id);
|
||||
const { data: runtimes } = useQuery({
|
||||
...runtimeListOptions(wsId ?? ""),
|
||||
enabled: !!wsId,
|
||||
});
|
||||
const { data: latestVersion } = useQuery(latestCliVersionOptions());
|
||||
|
||||
if (!runtimes || !latestVersion || !userId) return false;
|
||||
|
||||
return runtimes.some((rt) => runtimeNeedsUpdate(rt, latestVersion, userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Set of runtime IDs that belong to the current user and have updates available.
|
||||
* Accepts wsId as parameter so callers outside WorkspaceIdProvider can use it safely.
|
||||
|
||||
@@ -149,7 +149,6 @@ vi.mock("@multica/core/modals", () => ({ useModalStore: { getState: () => ({ mod
|
||||
vi.mock("@multica/core/pins/mutations", () => ({ useDeletePin: () => ({ mutate: deletePin }), useReorderPins: () => ({ mutate: vi.fn() }) }));
|
||||
vi.mock("@multica/core/pins/queries", () => ({ pinListOptions: () => ({ queryKey: ["pins"] }) }));
|
||||
vi.mock("@multica/core/projects/queries", () => ({ projectDetailOptions: () => ({ queryKey: ["project"] }) }));
|
||||
vi.mock("@multica/core/runtimes/hooks", () => ({ useMyRuntimesNeedUpdate: () => false }));
|
||||
vi.mock("@multica/core/workspace/queries", () => ({
|
||||
myInvitationListOptions: () => ({ queryKey: ["invitations"] }),
|
||||
workspaceKeys: { myInvitations: () => ["invitations"] },
|
||||
|
||||
@@ -76,7 +76,6 @@ import { chatSessionsOptions } from "@multica/core/chat/queries";
|
||||
import { api, ApiError } from "@multica/core/api";
|
||||
import { useModalStore } from "@multica/core/modals";
|
||||
import { useConfigStore } from "@multica/core/config";
|
||||
import { useMyRuntimesNeedUpdate } from "@multica/core/runtimes/hooks";
|
||||
import { pinListOptions } from "@multica/core/pins/queries";
|
||||
import { useDeletePin, useReorderPins } from "@multica/core/pins/mutations";
|
||||
import { issueDetailOptions } from "@multica/core/issues/queries";
|
||||
@@ -394,7 +393,6 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
|
||||
// Which workspaces have unread, so the switcher dropdown can point at the
|
||||
// specific one(s) rather than just the aggregate avatar dot.
|
||||
const unreadWsIds = React.useMemo(() => unreadWorkspaceIds(unreadSummary), [unreadSummary]);
|
||||
const hasRuntimeUpdates = useMyRuntimesNeedUpdate(wsId);
|
||||
const { data: pinnedItems = EMPTY_PINS } = useQuery({
|
||||
...pinListOptions(wsId ?? "", userId ?? ""),
|
||||
enabled: !!wsId && !!userId,
|
||||
@@ -772,9 +770,6 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }
|
||||
>
|
||||
<item.icon />
|
||||
<span>{t(($) => $.nav[item.labelKey])}</span>
|
||||
{item.key === "runtimes" && hasRuntimeUpdates && (
|
||||
<span className="ml-auto size-1.5 rounded-full bg-destructive" />
|
||||
)}
|
||||
</SidebarMenuButton>
|
||||
</SidebarMenuItem>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user