Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

feat: enhance AgentChat components with preflight status indicators and improved error messaging

Khuram Niaz7279764eef1a
diff --git a/src/components/agent/AgentChatEmptyState.tsx b/src/components/agent/AgentChatEmptyState.tsx
index 0bf1b43..e60e583 100644
--- a/src/components/agent/AgentChatEmptyState.tsx
+++ b/src/components/agent/AgentChatEmptyState.tsx
@@ -12,7 +12,7 @@ const EXAMPLES = [
];
export function AgentChatEmptyState() {
- const { preflight, prefillComposer } = useAgentChat();
+ const { prefillComposer } = useAgentChat();
return (
<div className="flex flex-1 flex-col justify-end gap-4 p-4">
@@ -25,19 +25,15 @@ export function AgentChatEmptyState() {
or tasks yet.
</p>
- {preflight.checked && !preflight.ok ? (
- <p className="text-sm text-destructive">{preflight.error}</p>
- ) : (
- <Suggestions>
- {EXAMPLES.map((example) => (
- <Suggestion
- key={example}
- onClick={prefillComposer}
- suggestion={example}
- />
- ))}
- </Suggestions>
- )}
+ <Suggestions>
+ {EXAMPLES.map((example) => (
+ <Suggestion
+ key={example}
+ onClick={prefillComposer}
+ suggestion={example}
+ />
+ ))}
+ </Suggestions>
</div>
);
}
diff --git a/src/components/agent/AgentChatInput.tsx b/src/components/agent/AgentChatInput.tsx
index 33fb058..f881332 100644
--- a/src/components/agent/AgentChatInput.tsx
+++ b/src/components/agent/AgentChatInput.tsx
@@ -202,7 +202,7 @@ export function AgentChatInput() {
) : null}
{preflight.checked && !preflight.ok && preflight.error ? (
- <p className="text-xs text-muted-foreground">{preflight.error}</p>
+ <p className="text-xs text-destructive">{preflight.error}</p>
) : null}
{/* No PromptInputBody: it wraps these in a display:contents div, and
diff --git a/src/components/agent/AgentChatPanel.tsx b/src/components/agent/AgentChatPanel.tsx
index fd8e452..fc42738 100644
--- a/src/components/agent/AgentChatPanel.tsx
+++ b/src/components/agent/AgentChatPanel.tsx
@@ -1,12 +1,13 @@
"use client";
-import { Scan, X } from "lucide-react";
+import { CheckCircle, Loader2, Scan, Sparkles, X, XCircle } from "lucide-react";
import { Sheet, SheetContent, SheetTitle } from "@/components/ui/sheet";
import { Button } from "@/components/ui/button";
import { AgentChatEmptyState } from "@/components/agent/AgentChatEmptyState";
import { AgentChatInput } from "@/components/agent/AgentChatInput";
import { AgentChatMessages } from "@/components/agent/AgentChatMessages";
import { useAgentChat } from "@/components/agent/AgentChatProvider";
+import { AiProvider } from "@/models/ai.model";
export function AgentChatPanel() {
const {
@@ -18,8 +19,26 @@ export function AgentChatPanel() {
startResize,
isPanelExpanded,
togglePanelExpand,
+ preflight,
} = useAgentChat();
+ // Status icon for the terminal header bar — mirrors AiResumeReviewSection.
+ const statusIcon = !preflight.checked ? (
+ <Loader2 className="h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground" />
+ ) : preflight.provider === AiProvider.OLLAMA ? (
+ preflight.ok ? (
+ <CheckCircle className="h-3.5 w-3.5 shrink-0 text-green-500" />
+ ) : (
+ <XCircle className="h-3.5 w-3.5 shrink-0 text-destructive" />
+ )
+ ) : (
+ <Sparkles className="h-3.5 w-3.5 shrink-0 text-muted-foreground" />
+ );
+
+ const providerLabel = preflight.provider
+ ? preflight.provider.charAt(0).toUpperCase() + preflight.provider.slice(1)
+ : "";
+
return (
<Sheet
open={isOpen}
@@ -60,6 +79,14 @@ export function AgentChatPanel() {
<span className="text-muted-foreground/30 text-xs select-none">
···
</span>
+ <div className="flex items-center gap-1.5 min-w-0">
+ {statusIcon}
+ <span className="text-xs text-muted-foreground font-mono truncate">
+ {preflight.model
+ ? `${providerLabel} / ${preflight.model}`
+ : providerLabel}
+ </span>
+ </div>
{/* Never gated on the approval: it is the way out of a card whose
approvalId the server no longer recognizes. */}
<Button