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
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(rewind): open browser url links that lack a scheme (#3801)
Ansh Groverccac932903d2
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsxindex 357984d6f..2d4b4586d 100644--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx@@ -1230,28 +1230,36 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {{(() => {const browserUrl = currentFrame?.devices?.[0]?.metadata?.browser_url;if (!browserUrl) return null;+ // browser_url from screenpipe often lacks a protocol (e.g. "github.com/foo");+ // both tauri shell.open and window.open reject/misroute schemeless inputs.+ const openableUrl = browserUrl.includes("://") ? browserUrl : `https://${browserUrl}`;+ const isHttps = openableUrl.startsWith("https://");return (<div className={`absolute ${embedded ? "top-[56px]" : "top-[calc(env(safe-area-inset-top)+4px)]"} left-0 right-0 z-[45] flex justify-center pointer-events-none`}><buttontype="button"className="flex items-center gap-1.5 max-w-lg min-w-0 px-3 py-1 rounded-full bg-black/70 backdrop-blur-sm border border-white/10 hover:bg-black/80 hover:border-white/20 transition-colors cursor-pointer pointer-events-auto"- title={`Open ${browserUrl}`}- onClick={async () => {+ title={`Open ${openableUrl}`}+ onClick={async (e) => {+ e.stopPropagation();try {- const { open } = await import("@tauri-apps/plugin-shell");- await open(browserUrl);- } catch {- window.open(browserUrl, "_blank");+ const { openUrl } = await import("@tauri-apps/plugin-opener");+ await openUrl(openableUrl);+ } catch (err) {+ console.error("failed to open url", openableUrl, err);+ try {+ window.open(openableUrl, "_blank", "noopener,noreferrer");+ } catch {}}}}>- {browserUrl.startsWith("https") ? (+ {isHttps ? (<Lock className="w-3 h-3 text-green-400/80 shrink-0" />) : (<Globe className="w-3 h-3 text-white/40 shrink-0" />)}<span className="text-[12px] font-mono text-white/80 truncate">- {browserUrl.replace(/^https?:\/\/(www\.)?/, "")}+ {openableUrl.replace(/^https?:\/\/(www\.)?/, "")}</span><ExternalLink className="w-3 h-3 text-white/40 shrink-0" /></button>diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline/app-context-popover.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline/app-context-popover.tsxindex f7801fb97..4830ddfb2 100644--- a/apps/screenpipe-app-tauri/components/rewind/timeline/app-context-popover.tsx+++ b/apps/screenpipe-app-tauri/components/rewind/timeline/app-context-popover.tsx@@ -24,19 +24,19 @@ function formatUiEvent(ev: UiEventSummary): { icon: string; label: string } | nuconst truncate = (s: string, max = 40) => s.length > max ? s.slice(0, max) + "\u2026" : s;switch (ev.event_type) {case "text":- return { icon: "\u2328", label: ev.text_content ? `typed "${truncate(ev.text_content)}"` : "typed" };+ return { icon: "\u2328", label: ev.text_content ? `typed "${truncate(ev.text_content)}"` : "typed" };case "clipboard":- return { icon: "\ud83d\udccb", label: ev.text_content ? `copied "${truncate(ev.text_content)}"` : "copied" };+ return { icon: "\ud83d\udccb", label: ev.text_content ? `copied "${truncate(ev.text_content)}"` : "copied" };case "click":return { icon: "\ud83d\uddb1", label: `clicked "${truncate(ev.text_content || "element")}"` };case "app_switch":return { icon: "\u21d4", label: `switched to ${ev.app_name || "app"}` };- case "key":- return { icon: "\u2303", label: ev.text_content ? `pressed ${truncate(ev.text_content)}` : "key press" };- case "scroll":- return { icon: "\u21f3", label: `scrolled${ev.window_title ? ` in ${truncate(ev.window_title)}` : ""}` };- case "window_focus":- return { icon: "\ud83d\udd32", label: `focused ${ev.window_title ? truncate(ev.window_title) : ev.app_name || "window"}` };+ case "key":+ return { icon: "\u2303", label: ev.text_content ? `pressed ${truncate(ev.text_content)}` : "key press" };+ case "scroll":+ return { icon: "\u21f3", label: `scrolled${ev.window_title ? ` in ${truncate(ev.window_title)}` : ""}` };+ case "window_focus":+ return { icon: "\ud83d\udd32", label: `focused ${ev.window_title ? truncate(ev.window_title) : ev.app_name || "window"}` };default:return null;}@@ -304,14 +304,19 @@ export function AppContextPopover({<div className="pl-4 space-y-0.5">{data.topUrls.map((u, i) => {const domain = extractDomain(u.url);+ // browser_url from screenpipe often lacks a protocol (e.g. "github.com/foo");+ // openUrl rejects such inputs silently, so normalize before opening.+ const openableUrl = u.url.includes("://") ? u.url : `https://${u.url}`;return (<buttonkey={i}- className="flex items-center gap-1 text-blue-400 hover:text-blue-300 truncate w-full text-left transition-colors"- title={u.url}- onClick={() => {- openUrl(u.url).catch(() => {});- commands.closeWindow("Main").catch(() => {});+ className="flex items-center gap-1 text-blue-400 hover:text-blue-300 truncate w-full text-left transition-colors cursor-pointer"+ title={openableUrl}+ onClick={(e) => {+ e.stopPropagation();+ openUrl(openableUrl).catch((err) => {+ console.error("failed to open url", openableUrl, err);+ });}}>{domain ? (