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: simplify notification cards and disclose secondary controls

louis8eec9d78b6ad
diff --git a/apps/screenpipe-app-tauri/app/notification-panel/page.test.tsx b/apps/screenpipe-app-tauri/app/notification-panel/page.test.tsx
new file mode 100644
index 000000000..43cf43d0c
--- /dev/null
+++ b/apps/screenpipe-app-tauri/app/notification-panel/page.test.tsx
@@ -0,0 +1,137 @@
+// screenpipe — AI that knows everything you've seen, said, or heard
+// https://screenpipe.com
+
+import {
+ act,
+ fireEvent,
+ render,
+ screen,
+ waitFor,
+} from "@testing-library/react";
+import { afterEach, describe, expect, it, vi } from "vitest";
+import NotificationPanelPage from "./page";
+
+const bridge = vi.hoisted(() => ({
+ receive: (_event: { payload: string }) => {},
+ copy: vi.fn().mockResolvedValue(undefined),
+ hide: vi.fn().mockResolvedValue(undefined),
+}));
+vi.mock("@tauri-apps/api/event", () => ({
+ listen: vi.fn((_name, callback) => {
+ bridge.receive = callback;
+ return Promise.resolve(() => {});
+ }),
+ emit: vi.fn().mockResolvedValue(undefined),
+}));
+vi.mock("@/lib/utils/tauri", () => ({
+ commands: {
+ copyTextToClipboard: bridge.copy,
+ hideNotificationPanel: bridge.hide,
+ },
+}));
+vi.mock("posthog-js", () => ({ default: { capture: vi.fn() } }));
+vi.mock("localforage", () => ({
+ default: {
+ getItem: vi.fn().mockResolvedValue([]),
+ setItem: vi.fn().mockResolvedValue(undefined),
+ },
+}));
+vi.mock("@/components/markdown", () => ({
+ notificationUrlTransform: (url: string) => url,
+ openScreenpipeViewerLink: vi.fn(),
+ screenpipeViewerPathFromHref: vi.fn(),
+}));
+vi.mock("@/lib/notifications/actions", () => ({
+ executeNotificationAction: vi.fn(),
+}));
+
+const payload = {
+ id: "compact-notification",
+ type: "pipe",
+ title: "Ready for review",
+ body: "A proposal is ready.",
+ pipe_name: "scaling",
+ autoDismissMs: 0,
+ actions: [
+ {
+ type: "deeplink",
+ label: "Review",
+ primary: true,
+ url: "screenpipe://home",
+ },
+ { type: "dismiss", label: "Dismiss" },
+ ],
+};
+async function deliver(data = payload) {
+ await act(async () => {
+ bridge.receive({ payload: JSON.stringify(data) });
+ });
+}
+
+afterEach(() => {
+ vi.useRealTimers();
+ vi.clearAllMocks();
+});
+
+describe("compact notification panel", () => {
+ it("keeps a single dismissal and reveals utilities and feedback only on request", async () => {
+ render(<NotificationPanelPage />);
+ await deliver();
+ expect(screen.getAllByRole("button", { name: /dismiss/i })).toHaveLength(1);
+ expect(screen.getByRole("button", { name: "Review" })).toBeInTheDocument();
+ fireEvent.mouseEnter(screen.getByText("Ready for review"));
+ expect(
+ screen.queryByRole("button", { name: "copy notification" }),
+ ).not.toBeInTheDocument();
+ expect(
+ screen.queryByRole("button", { name: "useful notification" }),
+ ).not.toBeInTheDocument();
+ fireEvent.click(
+ screen.getByRole("button", { name: "notification options" }),
+ );
+ fireEvent.click(screen.getByRole("button", { name: "copy notification" }));
+ await waitFor(() =>
+ expect(bridge.copy).toHaveBeenCalledWith(
+ "Ready for review\n\nA proposal is ready.",
+ ),
+ );
+ expect(bridge.hide).not.toHaveBeenCalled();
+ fireEvent.click(screen.getByRole("button", { name: "feedback" }));
+ fireEvent.click(
+ screen.getByRole("button", { name: "not useful notification" }),
+ );
+ fireEvent.change(
+ screen.getByRole("textbox", { name: "what should improve" }),
+ { target: { value: "Include the source" } },
+ );
+ fireEvent.mouseLeave(screen.getByText("Ready for review"));
+ expect(
+ screen.getByRole("textbox", { name: "what should improve" }),
+ ).toHaveValue("Include the source");
+ await deliver({ ...payload, id: "next" });
+ expect(screen.queryByRole("textbox")).not.toBeInTheDocument();
+ expect(
+ screen.getByRole("button", { name: "notification options" }),
+ ).toHaveAttribute("aria-expanded", "false");
+ fireEvent.click(
+ screen.getByRole("button", { name: "dismiss notification" }),
+ );
+ expect(bridge.hide).toHaveBeenCalledTimes(1);
+ });
+
+ it("pauses expiration while options are open and resumes when closed", async () => {
+ vi.useFakeTimers();
+ render(<NotificationPanelPage />);
+ await deliver({ ...payload, autoDismissMs: 1000 });
+ fireEvent.click(
+ screen.getByRole("button", { name: "notification options" }),
+ );
+ act(() => vi.advanceTimersByTime(2000));
+ expect(bridge.hide).not.toHaveBeenCalled();
+ fireEvent.click(
+ screen.getByRole("button", { name: "notification options" }),
+ );
+ act(() => vi.advanceTimersByTime(1200));
+ expect(bridge.hide).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/apps/screenpipe-app-tauri/app/notification-panel/page.tsx b/apps/screenpipe-app-tauri/app/notification-panel/page.tsx
index 34831a435..2f02fd792 100644
--- a/apps/screenpipe-app-tauri/app/notification-panel/page.tsx
+++ b/apps/screenpipe-app-tauri/app/notification-panel/page.tsx
@@ -16,7 +16,14 @@ import {
} from "@/components/markdown";
import localforage from "localforage";
import { localFetch } from "@/lib/api";
-import { Bell, Check, Copy, ExternalLink } from "lucide-react";
+import {
+ Bell,
+ Check,
+ Copy,
+ ExternalLink,
+ MoreHorizontal,
+ MessageSquare,
+} from "lucide-react";
import {
executeNotificationAction,
type NotificationAction,
@@ -27,6 +34,7 @@ import {
} from "@/lib/notification-analytics";
import { qualifiedValue } from "@/lib/analytics/qualified-value";
import { NotificationActionButton } from "@/components/notification-action-button";
+import { isNotificationFeedbackEligible } from "@/lib/ai-feedback";
import { NotificationFeedback } from "@/components/notification-feedback";
interface NotificationPayload {
@@ -43,11 +51,7 @@ interface NotificationPayload {
}
type NotificationDismissReason =
- | "auto"
- | "explicit"
- | "action"
- | "source"
- | "manage";
+ "auto" | "explicit" | "action" | "source" | "manage";
function windowForDeeplink(url: string) {
return url.startsWith("screenpipe://meeting/") ||
@@ -87,6 +91,10 @@ function notificationClipboardText(payload: NotificationPayload): string {
export default function NotificationPanelPage() {
const [payload, setPayload] = useState<NotificationPayload | null>(null);
+ const [optionsExpanded, setOptionsExpanded] = useState(false);
+ const [feedbackExpanded, setFeedbackExpanded] = useState(false);
+ const interactingRef = useRef(false);
+ interactingRef.current = optionsExpanded || feedbackExpanded;
const [visible, setVisible] = useState(false);
const [progress, setProgress] = useState(100);
// Incremented on each new notification so the auto-dismiss timer restarts
@@ -133,9 +141,7 @@ export default function NotificationPanelPage() {
const actionObj = typeof actionOrObj === "object" ? actionOrObj : null;
posthog.capture("notification_action", {
- ...notificationActionAnalyticsProperties(
- actionObj?.type ?? actionStr,
- ),
+ ...notificationActionAnalyticsProperties(actionObj?.type ?? actionStr),
...notificationAnalyticsProperties(payload, "toast"),
});
@@ -317,6 +323,8 @@ export default function NotificationPanelPage() {
try {
const data: NotificationPayload = JSON.parse(event.payload);
setPayload(data);
+ setOptionsExpanded(false);
+ setFeedbackExpanded(false);
setVisible(true);
setProgress(100);
setRestartState("idle");
@@ -379,7 +387,7 @@ export default function NotificationPanelPage() {
};
intervalRef.current = setInterval(() => {
- if (hoveredRef.current) {
+ if (hoveredRef.current || interactingRef.current) {
if (!wasHovered) {
// Just entered hover — snapshot elapsed time
elapsedBeforePause += Date.now() - resumedAt;
@@ -405,7 +413,7 @@ export default function NotificationPanelPage() {
// Windows where unfocused webview timers can be throttled to ~1s.
// This ensures the notification always dismisses even if setInterval stalls.
const safetyTimeout = setTimeout(() => {
- if (!hoveredRef.current) {
+ if (!hoveredRef.current && !interactingRef.current) {
doHide();
}
}, totalMs + 2000);
@@ -424,6 +432,10 @@ export default function NotificationPanelPage() {
return null;
}
+ const visibleActions = payload.actions.filter(
+ (action) => (action.type || action.action) !== "dismiss",
+ );
+
return (
<div
className="group/notif"
@@ -437,23 +449,26 @@ export default function NotificationPanelPage() {
>
<div
style={{
- background: "rgba(255, 255, 255, 0.92)",
+ background: "hsl(var(--background) / 0.96)",
+ borderRadius: "8px",
backdropFilter: "blur(20px)",
WebkitBackdropFilter: "blur(20px)",
- border: "1px solid rgba(0, 0, 0, 0.08)",
+ border: "1px solid hsl(var(--foreground) / 0.08)",
width: "100%",
height: "100%",
display: "flex",
flexDirection: "column",
fontFamily: '"IBM Plex Mono", monospace',
- color: "rgba(0, 0, 0, 0.8)",
+ color: "hsl(var(--foreground) / 0.8)",
overflow: "hidden",
position: "relative",
- animation: "slideIn 0.3s ease-out",
- boxShadow: "0 8px 32px rgba(0, 0, 0, 0.12)",
+ animation: "slideIn 0.15s ease-out",
+ boxShadow: "0 4px 16px hsl(var(--foreground) / 0.12)",
}}
>
<style>{`
+ [class~="group/notif"] button:focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
+ @media (prefers-reduced-motion: reduce) { [class~="group/notif"] > div { animation: none !important; } }
@keyframes slideIn {
from {
opacity: 0;
@@ -466,10 +481,10 @@ export default function NotificationPanelPage() {
}
.notif-md p { margin: 0 0 4px 0; }
.notif-md p:last-child { margin: 0; }
- .notif-md strong { color: rgba(0, 0, 0, 0.9); }
- .notif-md a { color: rgba(0, 0, 0, 0.7); text-decoration: underline; }
+ .notif-md strong { color: hsl(var(--foreground) / 0.9); }
+ .notif-md a { color: hsl(var(--foreground) / 0.7); text-decoration: underline; }
.notif-md code {
- background: rgba(0, 0, 0, 0.06);
+ background: hsl(var(--foreground) / 0.06);
padding: 1px 4px;
font-size: 10px;
}
@@ -485,11 +500,11 @@ export default function NotificationPanelPage() {
background: transparent;
}
.notif-body::-webkit-scrollbar-thumb {
- background: rgba(0, 0, 0, 0.15);
+ background: hsl(var(--foreground) / 0.15);
border-radius: 2px;
}
.notif-body::-webkit-scrollbar-thumb:hover {
- background: rgba(0, 0, 0, 0.3);
+ background: hsl(var(--foreground) / 0.3);
}
`}</style>
@@ -510,7 +525,7 @@ export default function NotificationPanelPage() {
fontSize: "10px",
fontWeight: 500,
letterSpacing: "0.05em",
- color: "rgba(0, 0, 0, 0.4)",
+ color: "hsl(var(--foreground) / 0.4)",
textTransform: "lowercase",
}}
>
@@ -524,27 +539,53 @@ export default function NotificationPanelPage() {
/>
screenpipe
</span>
- <button
- onClick={() => hide("explicit")}
- style={{
- background: "none",
- border: "none",
- color: "rgba(0, 0, 0, 0.35)",
- cursor: "pointer",
- padding: "2px",
- fontSize: "14px",
- lineHeight: 1,
- fontFamily: '"IBM Plex Mono", monospace',
- }}
- onMouseEnter={(e) =>
- (e.currentTarget.style.color = "rgba(0, 0, 0, 0.7)")
- }
- onMouseLeave={(e) =>
- (e.currentTarget.style.color = "rgba(0, 0, 0, 0.35)")
- }
- >
- ✕
- </button>
+ <div style={{ display: "flex", alignItems: "center", gap: "4px" }}>
+ <button
+ type="button"
+ aria-label="notification options"
+ aria-expanded={optionsExpanded}
+ onClick={() => setOptionsExpanded((expanded) => !expanded)}
+ style={{
+ display: "grid",
+ placeItems: "center",
+ width: "24px",
+ height: "24px",
+ border: "none",
+ borderRadius: "4px",
+ background: optionsExpanded
+ ? "hsl(var(--foreground) / 0.08)"
+ : "none",
+ color: "hsl(var(--muted-foreground))",
+ cursor: "pointer",
+ }}
+ >
+ <MoreHorizontal size={14} />
+ </button>
+ <button
+ aria-label="dismiss notification"
+ onClick={() => hide("explicit")}
+ style={{
+ background: "none",
+ border: "none",
+ color: "hsl(var(--foreground) / 0.35)",
+ cursor: "pointer",
+ width: "24px",
+ height: "24px",
+ borderRadius: "4px",
+ fontSize: "14px",
+ lineHeight: 1,
+ fontFamily: '"IBM Plex Mono", monospace',
+ }}
+ onMouseEnter={(e) =>
+ (e.currentTarget.style.color = "hsl(var(--foreground) / 0.7)")
+ }
+ onMouseLeave={(e) =>
+ (e.currentTarget.style.color = "hsl(var(--foreground) / 0.35)")
+ }
+ >
+ ✕
+ </button>
+ </div>
</div>
{/* Body */}
@@ -564,7 +605,7 @@ export default function NotificationPanelPage() {
fontSize: "12px",
fontWeight: 500,
marginBottom: "4px",
- color: "rgba(0, 0, 0, 0.9)",
+ color: "hsl(var(--foreground) / 0.9)",
cursor: payload.source_url ? "pointer" : "default",
}}
>
@@ -575,7 +616,7 @@ export default function NotificationPanelPage() {
style={{
fontSize: "11px",
lineHeight: "1.4",
- color: "rgba(0, 0, 0, 0.5)",
+ color: "hsl(var(--foreground) / 0.5)",
userSelect: "text",
}}
>
@@ -605,7 +646,7 @@ export default function NotificationPanelPage() {
}
}}
style={{
- color: "rgba(0, 0, 0, 0.7)",
+ color: "hsl(var(--foreground) / 0.7)",
textDecoration: "underline",
cursor: "pointer",
}}
@@ -627,10 +668,12 @@ export default function NotificationPanelPage() {
}
}}
onMouseEnter={(e) => {
- e.currentTarget.style.color = "rgba(0, 0, 0, 0.85)";
+ e.currentTarget.style.color =
+ "hsl(var(--foreground) / 0.85)";
}}
onMouseLeave={(e) => {
- e.currentTarget.style.color = "rgba(0, 0, 0, 0.35)";
+ e.currentTarget.style.color =
+ "hsl(var(--foreground) / 0.35)";
}}
title="open in default app"
aria-label="open in default app"
@@ -639,7 +682,7 @@ export default function NotificationPanelPage() {
padding: "0 3px",
background: "transparent",
border: "none",
- color: "rgba(0, 0, 0, 0.35)",
+ color: "hsl(var(--foreground) / 0.35)",
fontSize: "10px",
lineHeight: "1",
cursor: "pointer",
@@ -661,7 +704,7 @@ export default function NotificationPanelPage() {
</div>
{/* Actions */}
- {payload.actions.length > 0 && (
+ {visibleActions.length > 0 && (
<div
style={{
display: "flex",
@@ -676,7 +719,7 @@ export default function NotificationPanelPage() {
<span
style={{
fontSize: "10px",
- color: "rgba(0, 0, 0, 0.5)",
+ color: "hsl(var(--foreground) / 0.5)",
fontFamily: '"IBM Plex Mono", monospace',
fontWeight: 500,
}}
@@ -687,7 +730,7 @@ export default function NotificationPanelPage() {
<span
style={{
fontSize: "10px",
- color: "rgba(0, 0, 0, 0.7)",
+ color: "hsl(var(--foreground) / 0.7)",
fontFamily: '"IBM Plex Mono", monospace',
fontWeight: 500,
}}
@@ -698,7 +741,7 @@ export default function NotificationPanelPage() {
<span
style={{
fontSize: "10px",
- color: "rgba(0, 0, 0, 0.7)",
+ color: "hsl(var(--foreground) / 0.7)",
fontFamily: '"IBM Plex Mono", monospace',
fontWeight: 500,
}}
@@ -706,7 +749,7 @@ export default function NotificationPanelPage() {
restart failed{restartError ? `: ${restartError}` : ""}
</span>
) : (
- payload.actions.map((action, index) => {
+ visibleActions.map((action, index) => {
const actionLabel =
action.label ||
(action.type === "copy"
@@ -726,7 +769,7 @@ export default function NotificationPanelPage() {
}
label={actionLabel}
primary={action.primary}
- shareAvailableWidth={payload.actions.length > 1}
+ shareAvailableWidth={visibleActions.length > 1}
/>
);
})
@@ -734,115 +777,145 @@ export default function NotificationPanelPage() {
</div>
)}
- <NotificationFeedback key={payload.id} notification={payload} />
+ {feedbackExpanded && (
+ <NotificationFeedback
+ key={payload.id}
+ notification={payload}
+ revealOnHover={false}
+ />
+ )}
- {/* Popup utility footer */}
- <div
- style={{
- display: "flex",
- alignItems: "center",
- padding: "4px 14px 8px 14px",
- gap: "12px",
- borderTop: "1px solid rgba(0, 0, 0, 0.06)",
- }}
- >
- <button
- onClick={copyNotification}
- title="copy notification"
+ {/* Utilities appear on request, without changing the layout on hover. */}
+ {optionsExpanded && (
+ <div
style={{
- display: "inline-flex",
+ display: "flex",
alignItems: "center",
- gap: "4px",
- padding: "8px 16px",
- border: "none",
- background: "none",
- flexShrink: 0,
- fontSize: "9px",
- lineHeight: 1,
- color: "rgba(0, 0, 0, 0.3)",
- cursor: "pointer",
- fontFamily: '"IBM Plex Mono", monospace',
- whiteSpace: "nowrap",
+ padding: "4px 14px 8px 14px",
+ gap: "8px",
+ borderTop: "1px solid hsl(var(--foreground) / 0.06)",
}}
- onMouseEnter={(e) =>
- (e.currentTarget.style.color = "rgba(0, 0, 0, 0.6)")
- }
- onMouseLeave={(e) =>
- (e.currentTarget.style.color = "rgba(0, 0, 0, 0.3)")
- }
>
- {copied ? (
- <Check size={12} strokeWidth={1.8} />
- ) : (
- <Copy size={12} strokeWidth={1.8} />
+ <button
+ onClick={copyNotification}
+ title="copy notification"
+ aria-label={copied ? "copied notification" : "copy notification"}
+ style={{
+ display: "inline-flex",
+ alignItems: "center",
+ gap: "4px",
+ padding: "4px",
+ border: "none",
+ background: "none",
+ flexShrink: 0,
+ fontSize: "9px",
+ lineHeight: 1,
+ color: "hsl(var(--foreground) / 0.3)",
+ cursor: "pointer",
+ fontFamily: '"IBM Plex Mono", monospace',
+ whiteSpace: "nowrap",
+ }}
+ onMouseEnter={(e) =>
+ (e.currentTarget.style.color = "hsl(var(--foreground) / 0.6)")
+ }
+ onMouseLeave={(e) =>
+ (e.currentTarget.style.color = "hsl(var(--foreground) / 0.3)")
+ }
+ >
+ {copied ? (
+ <Check size={12} strokeWidth={1.8} />
+ ) : (
+ <Copy size={12} strokeWidth={1.8} />
+ )}
+ {copied ? "copied" : "copy"}
+ </button>
+ {payload.source_url && (
+ <button
+ onClick={openSource}
+ title="open source chat"
+ style={{
+ display: "inline-flex",
+ alignItems: "center",
+ gap: "4px",
+ padding: "4px",
+ border: "none",
+ background: "none",
+ flexShrink: 0,
+ fontSize: "9px",
+ lineHeight: 1,
+ color: "hsl(var(--foreground) / 0.3)",
+ cursor: "pointer",
+ fontFamily: '"IBM Plex Mono", monospace',
+ whiteSpace: "nowrap",
+ }}
+ onMouseEnter={(e) =>
+ (e.currentTarget.style.color = "hsl(var(--foreground) / 0.6)")
+ }
+ onMouseLeave={(e) =>
+ (e.currentTarget.style.color = "hsl(var(--foreground) / 0.3)")
+ }
+ >
+ <ExternalLink size={12} strokeWidth={1.8} />
+ source
+ </button>
+ )}
+ {isNotificationFeedbackEligible(payload) && (
+ <button
+ type="button"
+ aria-expanded={feedbackExpanded}
+ onClick={() => setFeedbackExpanded((expanded) => !expanded)}
+ style={{
+ display: "inline-flex",
+ alignItems: "center",
+ gap: "4px",
+ padding: "4px",
+ border: "none",
+ background: "none",
+ color: "hsl(var(--muted-foreground))",
+ cursor: "pointer",
+ fontSize: "9px",
+ }}
+ >
+ <MessageSquare size={12} /> feedback
+ </button>
)}
- </button>
- {payload.source_url && (
<button
- onClick={openSource}
- title="open source chat"
+ onClick={async () => {
+ await hide("manage");
+ await emit("navigate", { url: "/home?section=notifications" });
+ try {
+ await commands.showWindow({ Home: { page: null } });
+ } catch {}
+ }}
+ title="manage notification settings"
style={{
display: "inline-flex",
alignItems: "center",
gap: "4px",
- padding: "8px 16px",
+ marginLeft: "auto",
+ padding: "4px",
border: "none",
background: "none",
flexShrink: 0,
fontSize: "9px",
lineHeight: 1,
- color: "rgba(0, 0, 0, 0.3)",
+ color: "hsl(var(--foreground) / 0.3)",
cursor: "pointer",
fontFamily: '"IBM Plex Mono", monospace',
whiteSpace: "nowrap",
}}
onMouseEnter={(e) =>
- (e.currentTarget.style.color = "rgba(0, 0, 0, 0.6)")
+ (e.currentTarget.style.color = "hsl(var(--foreground) / 0.6)")
}
onMouseLeave={(e) =>
- (e.currentTarget.style.color = "rgba(0, 0, 0, 0.3)")
+ (e.currentTarget.style.color = "hsl(var(--foreground) / 0.3)")
}
>
- <ExternalLink size={12} strokeWidth={1.8} />
- source
+ <Bell size={12} strokeWidth={1.8} />
+ manage
</button>
- )}
- <button
- onClick={async () => {
- await hide("manage");
- await emit("navigate", { url: "/home?section=notifications" });
- try {
- await commands.showWindow({ Home: { page: null } });
- } catch {}
- }}
- title="manage notification settings"
- style={{
- display: "inline-flex",
- alignItems: "center",
- gap: "4px",
- marginLeft: "auto",
- padding: "8px 16px",
- border: "none",
- background: "none",
- flexShrink: 0,
- fontSize: "9px",
- lineHeight: 1,
- color: "rgba(0, 0, 0, 0.3)",
- cursor: "pointer",
- fontFamily: '"IBM Plex Mono", monospace',
- whiteSpace: "nowrap",
- }}
- onMouseEnter={(e) =>
- (e.currentTarget.style.color = "rgba(0, 0, 0, 0.6)")
- }
- onMouseLeave={(e) =>
- (e.currentTarget.style.color = "rgba(0, 0, 0, 0.3)")
- }
- >
- <Bell size={12} strokeWidth={1.8} />
- manage
- </button>
- </div>
+ </div>
+ )}
{/* Progress bar */}
<div
@@ -852,14 +925,14 @@ export default function NotificationPanelPage() {
left: 0,
right: 0,
height: "2px",
- background: "rgba(0, 0, 0, 0.05)",
+ background: "hsl(var(--foreground) / 0.05)",
}}
>
<div
style={{
height: "100%",
width: `${progress}%`,
- background: "rgba(0, 0, 0, 0.2)",
+ background: "hsl(var(--foreground) / 0.2)",
transition: "width 50ms linear",
}}
/>
diff --git a/apps/screenpipe-app-tauri/components/notification-action-button.tsx b/apps/screenpipe-app-tauri/components/notification-action-button.tsx
index d66a9b6f2..c5ec3fd27 100644
--- a/apps/screenpipe-app-tauri/components/notification-action-button.tsx
+++ b/apps/screenpipe-app-tauri/components/notification-action-button.tsx
@@ -51,9 +51,7 @@ export function NotificationActionButton({
<TooltipProvider delayDuration={150}>
<Tooltip
open={tooltipOpen}
- onOpenChange={(open) =>
- setTooltipOpen(open && measureTruncation())
- }
+ onOpenChange={(open) => setTooltipOpen(open && measureTruncation())}
>
<TooltipTrigger asChild>
<button
@@ -69,11 +67,16 @@ export function NotificationActionButton({
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
- background: primary ? "rgba(0, 0, 0, 0.06)" : "none",
- border: "1px solid rgba(0, 0, 0, 0.12)",
- color: "rgba(0, 0, 0, 0.75)",
+ background: primary
+ ? "hsl(var(--foreground) / 0.88)"
+ : "hsl(var(--foreground) / 0.04)",
+ border: "1px solid hsl(var(--border))",
+ borderRadius: "6px",
+ color: primary
+ ? "hsl(var(--background))"
+ : "hsl(var(--foreground) / 0.8)",
cursor: "pointer",
- padding: "4px 10px",
+ padding: "6px 10px",
fontSize: "10px",
lineHeight: "1.4",
fontFamily: '"IBM Plex Mono", monospace',
@@ -81,12 +84,14 @@ export function NotificationActionButton({
letterSpacing: "0.03em",
}}
onMouseEnter={(event) => {
- event.currentTarget.style.background = "rgba(0, 0, 0, 0.08)";
+ event.currentTarget.style.background = primary
+ ? "hsl(var(--foreground) / 0.75)"
+ : "hsl(var(--foreground) / 0.08)";
}}
onMouseLeave={(event) => {
event.currentTarget.style.background = primary
- ? "rgba(0, 0, 0, 0.06)"
- : "none";
+ ? "hsl(var(--foreground) / 0.88)"
+ : "hsl(var(--foreground) / 0.04)";
}}
>
{label}
@@ -95,7 +100,7 @@ export function NotificationActionButton({
{isTruncated && (
<TooltipContent
side="top"
- className="max-w-[calc(100vw-16px)] rounded-none border-black/15 bg-white/95 px-2 py-1 font-mono text-[10px] text-black/75 shadow-md"
+ className="max-w-[calc(100vw-16px)] rounded-sm border-border bg-background/95 px-2 py-1 font-mono text-[10px] text-foreground/75 shadow-md"
>
{label}
</TooltipContent>
diff --git a/apps/screenpipe-app-tauri/components/notification-feedback.tsx b/apps/screenpipe-app-tauri/components/notification-feedback.tsx
index 2c2423c91..b82085dd6 100644
--- a/apps/screenpipe-app-tauri/components/notification-feedback.tsx
+++ b/apps/screenpipe-app-tauri/components/notification-feedback.tsx
@@ -20,6 +20,7 @@ interface NotificationFeedbackProps {
notification: FeedbackableNotification;
submitFeedback?: typeof submitNotificationFeedback;
variant?: "panel" | "inbox";
+ revealOnHover?: boolean;
}
type SaveState = "idle" | "saving" | "saved" | "error";
@@ -28,6 +29,7 @@ export function NotificationFeedback({
notification,
submitFeedback = submitNotificationFeedback,
variant = "panel",
+ revealOnHover = true,
}: NotificationFeedbackProps) {
const [rating, setRating] = useState<AiFeedbackRating | null>(null);
const [correction, setCorrection] = useState("");
@@ -84,7 +86,7 @@ export function NotificationFeedback({
height: "20px",
padding: 0,
border: "1px solid hsl(var(--border))",
- borderRadius: 0,
+ borderRadius: "4px",
background: selected ? "hsl(var(--foreground))" : "transparent",
color: selected ? "hsl(var(--background))" : "hsl(var(--muted-foreground))",
cursor: saveState === "saving" ? "wait" : "pointer",
@@ -93,7 +95,11 @@ export function NotificationFeedback({
return (
<div
- className="ph-no-capture pointer-events-none grid grid-rows-[0fr] opacity-0 transition-[grid-template-rows,opacity] duration-150 motion-reduce:transition-none group-hover/notif:pointer-events-auto group-hover/notif:grid-rows-[1fr] group-hover/notif:opacity-100 group-focus-within/notif:pointer-events-auto group-focus-within/notif:grid-rows-[1fr] group-focus-within/notif:opacity-100"
+ className={
+ revealOnHover
+ ? "ph-no-capture pointer-events-none grid grid-rows-[0fr] opacity-0 transition-[grid-template-rows,opacity] duration-150 motion-reduce:transition-none group-hover/notif:pointer-events-auto group-hover/notif:grid-rows-[1fr] group-hover/notif:opacity-100 group-focus-within/notif:pointer-events-auto group-focus-within/notif:grid-rows-[1fr] group-focus-within/notif:opacity-100"
+ : "ph-no-capture"
+ }
data-testid="notification-feedback"
onClick={(event) => event.stopPropagation()}
onKeyDown={(event) => event.stopPropagation()}
@@ -171,7 +177,7 @@ export function NotificationFeedback({
height: "28px",
padding: "0 8px",
border: "1px solid hsl(var(--border))",
- borderRadius: 0,
+ borderRadius: "4px",
outline: "none",
background: "hsl(var(--background))",
color: "hsl(var(--foreground))",
@@ -192,7 +198,7 @@ export function NotificationFeedback({
height: "28px",
padding: 0,
border: "1px solid hsl(var(--border))",
- borderRadius: 0,
+ borderRadius: "4px",
background: correction.trim()
? "hsl(var(--foreground))"
: "transparent",
diff --git a/apps/screenpipe-app-tauri/src-tauri/swift/notification_panel.swift b/apps/screenpipe-app-tauri/src-tauri/swift/notification_panel.swift
index 4e334f351..8b8c78310 100644
--- a/apps/screenpipe-app-tauri/src-tauri/swift/notification_panel.swift
+++ b/apps/screenpipe-app-tauri/src-tauri/swift/notification_panel.swift
@@ -85,7 +85,7 @@ public func notifSetActionCallback(_ cb: @escaping ActionCallback) {
// MARK: - Brand constants
// screenpipe brand: black & white geometric minimalism
-// 0px border radius, no shadows, 1px borders, IBM Plex Mono
+// Rounded floating surfaces, quiet borders, IBM Plex Mono
private enum Brand {
// Try to load IBM Plex Mono, fall back to system monospaced
@@ -130,7 +130,7 @@ private enum Brand {
// MARK: - SwiftUI Views
-/// Button with brand-compliant hover: color inversion, sharp corners, 1px border
+/// Compact action with restrained neutral hover and rounded control geometry.
@available(macOS 13.0, *)
struct BrandButton: View {
let label: String
@@ -173,20 +173,20 @@ struct BrandButton: View {
}
)
.padding(.horizontal, 10)
- .padding(.vertical, 4)
+ .padding(.vertical, 6)
}
.buttonStyle(.plain)
.frame(maxWidth: fillsAvailableWidth ? .infinity : nil)
- .foregroundColor(isHovered ? Color(nsColor: .windowBackgroundColor) : .primary.opacity(0.75))
+ .foregroundColor(isPrimary ? Color(nsColor: .windowBackgroundColor) : .primary.opacity(0.8))
.background(
- Rectangle()
- .fill(isHovered ? Color.primary : (isPrimary ? Color.primary.opacity(0.06) : Color.clear))
+ RoundedRectangle(cornerRadius: 6)
+ .fill(isPrimary ? Color.primary.opacity(isHovered ? 0.75 : 0.88) : Color.primary.opacity(isHovered ? 0.08 : 0.04))
)
.overlay(
- Rectangle()
+ RoundedRectangle(cornerRadius: 6)
.stroke(Color.primary.opacity(0.12), lineWidth: 1)
)
- .contentShape(Rectangle())
+ .contentShape(RoundedRectangle(cornerRadius: 6))
.accessibilityLabel(Text(label))
.onChange(of: availableLabelWidth) { _ in
onTruncatedHoverChange(isHovered && isLabelTruncated)
@@ -270,14 +270,15 @@ struct BrandIconTextButton: View {
Text(label)
.font(Brand.swiftUIMonoFont(size: 9, weight: .regular))
}
- .padding(.horizontal, 16)
- .padding(.vertical, 8)
- .foregroundColor(isHovered ? .primary.opacity(0.75) : .primary.opacity(0.34))
+ .padding(.horizontal, 4)
+ .padding(.vertical, 4)
+ .foregroundColor(isHovered ? .primary.opacity(0.75) : .primary.opacity(0.6))
.contentShape(Rectangle())
}
.buttonStyle(.plain)
.contentShape(Rectangle())
.help(help)
+ .accessibilityLabel(help)
.onHover { hovering in
withAnimation(.linear(duration: Brand.animDuration)) {
isHovered = hovering
@@ -303,10 +304,14 @@ enum NotificationFeedbackSaveState {
@available(macOS 13.0, *)
final class NotificationFeedbackModel: ObservableObject {
@Published var rating: NotificationFeedbackRating?
+ @Published var optionsExpanded = false
+ @Published var feedbackExpanded = false
@Published var correction = ""
@Published var saveState: NotificationFeedbackSaveState = .idle
func reset() {
+ optionsExpanded = false
+ feedbackExpanded = false
rating = nil
correction = ""
saveState = .idle
@@ -356,7 +361,7 @@ private struct NativeNotificationFeedbackView: View {
.padding(.horizontal, 8)
.frame(height: 28)
.background(Color(nsColor: .windowBackgroundColor).opacity(0.45))
- .overlay(Rectangle().stroke(Color.primary.opacity(0.16), lineWidth: 1))
+ .overlay(RoundedRectangle(cornerRadius: 4).stroke(Color.primary.opacity(0.16), lineWidth: 1))
.onSubmit(sendCorrection)
.onChange(of: model.correction) { value in
if value.count > 500 {
@@ -369,8 +374,8 @@ private struct NativeNotificationFeedbackView: View {
.font(.system(size: 11, weight: .regular))
.frame(width: 28, height: 28)
.foregroundColor(correctionReady ? Color(nsColor: .windowBackgroundColor) : .primary.opacity(0.22))
- .background(Rectangle().fill(correctionReady ? Color.primary.opacity(0.82) : Color.clear))
- .overlay(Rectangle().stroke(Color.primary.opacity(0.16), lineWidth: 1))
+ .background(RoundedRectangle(cornerRadius: 4).fill(correctionReady ? Color.primary.opacity(0.82) : Color.clear))
+ .overlay(RoundedRectangle(cornerRadius: 4).stroke(Color.primary.opacity(0.16), lineWidth: 1))
}
.buttonStyle(.plain)
.disabled(!correctionReady)
@@ -393,8 +398,8 @@ private struct NativeNotificationFeedbackView: View {
.font(.system(size: 9, weight: .regular))
.frame(width: 20, height: 20)
.foregroundColor(selected ? Color(nsColor: .windowBackgroundColor) : .primary.opacity(0.42))
- .background(Rectangle().fill(selected ? Color.primary.opacity(0.82) : Color.clear))
- .overlay(Rectangle().stroke(Color.primary.opacity(0.12), lineWidth: 1))
+ .background(RoundedRectangle(cornerRadius: 4).fill(selected ? Color.primary.opacity(0.82) : Color.clear))
+ .overlay(RoundedRectangle(cornerRadius: 4).stroke(Color.primary.opacity(0.12), lineWidth: 1))
}
.buttonStyle(.plain)
.accessibilityLabel(rating == .up ? "useful notification" : "not useful notification")
@@ -418,7 +423,6 @@ private struct NativeNotificationFeedbackView: View {
struct NotificationContentView: View {
let payload: NotificationPayload
let progress: Double
- let isHovered: Bool
let onDismiss: () -> Void
let onAction: (NotificationAction) -> Void
let onOpenSource: () -> Void
@@ -429,6 +433,14 @@ struct NotificationContentView: View {
@State private var copied = false
@State private var hoveredActionLabel: String?
+ private var visibleActions: [NotificationAction] {
+ payload.actions.filter { ($0.type ?? $0.action) != "dismiss" }
+ }
+
+ private var feedbackEligible: Bool {
+ payload.type == "pipe" || payload.pipe_name != nil || payload.source_session_id != nil
+ }
+
var body: some View {
VStack(alignment: .leading, spacing: 0) {
// Header
@@ -443,14 +455,31 @@ struct NotificationContentView: View {
.font(Brand.swiftUIMonoFont(size: 10, weight: .medium))
.foregroundColor(.primary.opacity(0.4))
Spacer()
+ Button {
+ feedback.optionsExpanded.toggle()
+ DispatchQueue.main.async(execute: onFeedbackLayoutChange)
+ } label: {
+ Image(systemName: "ellipsis")
+ .font(.system(size: 12, weight: .medium))
+ .foregroundColor(.primary.opacity(0.6))
+ .frame(width: 24, height: 24)
+ .background(RoundedRectangle(cornerRadius: 4).fill(
+ Color.primary.opacity(feedback.optionsExpanded ? 0.08 : 0)
+ ))
+ }
+ .buttonStyle(.plain)
+ .help("notification options")
+ .accessibilityLabel("notification options")
+ .accessibilityValue(feedback.optionsExpanded ? "expanded" : "collapsed")
Button(action: onDismiss) {
Text("✕")
.font(Brand.swiftUIMonoFont(size: 12))
.foregroundColor(closeHovered ? .primary.opacity(0.9) : .primary.opacity(0.35))
- .frame(width: 20, height: 20)
+ .frame(width: 24, height: 24)
}
.buttonStyle(.plain)
.contentShape(Rectangle())
+ .accessibilityLabel("dismiss notification")
.onHover { h in
withAnimation(.linear(duration: Brand.animDuration)) { closeHovered = h }
}
@@ -491,14 +520,14 @@ struct NotificationContentView: View {
.frame(maxHeight: 200)
// Action buttons
- if !payload.actions.isEmpty {
+ if !visibleActions.isEmpty {
HStack(spacing: 8) {
- ForEach(Array(payload.actions.enumerated()), id: \.offset) { _, action in
+ ForEach(Array(visibleActions.enumerated()), id: \.offset) { _, action in
let label = actionLabel(action)
BrandButton(
label: label,
isPrimary: action.primary == true,
- fillsAvailableWidth: payload.actions.count > 1,
+ fillsAvailableWidth: visibleActions.count > 1,
action: {
if action.type == "copy" {
var copyAction = action
@@ -527,9 +556,6 @@ struct NotificationContentView: View {
)
}
Spacer()
- BrandTextButton(label: "DISMISS →", fontSize: 10) {
- onDismiss()
- }
}
.padding(.horizontal, 14)
.padding(.bottom, 6)
@@ -543,7 +569,7 @@ struct NotificationContentView: View {
.zIndex(1)
}
- if isHovered && (payload.type == "pipe" || payload.pipe_name != nil || payload.source_session_id != nil) {
+ if feedback.feedbackExpanded && feedbackEligible {
NativeNotificationFeedbackView(
model: feedback,
onSubmit: submitFeedback,
@@ -553,43 +579,46 @@ struct NotificationContentView: View {
.padding(.bottom, 8)
}
- // Footer: compact notification actions
- HStack(spacing: 12) {
- BrandIconTextButton(
- systemName: copied ? "checkmark" : "doc.on.doc",
- label: copied ? "copied" : "copy",
- help: "copy notification"
- ) {
- copyNotificationText()
- sendActionPayload(["type": "copy", "value": notificationClipboardText()])
- copied = true
- DispatchQueue.main.asyncAfter(deadline: .now() + 1.4) {
- copied = false
+ // Utilities appear only when explicitly requested, never on hover.
+ if feedback.optionsExpanded {
+ HStack(spacing: 8) {
+ BrandIconTextButton(
+ systemName: copied ? "checkmark" : "doc.on.doc",
+ label: copied ? "copied" : "copy",
+ help: "copy notification"
+ ) {
+ copyNotificationText()
+ sendActionPayload(["type": "copy", "value": notificationClipboardText()])
+ copied = true
+ DispatchQueue.main.asyncAfter(deadline: .now() + 1.4) {
+ copied = false
+ }
}
- }
- if payload.source_url != nil {
- BrandIconTextButton(systemName: "arrow.up.right.square", label: "source", help: "open source chat") {
- onOpenSource()
+ if payload.source_url != nil {
+ BrandIconTextButton(systemName: "arrow.up.right.square", label: "source", help: "open source chat") {
+ onOpenSource()
+ }
}
- }
- Spacer(minLength: 0)
+ if feedbackEligible {
+ BrandIconTextButton(systemName: "bubble.left", label: "feedback", help: "give feedback") {
+ feedback.feedbackExpanded.toggle()
+ DispatchQueue.main.async(execute: onFeedbackLayoutChange)
+ }
+ }
+ Spacer(minLength: 0)
- BrandIconTextButton(systemName: "bell", label: "manage", help: "manage notification settings") {
- onDismiss()
- // Small delay so the panel hides before the window appears
- DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
- sendActionJson("{\"type\":\"manage\"}")
+ BrandIconTextButton(systemName: "bell", label: "manage", help: "manage notification settings") {
+ onDismiss()
+ // Small delay so the panel hides before the window appears
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
+ sendActionJson("{\"type\":\"manage\"}")
+ }
}
}
- }
- .padding(.horizontal, 14)
- .padding(.vertical, 6)
- .overlay(alignment: .top) {
- Rectangle()
- .fill(Color.primary.opacity(0.06))
- .frame(height: 1)
+ .padding(.horizontal, 14)
+ .padding(.vertical, 6)
}
// Progress bar — 2px, sharp, no radius
@@ -607,7 +636,9 @@ struct NotificationContentView: View {
.background(
VisualEffectView()
)
- .shadow(color: .black.opacity(0.18), radius: 16, x: 0, y: 4)
+ .clipShape(RoundedRectangle(cornerRadius: 8))
+ .overlay(RoundedRectangle(cornerRadius: 8).stroke(Color.primary.opacity(0.1), lineWidth: 1))
+ .shadow(color: .black.opacity(0.12), radius: 16, x: 0, y: 4)
.shadow(color: .black.opacity(0.06), radius: 3, x: 0, y: 1)
// Override link handling — SwiftUI's default openURL doesn't work
// in non-activating panels. screenpipe:// URLs go through the
@@ -856,7 +887,7 @@ struct MarkdownText: View {
// Plain character
var attr = AttributedString(String(remaining[remaining.startIndex]))
attr.font = Brand.swiftUIMonoFont(size: 11)
- attr.foregroundColor = .primary.opacity(0.5)
+ attr.foregroundColor = .primary.opacity(0.7)
textRun.append(attr)
remaining = remaining[remaining.index(after: remaining.startIndex)...]
}
@@ -1056,6 +1087,7 @@ class NotificationPanelController: NSObject {
private var autoDismissMs: Double = 20000
private var elapsedBeforePause: Double = 0
private var resumedAt: Date = Date()
+ private var wasTimerPaused = false
private var isHovered: Bool = false
private let feedbackModel = NotificationFeedbackModel()
/// Incremented per notification so rapid-fire notifications each restart the timer
@@ -1114,28 +1146,10 @@ class NotificationPanelController: NSObject {
func handleMouseEntered() {
isHovered = true
- // Snapshot elapsed time
- elapsedBeforePause += Date().timeIntervalSince(resumedAt) * 1000
- if currentPayloadUsesHoverFeedback {
- updateContent()
- }
}
func handleMouseExited() {
isHovered = false
- resumedAt = Date()
- if currentPayloadUsesHoverFeedback {
- updateContent()
- }
- }
-
- /// Only feedback-enabled notifications change content on panel hover.
- /// Replacing an NSHostingView root while macOS performs accessibility hit
- /// testing can trap inside SwiftUI; ordinary action notifications must keep
- /// a stable view tree from presentation through click handling.
- private var currentPayloadUsesHoverFeedback: Bool {
- guard let payload = currentPayload else { return false }
- return payload.type == "pipe" || payload.pipe_name != nil || payload.source_session_id != nil
}
private func createPanel() {
@@ -1190,12 +1204,10 @@ class NotificationPanelController: NSObject {
private func updateContent() {
guard let payload = currentPayload, let panel = panel else { return }
let prog = self.progress
- let hovered = self.isHovered
let innerView = NotificationContentView(
payload: payload,
progress: prog,
- isHovered: hovered,
onDismiss: { [weak self] in
self?.hide()
self?.sendAction("{\"type\":\"dismiss\"}")
@@ -1248,6 +1260,7 @@ class NotificationPanelController: NSObject {
private func startTimer() {
timer?.invalidate()
+ wasTimerPaused = false
// autoDismissMs == 0 means "don't auto-dismiss" (e.g. port-conflict
// notifications that need the user to act).
guard autoDismissMs > 0 else { return }
@@ -1260,7 +1273,18 @@ class NotificationPanelController: NSObject {
self.timer = nil
return
}
- if self.isHovered { return }
+ let paused = self.isHovered || self.feedbackModel.optionsExpanded || self.feedbackModel.feedbackExpanded
+ if paused {
+ if !self.wasTimerPaused {
+ self.elapsedBeforePause += Date().timeIntervalSince(self.resumedAt) * 1000
+ self.wasTimerPaused = true
+ }
+ return
+ }
+ if self.wasTimerPaused {
+ self.resumedAt = Date()
+ self.wasTimerPaused = false
+ }
let elapsed = self.elapsedBeforePause + Date().timeIntervalSince(self.resumedAt) * 1000
let remaining = max(0, 1.0 - elapsed / self.autoDismissMs)
// Only re-render when progress changes visibly (>0.5% delta)