Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

style(ai): prettier-wrap the assistant discoverability files from 817aaeabc

rcourtman9e88c0dfcb77
diff --git a/frontend-modern/src/components/AI/Chat/ChatMessages.tsx b/frontend-modern/src/components/AI/Chat/ChatMessages.tsx
index 465f6947d2..e6f3adf91c 100644
--- a/frontend-modern/src/components/AI/Chat/ChatMessages.tsx
+++ b/frontend-modern/src/components/AI/Chat/ChatMessages.tsx
@@ -276,7 +276,11 @@ export const ChatMessages: Component<ChatMessagesProps> = (props) => {
onScroll={updatePinnedToBottom}
>
<Show when={props.messages.length === 0 && props.onSuggestedPrompt}>
- <section class="mb-4 w-full" aria-label="Assistant welcome" data-testid="assistant-welcome">
+ <section
+ class="mb-4 w-full"
+ aria-label="Assistant welcome"
+ data-testid="assistant-welcome"
+ >
<p class="text-sm text-base-content">
Ask about your infrastructure. The Assistant sees your live inventory, metrics, and
alerts, and can dig into problems with you.
diff --git a/frontend-modern/src/components/AI/Chat/__tests__/ChatMessages.test.tsx b/frontend-modern/src/components/AI/Chat/__tests__/ChatMessages.test.tsx
index 0dd0bc2fc8..25d40557f0 100644
--- a/frontend-modern/src/components/AI/Chat/__tests__/ChatMessages.test.tsx
+++ b/frontend-modern/src/components/AI/Chat/__tests__/ChatMessages.test.tsx
@@ -412,9 +412,7 @@ describe('ChatMessages', () => {
makeMessage({ id: 'u2', role: 'user', content: 'second prompt' }),
makeMessage({ id: 'a2', role: 'assistant', content: 'second answer' }),
];
- render(() => (
- <ChatMessages messages={messages} {...handlers} onRegenerate={onRegenerate} />
- ));
+ render(() => <ChatMessages messages={messages} {...handlers} onRegenerate={onRegenerate} />);
const earlier = capturedMessageItemProps.find((p) => p.message.id === 'a1');
const last = capturedMessageItemProps.find((p) => p.message.id === 'a2');
@@ -465,9 +463,7 @@ describe('ChatMessages', () => {
makeMessage({ id: 'a2', role: 'assistant', content: 'second answer' }),
makeMessage({ id: 'q1', role: 'user', content: 'queued follow-up', delivery: 'queued' }),
];
- render(() => (
- <ChatMessages messages={messages} {...handlers} onEditPrompt={onEditPrompt} />
- ));
+ render(() => <ChatMessages messages={messages} {...handlers} onEditPrompt={onEditPrompt} />);
const earlier = capturedMessageItemProps.find((p) => p.message.id === 'u1');
const latest = capturedMessageItemProps.find((p) => p.message.id === 'u2');
diff --git a/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx b/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx
index ea99b52652..23db35c08c 100644
--- a/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/AISettings.test.tsx
@@ -233,9 +233,7 @@ describe('AISettings model loading error states', () => {
}),
).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Show connector setup' })).toBeInTheDocument();
- expect(
- screen.queryByRole('heading', { name: 'Connector setup' }),
- ).not.toBeInTheDocument();
+ expect(screen.queryByRole('heading', { name: 'Connector setup' })).not.toBeInTheDocument();
expect(screen.queryByRole('link', { name: 'Create token' })).not.toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: 'Show connector setup' }));
@@ -312,9 +310,7 @@ describe('AISettings model loading error states', () => {
expect(await screen.findByText('Patrol mode')).toBeInTheDocument();
expect(screen.getByText(/This install runs Watch only/i)).toBeInTheDocument();
- expect(
- screen.queryByText(/Choose a Patrol mode on the Patrol page/i),
- ).not.toBeInTheDocument();
+ expect(screen.queryByText(/Choose a Patrol mode on the Patrol page/i)).not.toBeInTheDocument();
expect(screen.getByRole('button', { name: /Open Patrol/i })).toBeInTheDocument();
});
@@ -574,7 +570,9 @@ describe('AISettings model loading error states', () => {
expect(getSettingsMock).toHaveBeenCalledTimes(1);
});
- expect(screen.queryByRole('option', { name: /Allow chat-only actions/i })).not.toBeInTheDocument();
+ expect(
+ screen.queryByRole('option', { name: /Allow chat-only actions/i }),
+ ).not.toBeInTheDocument();
});
it('keeps an existing autonomous setting visible even when upgrade prompts are hidden', async () => {
@@ -680,9 +678,7 @@ describe('AISettings service context persistence', () => {
renderComponent('discovery');
await waitFor(() => {
- expect(
- screen.getByRole('button', { name: /Service Context Auto 24h/i }),
- ).toBeInTheDocument();
+ expect(screen.getByRole('button', { name: /Service Context Auto 24h/i })).toBeInTheDocument();
});
fireEvent.click(screen.getByRole('button', { name: /Service Context Auto 24h/i }));
const intervalSelect = screen.getByLabelText('Scan Interval');
@@ -854,10 +850,7 @@ describe('AISettings OpenRouter flow', () => {
await waitFor(() => {
expect(testProviderMock).toHaveBeenCalledTimes(1);
- expect(testProviderMock).toHaveBeenCalledWith(
- 'openrouter',
- 'openrouter:openai/gpt-4o-mini',
- );
+ expect(testProviderMock).toHaveBeenCalledWith('openrouter', 'openrouter:openai/gpt-4o-mini');
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 75eacacc59..a3848b426c 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -705,9 +705,7 @@ describe('settings architecture guardrails', () => {
// assistantEnabled capability so the launcher and handoff buttons
// appear (or disappear) mid-session, and first-time setup must open
// the Assistant drawer at the moment of maximum intent.
- const refreshCalls = aiSettingsStateSource.match(
- /aiChatStore\.refreshEnabledFromServer\(\)/g,
- );
+ const refreshCalls = aiSettingsStateSource.match(/aiChatStore\.refreshEnabledFromServer\(\)/g);
expect(refreshCalls?.length ?? 0).toBeGreaterThanOrEqual(3);
expect(aiSettingsStateSource).toContain('aiChatStore.open()');
expect(aiSettingsStateSource).not.toContain(
diff --git a/frontend-modern/src/stores/aiChat.ts b/frontend-modern/src/stores/aiChat.ts
index 599a1839c9..0070f31ea9 100644
--- a/frontend-modern/src/stores/aiChat.ts
+++ b/frontend-modern/src/stores/aiChat.ts
@@ -80,14 +80,7 @@ export interface AIChatContext {
}
export type AIChatCommandRequestAction =
- | 'help'
- | 'new'
- | 'sessions'
- | 'models'
- | 'providers'
- | 'status'
- | 'undo'
- | 'redo';
+ 'help' | 'new' | 'sessions' | 'models' | 'providers' | 'status' | 'undo' | 'redo';
export interface AIChatCommandRequest {
id: number;
@@ -175,8 +168,9 @@ const saveMessagesToStorage = (msgs: Message[]) => {
// Global state for the AI chat drawer
const [isAIChatOpen, setIsAIChatOpen] = createSignal(false);
const [aiChatContext, setAIChatContext] = createSignal<AIChatContext>({});
-const [aiChatCommandRequest, setAIChatCommandRequest] =
- createSignal<AIChatCommandRequest | null>(null);
+const [aiChatCommandRequest, setAIChatCommandRequest] = createSignal<AIChatCommandRequest | null>(
+ null,
+);
const [contextItems, setContextItems] = createSignal<ContextItem[]>([]);
const [messages, setMessages] = createSignal<Message[]>(loadMessagesFromStorage());
const [aiEnabled, setAiEnabled] = createSignal<boolean | null>(null); // null = not checked yet