refresh views after assistant changes

This commit is contained in:
ajnart committed 2026-08-03 13:38:20 +02:00
1 parent 8dd1d70900
commit c81a3b9432
14 files changed
+343 -7

No files matched your search

@@ -3,6 +3,7 @@ interface AssistantBrowserToolDependencies {
navigate: (path: string) => void;
openCommandMenu: () => void;
openMediaRequestSearch: () => void;
refreshCurrentView: () => Promise<void>;
}
export const resolveAssistantInternalRoute = (path: string, origin: string) => {
@@ -19,6 +20,7 @@ export const createAssistantBrowserToolExecutors = ({
navigate,
openCommandMenu,
openMediaRequestSearch,
refreshCurrentView,
}: AssistantBrowserToolDependencies) => ({
navigate_to_route: async ({ path }: { path: string }) => {
const internalPath = resolveAssistantInternalRoute(path, getOrigin());
@@ -37,6 +39,14 @@ export const createAssistantBrowserToolExecutors = ({
openMediaRequestSearch();
return { success: true as const };
},
refresh_current_view: async () => {
try {
await refreshCurrentView();
return { success: true as const };
} catch {
return { success: false as const, error: "The current Homarr view could not be refreshed." };
}
},
});
export type AssistantBrowserToolExecutors = ReturnType<typeof createAssistantBrowserToolExecutors>;