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

release-app button to publish app store

Louis Beaumonte73cceb60abe
diff --git a/screenpipe-app-tauri/components/pipe-store.tsx b/screenpipe-app-tauri/components/pipe-store.tsx
index 07f40c008..1e97e5ee7 100644
--- a/screenpipe-app-tauri/components/pipe-store.tsx
+++ b/screenpipe-app-tauri/components/pipe-store.tsx
@@ -35,6 +35,7 @@ import { useSettings } from "@/lib/hooks/use-settings";
import { StripeSubscriptionButton } from "./stripe-subscription-button";
import { useUser } from "@/lib/hooks/use-user";
import { PipeStoreMarkdown } from "@/components/pipe-store-markdown";
+import { PublishDialog } from "./publish-dialog";
export interface Pipe {
enabled: boolean;
@@ -243,14 +244,13 @@ const PipeStore: React.FC = () => {
} catch (error) {
console.error("Failed to download pipe:", error);
toast({
- title: "error downloading pipe",
+ title: "error downloading pipe",
description: "please try again or check the logs for more information.",
variant: "destructive",
});
}
};
-
const handleToggleEnabled = async (pipe: Pipe) => {
if (pipe.id === "pipe-for-loom" && !pipe.enabled) {
const hasLoomSubscription = await checkLoomSubscription();
@@ -285,14 +285,14 @@ const PipeStore: React.FC = () => {
}
// Immediately update the local state
- setPipes(prevPipes =>
- prevPipes.map(p =>
+ setPipes((prevPipes) =>
+ prevPipes.map((p) =>
p.id === pipe.id ? { ...p, enabled: !p.enabled } : p
)
);
// If we're in the details view, update the selected pipe too
- setSelectedPipe(prev =>
+ setSelectedPipe((prev) =>
prev?.id === pipe.id ? { ...prev, enabled: !prev.enabled } : prev
);
@@ -303,7 +303,10 @@ const PipeStore: React.FC = () => {
// Still fetch the latest state from the server to ensure consistency
await fetchInstalledPipes();
} catch (error) {
- console.error(`Failed to ${pipe.enabled ? "disable" : "enable"} pipe:`, error);
+ console.error(
+ `Failed to ${pipe.enabled ? "disable" : "enable"} pipe:`,
+ error
+ );
toast({
title: "error toggling pipe",
description: "please try again or check the logs for more information.",
@@ -330,7 +333,7 @@ const PipeStore: React.FC = () => {
},
body: JSON.stringify({ url: newRepoUrl }),
});
-
+
const data = await response.json();
if (!data.success) {
@@ -685,8 +688,8 @@ const PipeStore: React.FC = () => {
const handleCardClick = async (pipe: Pipe) => {
// Check if pipe is already installed by looking in the pipes array
- const isInstalled = pipes.some(p => p.id === pipe.id);
-
+ const isInstalled = pipes.some((p) => p.id === pipe.id);
+
if (!isInstalled && pipe.source) {
try {
// If pipe is not installed, download it first
@@ -694,22 +697,28 @@ const PipeStore: React.FC = () => {
// Fetch the updated pipe data and wait for it
const response = await fetch("http://localhost:3030/pipes/list");
const data = await response.json();
-
+
if (!data.success) throw new Error("Failed to fetch installed pipes");
-
+
// Get the data dir and fetch README for the new pipe
const dataDir = await getDataDir();
const updatedPipe = data.data.find((p: Pipe) => p.id === pipe.id);
-
+
if (updatedPipe) {
- const pathToReadme = await join(dataDir, "pipes", pipe.id, "README.md");
+ const pathToReadme = await join(
+ dataDir,
+ "pipes",
+ pipe.id,
+ "README.md"
+ );
try {
const readme = await readFile(pathToReadme);
updatedPipe.fullDescription = convertHtmlToMarkdown(
new TextDecoder().decode(readme)
);
} catch (error) {
- updatedPipe.fullDescription = "no description available for this pipe.";
+ updatedPipe.fullDescription =
+ "no description available for this pipe.";
}
// Update pipes state and set selected pipe
setPipes(data.data);
@@ -719,18 +728,18 @@ const PipeStore: React.FC = () => {
console.error("Failed to download and show pipe:", error);
toast({
title: "error showing pipe details",
- description: "please try again or check the logs for more information.",
+ description:
+ "please try again or check the logs for more information.",
variant: "destructive",
});
}
} else {
// For already installed pipes, find the installed version
- const installedPipe = pipes.find(p => p.id === pipe.id);
+ const installedPipe = pipes.find((p) => p.id === pipe.id);
setSelectedPipe(installedPipe || pipe);
}
};
-
if (selectedPipe) {
return renderPipeDetails();
}
@@ -851,7 +860,10 @@ const PipeStore: React.FC = () => {
</div>
<div className="border rounded-lg p-4 space-y-3 w-[50%] mx-auto">
- <h3 className="text-lg font-medium">add your own pipe</h3>
+ <div className="flex justify-between items-center">
+ <h3 className="text-lg font-medium">add your own pipe</h3>
+ <PublishDialog app={selectedPipe} />
+ </div>
<div className="flex gap-2">
<div className="flex-1 relative">
<Input
diff --git a/screenpipe-app-tauri/components/publish-dialog.tsx b/screenpipe-app-tauri/components/publish-dialog.tsx
new file mode 100644
index 000000000..216b40647
--- /dev/null
+++ b/screenpipe-app-tauri/components/publish-dialog.tsx
@@ -0,0 +1,226 @@
+import React, { useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+import { Textarea } from "@/components/ui/textarea";
+import { Plus, Upload, ExternalLink } from "lucide-react";
+import { toast } from "./ui/use-toast";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+} from "@/components/ui/dialog";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "@/components/ui/tooltip";
+import { open as openUrl } from "@tauri-apps/plugin-shell";
+import { Pipe } from "./pipe-store";
+
+interface PublishDialogProps {
+ app: Pipe | null;
+}
+
+export const PublishDialog: React.FC<PublishDialogProps> = ({ app }) => {
+ const [open, setOpen] = useState(false);
+ const [name, setName] = useState(app?.id || "");
+ const [description, setDescription] = useState("");
+ const [githubUrl, setGithubUrl] = useState("");
+ const [price, setPrice] = useState("0");
+ const [isSubmitting, setIsSubmitting] = useState(false);
+ const [githubUsername, setGithubUsername] = useState("");
+ const [issueUrl, setIssueUrl] = useState<string | null>(null);
+
+ const handleSubmit = async () => {
+ try {
+ setIsSubmitting(true);
+
+ const host = "https://screenpi.pe";
+ // const host = "http://localhost:3001";
+
+ const response = await fetch(`${host}/api/publish`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ name,
+ description,
+ githubUrl,
+ price: parseFloat(price),
+ githubUsername,
+ }),
+ });
+
+ const data = await response.json();
+ if (!response.ok) throw new Error("failed to publish");
+
+ setIssueUrl(data.issueUrl);
+ toast({
+ title: "submission received",
+ description: "we'll review your app and add it to the store soon",
+ });
+ } catch (error) {
+ console.error("failed to publish:", error);
+ toast({
+ title: "error publishing app",
+ description: "please try again later",
+ variant: "destructive",
+ });
+ } finally {
+ setIsSubmitting(false);
+ }
+ };
+
+ return (
+ <>
+ <TooltipProvider>
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <Button
+ onClick={() => setOpen(true)}
+ variant="outline"
+ size="icon"
+ className="h-10 w-10"
+ >
+ <Upload className="h-4 w-4" />
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>
+ <p>publish to store</p>
+ </TooltipContent>
+ </Tooltip>
+ </TooltipProvider>
+
+ <Dialog open={open} onOpenChange={setOpen}>
+ <DialogContent className="sm:max-w-[425px]">
+ <DialogHeader>
+ <DialogTitle>publish to store</DialogTitle>
+ <DialogDescription>
+ submit your app to the screenpipe community store
+ </DialogDescription>
+ </DialogHeader>
+
+ {issueUrl ? (
+ <div className="py-6 space-y-4">
+ <div className="text-center space-y-2">
+ <div className="text-lg font-medium">
+ submission successful!
+ </div>
+ <p className="text-sm text-muted-foreground">
+ your app has been submitted for review
+ </p>
+ </div>
+ <Button className="w-full" onClick={() => openUrl(issueUrl)}>
+ <ExternalLink className="mr-2 h-4 w-4" />
+ view submission status
+ </Button>
+ <Button
+ variant="outline"
+ className="w-full"
+ onClick={() => {
+ setOpen(false);
+ setIssueUrl(null);
+ // Reset other form fields
+ setName("");
+ setDescription("");
+ setGithubUrl("");
+ setGithubUsername("");
+ }}
+ >
+ close
+ </Button>
+ </div>
+ ) : (
+ <>
+ <div className="grid gap-4 py-4">
+ <div className="grid gap-2">
+ <Label htmlFor="name">name</Label>
+ <Input
+ id="name"
+ value={name}
+ onChange={(e) => setName(e.target.value)}
+ placeholder="my-awesome-app"
+ autoCorrect="off"
+ autoComplete="off"
+ />
+ </div>
+ <div className="grid gap-2">
+ <Label htmlFor="description">description</Label>
+ <Textarea
+ id="description"
+ value={description}
+ onChange={(e) => setDescription(e.target.value)}
+ placeholder="what does your app do?"
+ />
+ </div>
+ <div className="grid gap-2">
+ <Label htmlFor="github">github repository url</Label>
+ <div className="flex gap-2">
+ <Input
+ id="github"
+ value={githubUrl}
+ onChange={(e) => setGithubUrl(e.target.value)}
+ placeholder="https://github.com/username/repo"
+ autoCorrect="off"
+ autoComplete="off"
+ />
+ <Button
+ variant="outline"
+ onClick={() => openUrl("https://github.com/new")}
+ size="icon"
+ >
+ <Plus className="h-4 w-4" />
+ </Button>
+ </div>
+ </div>
+ <div className="grid gap-2">
+ <Label htmlFor="price">price (soon)</Label>
+ <Input
+ id="price"
+ type="number"
+ value={price}
+ onChange={(e) => setPrice(e.target.value)}
+ disabled
+ min="0"
+ step="0.01"
+ />
+ </div>
+ <div className="grid gap-2">
+ <Label htmlFor="github-username">github username</Label>
+ <Input
+ id="github-username"
+ value={githubUsername}
+ onChange={(e) => setGithubUsername(e.target.value)}
+ placeholder="your github username"
+ autoCorrect="off"
+ autoComplete="off"
+ />
+ </div>
+ </div>
+ <DialogFooter>
+ <Button
+ onClick={handleSubmit}
+ disabled={
+ !name ||
+ !description ||
+ !githubUrl ||
+ !githubUsername ||
+ isSubmitting
+ }
+ >
+ {isSubmitting ? "submitting..." : "submit for review"}
+ </Button>
+ </DialogFooter>
+ </>
+ )}
+ </DialogContent>
+ </Dialog>
+ </>
+ );
+};
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.lock b/screenpipe-app-tauri/src-tauri/Cargo.lock
index 1f95a911f..5c9ca8189 100755
--- a/screenpipe-app-tauri/src-tauri/Cargo.lock
+++ b/screenpipe-app-tauri/src-tauri/Cargo.lock
@@ -4713,7 +4713,7 @@ dependencies = [
[[package]]
name = "screenpipe-app"
-version = "0.15.7"
+version = "0.15.9"
dependencies = [
"anyhow",
"axum",
diff --git a/screenpipe-app-tauri/src-tauri/Cargo.toml b/screenpipe-app-tauri/src-tauri/Cargo.toml
index 64b108012..37ffdea95 100644
--- a/screenpipe-app-tauri/src-tauri/Cargo.toml
+++ b/screenpipe-app-tauri/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "screenpipe-app"
-version = "0.15.8"
+version = "0.15.9"
description = ""
authors = ["you"]
license = ""