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: #866

Louis Beaumont4b926cebecfd
diff --git a/screenpipe-app-tauri/components/header.tsx b/screenpipe-app-tauri/components/header.tsx
index cab0b36b8..2a04ec4b8 100644
--- a/screenpipe-app-tauri/components/header.tsx
+++ b/screenpipe-app-tauri/components/header.tsx
@@ -121,6 +121,11 @@ export default function Header() {
});
};
+ const handleClearAll = async () => {
+ setMessages([]);
+ await localforage.setItem("inboxMessages", []);
+ };
+
const { setShowOnboarding } = useOnboarding();
const { setShowChangelogDialog } = useChangelogDialog();
@@ -257,6 +262,7 @@ export default function Header() {
messages={messages}
onMessageRead={handleMessageRead}
onMessageDelete={handleMessageDelete}
+ onClearAll={handleClearAll}
onClose={() => setShowInbox(false)}
/>
</div>
diff --git a/screenpipe-app-tauri/components/inbox-messages.tsx b/screenpipe-app-tauri/components/inbox-messages.tsx
index 327f2ef5d..5e316a706 100644
--- a/screenpipe-app-tauri/components/inbox-messages.tsx
+++ b/screenpipe-app-tauri/components/inbox-messages.tsx
@@ -55,6 +55,7 @@ interface InboxMessagesProps {
messages: Message[];
onMessageRead: (id: string) => void;
onMessageDelete: (id: string) => void;
+ onClearAll: () => void;
onClose: () => void;
}
@@ -181,6 +182,7 @@ export function InboxMessages({
messages,
onMessageRead,
onMessageDelete,
+ onClearAll,
onClose,
}: InboxMessagesProps) {
const [expandedMessages, setExpandedMessages] = useState<Set<string>>(
@@ -290,15 +292,26 @@ export function InboxMessages({
<CardHeader className="flex flex-row items-center justify-between">
<h2 className="text-lg font-semibold">inbox messages</h2>
{unreadMessages.length > 0 && (
- <Button
- variant="outline"
- size="sm"
- onClick={handleMarkAllAsRead}
- className="text-xs"
- >
- <CheckSquare className="mr-1 h-4 w-4" />
- mark all as read
- </Button>
+ <div className="flex space-x-2">
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={handleMarkAllAsRead}
+ className="text-xs"
+ >
+ <CheckSquare className="mr-1 h-4 w-4" />
+ mark all as read
+ </Button>
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={onClearAll}
+ className="text-xs"
+ >
+ <X className="mr-1 h-4 w-4" />
+ clear all
+ </Button>
+ </div>
)}
</CardHeader>
<CardContent className="min-h-[200px] w-[45vw]" ref={parentRef}>