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

feat: team analytics, conditional sidebar CTA, invite UX improvements

Louis Beaumont3ea640e3165d
diff --git a/apps/screenpipe-app-tauri/app/settings/page.tsx b/apps/screenpipe-app-tauri/app/settings/page.tsx
index 4bfd560b6..1b4d8e00b 100644
--- a/apps/screenpipe-app-tauri/app/settings/page.tsx
+++ b/apps/screenpipe-app-tauri/app/settings/page.tsx
@@ -44,6 +44,7 @@ import Timeline from "@/components/rewind/timeline";
import { useQueryState } from "nuqs";
import { listen } from "@tauri-apps/api/event";
import { useSettings } from "@/lib/hooks/use-settings";
+import { useTeam } from "@/lib/hooks/use-team";
import { open as openUrl } from "@tauri-apps/plugin-shell";
type MainSection = "home" | "timeline" | "pipes" | "help";
@@ -84,6 +85,7 @@ function SettingsPageContent() {
});
const { settings } = useSettings();
+ const teamState = useTeam();
const posthog = usePostHog();
const showCloudSync = useMemo(() => posthog?.isFeatureEnabled("cloud-sync") ?? false, [posthog]);
const overlayData = useOverlayData();
@@ -313,31 +315,37 @@ function SettingsPageContent() {
{/* Spacer */}
<div className="flex-1" />
- {/* Team promo card */}
- <div className="mx-1 mb-3 p-3 border border-border bg-card">
- <h3 className="text-sm font-medium text-foreground">
- Add your team to screenpipe
- </h3>
- <p className="text-xs text-muted-foreground mt-1">
- Push pipe configs and content filters to all members.
- </p>
- <button
- onClick={() => openModal("team")}
- className="mt-2.5 px-3 py-1.5 text-xs font-medium border border-border bg-background hover:bg-foreground hover:text-background transition-colors duration-150"
- >
- ADD YOUR TEAM
- </button>
- </div>
+ {/* Team promo card — hidden when user already has a team */}
+ {!teamState.team && (
+ <div className="mx-1 mb-3 p-3 border border-border bg-card">
+ <h3 className="text-sm font-medium text-foreground">
+ Add your team to screenpipe
+ </h3>
+ <p className="text-xs text-muted-foreground mt-1">
+ Push pipe configs and content filters to all members.
+ </p>
+ <button
+ onClick={() => openModal("team")}
+ className="mt-2.5 px-3 py-1.5 text-xs font-medium border border-border bg-background hover:bg-foreground hover:text-background transition-colors duration-150"
+ >
+ ADD YOUR TEAM
+ </button>
+ </div>
+ )}
{/* Bottom items */}
<div className="space-y-0.5 border-t border-border pt-2">
- {/* Invite your team */}
+ {/* Team link */}
<button
onClick={() => openModal("team")}
className="w-full flex items-center space-x-2.5 px-3 py-2 rounded-lg transition-all duration-150 text-left group hover:bg-card/50 text-muted-foreground hover:text-foreground"
>
<UserPlus className="h-4 w-4 text-muted-foreground group-hover:text-foreground transition-colors flex-shrink-0" />
- <span className="font-medium text-sm truncate">Invite your team</span>
+ <span className="font-medium text-sm truncate">
+ {teamState.team
+ ? `Your team (${teamState.members.length})`
+ : "Invite your team"}
+ </span>
</button>
{/* Get free month */}
diff --git a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
index ec46eda0f..e8c0bed23 100644
--- a/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/pipes-section.tsx
@@ -305,6 +305,7 @@ export function PipesSection() {
raw_content: pipe.raw_content,
config: pipe.config,
});
+ posthog.capture("team_config_pushed", { config_type: "pipe", pipe_name: pipe.config.name });
toast({
title: sharedPipeNames.has(pipe.config.name) ? "updated team pipe" : "shared to team",
});
diff --git a/apps/screenpipe-app-tauri/components/settings/team-section.tsx b/apps/screenpipe-app-tauri/components/settings/team-section.tsx
index 4360ed054..9b7a3a4df 100644
--- a/apps/screenpipe-app-tauri/components/settings/team-section.tsx
+++ b/apps/screenpipe-app-tauri/components/settings/team-section.tsx
@@ -34,6 +34,7 @@ import { useTeamSync } from "@/lib/hooks/use-team-sync";
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
import { onOpenUrl } from "@tauri-apps/plugin-deep-link";
import { open as openUrl } from "@tauri-apps/plugin-shell";
+import posthog from "posthog-js";
export function TeamSection() {
const { settings } = useSettings();
@@ -49,6 +50,20 @@ export function TeamSection() {
const [joining, setJoining] = useState(false);
const [showJoinInput, setShowJoinInput] = useState(false);
const [confirmDelete, setConfirmDelete] = useState(false);
+ const [inviteEmail, setInviteEmail] = useState("");
+ const [sendingInvite, setSendingInvite] = useState(false);
+
+ // track team section view
+ const hasTeam = !!team.team;
+ useEffect(() => {
+ if (!team.loading) {
+ posthog.capture("team_section_viewed", {
+ has_team: hasTeam,
+ role: team.role,
+ });
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [team.loading, hasTeam, team.role]);
// handle deep link join
useEffect(() => {
@@ -63,6 +78,7 @@ export function TeamSection() {
if (teamId && key) {
setJoining(true);
await team.joinTeam(teamId, decodeURIComponent(key));
+ posthog.capture("team_joined", { source: "deep_link" });
toast({
title: "joined team!",
description: "you are now a team member",
@@ -94,6 +110,7 @@ export function TeamSection() {
setCreating(true);
try {
await team.createTeam(teamName.trim());
+ posthog.capture("team_created", { team_name: teamName.trim() });
setTeamName("");
toast({ title: "team created!" });
} catch (err: any) {
@@ -116,6 +133,7 @@ export function TeamSection() {
const key = parsed.searchParams.get("key");
if (!teamId || !key) throw new Error("invalid invite link");
await team.joinTeam(teamId, decodeURIComponent(key));
+ posthog.capture("team_joined", { source: "invite_link" });
setInviteInput("");
setShowJoinInput(false);
toast({ title: "joined team!" });
@@ -133,6 +151,7 @@ export function TeamSection() {
const handleCopyInvite = async () => {
if (!team.inviteLink) return;
await navigator.clipboard.writeText(team.inviteLink);
+ posthog.capture("team_invite_copied");
setCopied(true);
toast({ title: "invite link copied" });
setTimeout(() => setCopied(false), 2000);
@@ -141,6 +160,7 @@ export function TeamSection() {
const handleRemoveMember = async (userId: string) => {
try {
await team.removeMember(userId);
+ posthog.capture("team_member_removed");
toast({ title: "member removed" });
} catch (err: any) {
toast({
@@ -154,6 +174,7 @@ export function TeamSection() {
const handleDelete = async () => {
try {
await team.deleteTeam();
+ posthog.capture("team_deleted");
setConfirmDelete(false);
toast({ title: "team deleted" });
} catch (err: any) {
@@ -165,9 +186,29 @@ export function TeamSection() {
}
};
+ const handleSendInvite = async () => {
+ if (!inviteEmail.trim()) return;
+ setSendingInvite(true);
+ try {
+ await team.sendInviteEmail(inviteEmail.trim());
+ posthog.capture("team_invite_email_sent");
+ setInviteEmail("");
+ toast({ title: "invite sent", description: `email sent to ${inviteEmail.trim()}` });
+ } catch (err: any) {
+ toast({
+ title: "failed to send invite",
+ description: err.message,
+ variant: "destructive",
+ });
+ } finally {
+ setSendingInvite(false);
+ }
+ };
+
const handleLeave = async () => {
try {
await team.leaveTeam();
+ posthog.capture("team_left");
toast({ title: "left team" });
} catch (err: any) {
toast({
@@ -359,6 +400,10 @@ export function TeamSection() {
invite link
</h3>
</div>
+ <p className="text-xs text-muted-foreground mb-2 flex items-center gap-1">
+ <AlertTriangle className="h-3 w-3" />
+ contains your encryption key — share only via secure channel
+ </p>
<div className="flex gap-2">
<Input
readOnly
@@ -373,10 +418,38 @@ export function TeamSection() {
)}
</Button>
</div>
- <p className="text-xs text-muted-foreground mt-2 flex items-center gap-1">
- <AlertTriangle className="h-3 w-3" />
- contains your encryption key — share only via secure channel
- </p>
+ </Card>
+ )}
+
+ {/* Email invite (admin only) */}
+ {isAdmin && team.inviteLink && (
+ <Card className="p-4">
+ <h3 className="text-sm font-medium mb-2 flex items-center gap-1.5">
+ <UserPlus className="h-4 w-4" />
+ invite by email
+ </h3>
+ <div className="flex gap-2">
+ <Input
+ type="email"
+ placeholder="[email protected]"
+ value={inviteEmail}
+ onChange={(e) => setInviteEmail(e.target.value)}
+ onKeyDown={(e) => e.key === "Enter" && handleSendInvite()}
+ className="text-xs"
+ />
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={handleSendInvite}
+ disabled={sendingInvite || !inviteEmail.trim()}
+ >
+ {sendingInvite ? (
+ <Loader2 className="h-4 w-4 animate-spin" />
+ ) : (
+ "send invite"
+ )}
+ </Button>
+ </div>
</Card>
)}
@@ -393,8 +466,8 @@ export function TeamSection() {
className="flex items-center justify-between py-1.5 px-2 rounded-md hover:bg-muted/50"
>
<div className="flex items-center gap-2">
- <span className="text-sm font-mono">
- {m.user_id === settings.user?.id ? "you" : m.user_id.slice(0, 8)}
+ <span className="text-sm font-mono truncate max-w-[180px]">
+ {m.user_id === settings.user?.id ? "you" : m.user_id}
</span>
<Badge variant="outline" className="text-[10px]">
{m.role}
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-team.ts b/apps/screenpipe-app-tauri/lib/hooks/use-team.ts
index 3b6777ba0..5a719319d 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-team.ts
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-team.ts
@@ -399,6 +399,30 @@ export function useTeam() {
[token, fetchConfigs]
);
+ // send email invite (calls server API)
+ // TODO: server endpoint POST https://screenpi.pe/api/team/invite must be created in website-screenpipe repo
+ const sendInviteEmail = useCallback(
+ async (email: string) => {
+ if (!token || !state.inviteLink || !state.team)
+ throw new Error("no team");
+ const res = await fetch(`${API}/invite`, {
+ method: "POST",
+ headers: headers(),
+ body: JSON.stringify({
+ email,
+ team_name: state.team.name,
+ invite_link: state.inviteLink,
+ }),
+ });
+ if (!res.ok) {
+ const err = await res.json();
+ throw new Error(err.error || "failed to send invite");
+ }
+ },
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ [token, state.inviteLink, state.team]
+ );
+
// auto-fetch on mount + when token changes
useEffect(() => {
fetchTeam();
@@ -414,5 +438,6 @@ export function useTeam() {
removeMember,
pushConfig,
deleteConfig,
+ sendInviteEmail,
};
}
diff --git a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
index 6044e057d..210e436f8 100755
--- a/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/apps/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -8097,7 +8097,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "2.0.537"
+version = "2.0.538"
dependencies = [
"anyhow",
"arboard",