fix(assistant): preserve lazy board boundaries

This commit is contained in:
Thomas Camlong authored and ajnart committed 2026-08-13 19:56:53 +02:00
1 parent 14d426764b
commit 12c436cd5c
6 files changed
+8 -15

No files matched your search

@@ -5,7 +5,7 @@ import { useMemo } from "react";
import dynamic from "next/dynamic"; import dynamic from "next/dynamic";
import { useScopedI18n } from "@homarr/translation/client"; import { useScopedI18n } from "@homarr/translation/client";
import { AssistantWidgetRendererProvider } from "@homarr/widgets"; import { AssistantWidgetRendererProvider } from "@homarr/widgets/assistant/context";
import { AssistantContext } from "./assistant-context"; import { AssistantContext } from "./assistant-context";
import { AssistantBoardWidgetLazy } from "./assistant-widget-lazy"; import { AssistantBoardWidgetLazy } from "./assistant-widget-lazy";
@@ -20,13 +20,9 @@ import { clientApi, fetchApi } from "@homarr/api/client";
import { createId } from "@homarr/common"; import { createId } from "@homarr/common";
import { hotkeys } from "@homarr/definitions"; import { hotkeys } from "@homarr/definitions";
import { showErrorNotification, showWarningNotification } from "@homarr/notifications"; import { showErrorNotification, showWarningNotification } from "@homarr/notifications";
import { closeSpotlight } from "@homarr/spotlight/store";
import { useScopedI18n } from "@homarr/translation/client"; import { useScopedI18n } from "@homarr/translation/client";
import { import { openMediaRequestSearch, openSpotlight, useRegisterSpotlightContextResults } from "@homarr/spotlight";
closeSpotlight,
openMediaRequestSearch,
openSpotlight,
useRegisterSpotlightContextResults,
} from "@homarr/spotlight";
import { AssistantWidgetRendererProvider } from "@homarr/widgets"; import { AssistantWidgetRendererProvider } from "@homarr/widgets";
import { AssistantContext, AssistantPreferencesContext, useAssistantPreferences } from "./assistant-context"; import { AssistantContext, AssistantPreferencesContext, useAssistantPreferences } from "./assistant-context";
@@ -92,7 +92,7 @@ describe("calendarRouter.findAllEvents", () => {
).rejects.toThrow(); ).rejects.toThrow();
}); });
test("returns an integration-scoped error instead of silently dropping a failed calendar", async () => { test("rejects the query when every selected calendar fails", async () => {
const { caller, integrationId } = await createCallerAsync(); const { caller, integrationId } = await createCallerAsync();
getDataAsync.mockRejectedValueOnce(new Error("remote calendar unavailable")); getDataAsync.mockRejectedValueOnce(new Error("remote calendar unavailable"));
@@ -104,12 +104,6 @@ describe("calendarRouter.findAllEvents", () => {
releaseType: ["inCinemas", "digitalRelease", "physicalRelease"], releaseType: ["inCinemas", "digitalRelease", "physicalRelease"],
showUnmonitored: true, showUnmonitored: true,
}), }),
).resolves.toEqual([ ).rejects.toThrow("All integration queries failed");
{
events: [],
integration: { id: integrationId, name: "Radarr", kind: "radarr" },
error: "Calendar events could not be loaded from this integration.",
},
]);
}); });
}); });
+1
View File
@@ -15,6 +15,7 @@
".": "./index.ts", ".": "./index.ts",
"./component": "./src/component.ts", "./component": "./src/component.ts",
"./open": "./src/open.ts", "./open": "./src/open.ts",
"./store": "./src/spotlight-store.ts",
"./styles.css": "./src/styles.css" "./styles.css": "./src/styles.css"
}, },
"scripts": { "scripts": {
@@ -6,6 +6,7 @@ import { createSpotlight } from "@mantine/spotlight";
import { atom } from "jotai"; import { atom } from "jotai";
export const [spotlightStore, spotlightActions] = createSpotlight(); export const [spotlightStore, spotlightActions] = createSpotlight();
export const closeSpotlight = spotlightActions.close;
export interface MediaRequestSearchScope { export interface MediaRequestSearchScope {
integrationIds?: string[]; integrationIds?: string[];
+1
View File
@@ -17,6 +17,7 @@
"./custom-api/component": "./src/custom-api/component.tsx", "./custom-api/component": "./src/custom-api/component.tsx",
"./custom-api/custom-jsx-display": "./src/custom-api/custom-jsx-display.tsx", "./custom-api/custom-jsx-display": "./src/custom-api/custom-jsx-display.tsx",
"./custom-api/extract-display-data": "./src/custom-api/extract-display-data.ts", "./custom-api/extract-display-data": "./src/custom-api/extract-display-data.ts",
"./assistant/context": "./src/assistant/context.tsx",
"./catalog": "./src/catalog.ts", "./catalog": "./src/catalog.ts",
"./definition": "./src/definition.ts", "./definition": "./src/definition.ts",
"./errors": "./src/errors/component.tsx", "./errors": "./src/errors/component.tsx",