Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix ui

Louis Beaumont4571faf4a0d4
diff --git a/examples/apps/screenpipe-app-tauri/app/page.tsx b/examples/apps/screenpipe-app-tauri/app/page.tsx
index 0210ec327..cd89fe9db 100644
--- a/examples/apps/screenpipe-app-tauri/app/page.tsx
+++ b/examples/apps/screenpipe-app-tauri/app/page.tsx
@@ -118,14 +118,42 @@ import {
import { cn } from "@/lib/utils";
import { LogViewer } from "@/components/log-viewer";
+import { Skeleton } from "@/components/ui/skeleton";
+
export default function Home() {
- const [openAiKey, setOpenAiKey] = useState("");
+ const [openAiKey, setOpenAiKey] = useState<string | null>(null);
+ const [isLoading, setIsLoading] = useState(true);
+
+ useEffect(() => {
+ // Simulate loading settings from disk
+ const loadSettings = async () => {
+ // Replace this with your actual disk loading logic
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+ const savedKey = ""; // Replace with actual loaded key
+ setOpenAiKey(savedKey);
+ setIsLoading(false);
+ };
+ loadSettings();
+ }, []);
return (
<main className="flex min-h-screen flex-col items-center p-8">
<Header onKeyChange={setOpenAiKey} />
- <div className="h-32" />
- {openAiKey ? (
+ {isLoading ? (
+ <div className="flex flex-col items-center justify-center h-full space-y-4">
+ <Skeleton className="w-[200px] h-[24px] rounded-full" />
+ <Skeleton className="w-[300px] h-[20px] rounded-full" />
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4 w-full max-w-2xl">
+ {[...Array(5)].map((_, index) => (
+ <Card key={index}>
+ <CardContent className="p-4">
+ <Skeleton className="w-full h-[40px]" />
+ </CardContent>
+ </Card>
+ ))}
+ </div>
+ </div>
+ ) : openAiKey ? (
<ChatList apiKey={openAiKey} />
) : (
<Card className="w-[350px]">
diff --git a/examples/apps/screenpipe-app-tauri/components/chat-list-openai-v2.tsx b/examples/apps/screenpipe-app-tauri/components/chat-list-openai-v2.tsx
index 2bed4db38..e45d79fa7 100644
--- a/examples/apps/screenpipe-app-tauri/components/chat-list-openai-v2.tsx
+++ b/examples/apps/screenpipe-app-tauri/components/chat-list-openai-v2.tsx
@@ -24,6 +24,7 @@ import { IconOpenAI } from "./ui/icons";
import { spinner } from "./spinner";
import { useScrollAnchor } from "@/lib/hooks/use-scroll-anchor";
import { FunctionCallMessage } from "./function-call-message";
+import { EmptyScreen } from "./empty-screen";
const screenpipeQuery = z.object({
q: z
@@ -32,7 +33,7 @@ const screenpipeQuery = z.object({
"The search query matching exact keywords. Use a single keyword that best matches the user intent"
),
contentType: z
- .enum(["ocr", "audio"])
+ .enum(["ocr", "audio", "all"])
.describe(
"The type of content to search for: screenshot data or audio transcriptions"
),
@@ -141,7 +142,10 @@ export function ChatList({ apiKey }: { apiKey: string }) {
- Do not use '"' around your response
- Date & time now is ${new Date().toISOString()}
- If the user ask about his morning do not use morning as query that's dumb, try to infer some keywords from the user question
-
+ - Very important: your output will be given to another LLM so make sure not to return too much data (typically each row returns lot of data)
+ - Use between 2-5 queries with very different keywords that could maximally match the user's screen text or audio transcript
+ - Use "all" for querying the same keyword over vision and audio
+
Example answers from you:
"{
"queries": [
@@ -234,32 +238,41 @@ export function ChatList({ apiKey }: { apiKey: string }) {
}
};
+ const handleSuggestionClick = (suggestion: string) => {
+ setInputMessage(suggestion);
+ handleSendMessage();
+ };
+
return (
<div className="flex flex-col">
- <div
- className="flex flex-col items-start flex-1 max-w-2xl gap-8 px-4 mx-auto"
- ref={messagesRef}
- >
- {messages.map((msg, index) => {
- if (
- msg.role === "user" ||
- (msg.role === "assistant" && typeof msg.content === "string")
- ) {
- return <ChatMessage key={index} message={msg} />;
- } else if (
- msg.role === "assistant" &&
- msg.content &&
- typeof msg.content === "object"
- ) {
- return <FunctionCallMessage key={index} message={msg} />;
- } else if (msg.role === "tool") {
- return <FunctionCallMessage key={index} message={msg} isResult />;
- }
- return null;
- })}
- {isLoading && <SpinnerMessage />}
- {error && <p className="text-red-500">{error}</p>}
- </div>
+ {messages.length === 0 ? (
+ <EmptyScreen onSuggestionClick={handleSuggestionClick} />
+ ) : (
+ <div
+ className="flex flex-col items-start flex-1 max-w-2xl gap-8 px-4 mx-auto"
+ ref={messagesRef}
+ >
+ {messages.map((msg, index) => {
+ if (
+ msg.role === "user" ||
+ (msg.role === "assistant" && typeof msg.content === "string")
+ ) {
+ return <ChatMessage key={index} message={msg} />;
+ } else if (
+ msg.role === "assistant" &&
+ msg.content &&
+ typeof msg.content === "object"
+ ) {
+ return <FunctionCallMessage key={index} message={msg} />;
+ } else if (msg.role === "tool") {
+ return <FunctionCallMessage key={index} message={msg} isResult />;
+ }
+ return null;
+ })}
+ {isLoading && <SpinnerMessage />}
+ {error && <p className="text-red-500">{error}</p>}
+ </div>
+ )}
{messages.length === 0 && (
<div className="absolute bottom-0 left-0 right-0 bg-background p-4">
@@ -280,7 +293,7 @@ export function ChatList({ apiKey }: { apiKey: string }) {
}
}}
/>
-
+
<Button
type="submit"
size="icon"
diff --git a/examples/apps/screenpipe-app-tauri/components/empty-screen.tsx b/examples/apps/screenpipe-app-tauri/components/empty-screen.tsx
new file mode 100644
index 000000000..b90dd2191
--- /dev/null
+++ b/examples/apps/screenpipe-app-tauri/components/empty-screen.tsx
@@ -0,0 +1,38 @@
+import React from "react";
+import { Card, CardContent } from "@/components/ui/card";
+
+interface EmptyScreenProps {
+ onSuggestionClick: (suggestion: string) => void;
+}
+
+const suggestions = [
+ "Turn my recent conversations with my customers about my product into a table. Use 5 queries. Use 6 hours from now.",
+ "Show me my recent Slack conversations with john about dog food. Only use screen text",
+ "Read my coding stuff (python) and tell me how i can write better python code",
+ "Summarize my recent email activity, only use screen text",
+ "Turn my audio conversations with Lisa into a table, do use 2-3 queries"
+];
+
+export function EmptyScreen({ onSuggestionClick }: EmptyScreenProps) {
+ return (
+ <div className="flex flex-col items-center justify-center h-full space-y-4">
+ <h3 className="text-lg font-semibold">Get started with Screenpipe</h3>
+ <p className="text-sm text-gray-500">
+ Click on a suggestion or type your own query
+ </p>
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4 w-full max-w-2xl">
+ {suggestions.map((suggestion, index) => (
+ <Card
+ key={index}
+ className="cursor-pointer hover:bg-gray-100 transition-colors"
+ onClick={() => onSuggestionClick(suggestion)}
+ >
+ <CardContent className="p-4">
+ <p className="text-sm">{suggestion}</p>
+ </CardContent>
+ </Card>
+ ))}
+ </div>
+ </div>
+ );
+}
diff --git a/examples/apps/screenpipe-app-tauri/components/ui/skeleton.tsx b/examples/apps/screenpipe-app-tauri/components/ui/skeleton.tsx
new file mode 100644
index 000000000..01b8b6d4f
--- /dev/null
+++ b/examples/apps/screenpipe-app-tauri/components/ui/skeleton.tsx
@@ -0,0 +1,15 @@
+import { cn } from "@/lib/utils"
+
+function Skeleton({
+ className,
+ ...props
+}: React.HTMLAttributes<HTMLDivElement>) {
+ return (
+ <div
+ className={cn("animate-pulse rounded-md bg-muted", className)}
+ {...props}
+ />
+ )
+}
+
+export { Skeleton }