Cleanup UI and prompt

This commit is contained in:
Nicolas Mowen 2026-02-17 20:18:50 -07:00
parent d4630c62ca
commit 361dcc94c8
3 changed files with 27 additions and 16 deletions

View File

@ -221,7 +221,7 @@ async def _execute_search_objects(
query_params = EventsQueryParams( query_params = EventsQueryParams(
cameras=arguments.get("camera", "all"), cameras=arguments.get("camera", "all"),
labels=arguments.get("label", "all"), labels=arguments.get("label", "all"),
sub_labels=arguments.get("sub_label", "all"), sub_labels=arguments.get("sub_label", "all").lower(),
zones=zones, zones=zones,
zone=zones, zone=zones,
after=after, after=after,
@ -577,6 +577,8 @@ async def chat_completion(
Current server local date and time: {current_date_str} at {current_time_str} Current server local date and time: {current_date_str} at {current_time_str}
Do not start your response with phrases like "I will check...", "Let me see...", or "Let me look...". Answer directly.
Always present times to the user in the server's local timezone. When tool results include start_time_local and end_time_local, use those exact strings when listing or describing detection times—do not convert or invent timestamps. Do not use UTC or ISO format with Z for the user-facing answer unless the tool result only provides Unix timestamps without local time fields. Always present times to the user in the server's local timezone. When tool results include start_time_local and end_time_local, use those exact strings when listing or describing detection times—do not convert or invent timestamps. Do not use UTC or ISO format with Z for the user-facing answer unless the tool result only provides Unix timestamps without local time fields.
When users ask about "today", "yesterday", "this week", etc., use the current date above as reference. When users ask about "today", "yesterday", "this week", etc., use the current date above as reference.
When searching for objects or events, use ISO 8601 format for dates (e.g., {current_date_str}T00:00:00Z for the start of today). When searching for objects or events, use ISO 8601 format for dates (e.g., {current_date_str}T00:00:00Z for the start of today).

View File

@ -19,6 +19,7 @@ type MessageBubbleProps = {
content: string; content: string;
messageIndex?: number; messageIndex?: number;
onEditSubmit?: (messageIndex: number, newContent: string) => void; onEditSubmit?: (messageIndex: number, newContent: string) => void;
isComplete?: boolean;
}; };
export function MessageBubble({ export function MessageBubble({
@ -26,6 +27,7 @@ export function MessageBubble({
content, content,
messageIndex = 0, messageIndex = 0,
onEditSubmit, onEditSubmit,
isComplete = true,
}: MessageBubbleProps) { }: MessageBubbleProps) {
const { t } = useTranslation(["views/chat", "common"]); const { t } = useTranslation(["views/chat", "common"]);
const isUser = role === "user"; const isUser = role === "user";
@ -152,21 +154,25 @@ export function MessageBubble({
</TooltipContent> </TooltipContent>
</Tooltip> </Tooltip>
)} )}
<Tooltip> {isComplete && (
<TooltipTrigger asChild> <Tooltip>
<Button <TooltipTrigger asChild>
variant="ghost" <Button
size="icon" variant="ghost"
className="size-7 text-muted-foreground hover:text-foreground" size="icon"
onClick={handleCopy} className="size-7 text-muted-foreground hover:text-foreground"
disabled={!content?.trim()} onClick={handleCopy}
aria-label={t("button.copy", { ns: "common" })} disabled={!content?.trim()}
> aria-label={t("button.copy", { ns: "common" })}
<FaCopy className="size-3" /> >
</Button> <FaCopy className="size-3" />
</TooltipTrigger> </Button>
<TooltipContent>{t("button.copy", { ns: "common" })}</TooltipContent> </TooltipTrigger>
</Tooltip> <TooltipContent>
{t("button.copy", { ns: "common" })}
</TooltipContent>
</Tooltip>
)}
</div> </div>
</div> </div>
); );

View File

@ -104,6 +104,9 @@ export default function ChatPage() {
onEditSubmit={ onEditSubmit={
msg.role === "user" ? handleEditSubmit : undefined msg.role === "user" ? handleEditSubmit : undefined
} }
isComplete={
msg.role === "user" || !isLoading || i < messages.length - 1
}
/> />
</div> </div>
))} ))}