Skip to content

feat: implement gist viewing flow with client-side decryption #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/api/gists/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export async function GET(
indent_size: metadata.indent_size,
wrap_mode: metadata.wrap_mode,
theme: metadata.theme,
// Note: We exclude edit_pin_hash, edit_pin_salt, and encrypted_metadata for security
encrypted_metadata: metadata.encrypted_metadata,
// Note: We exclude edit_pin_hash and edit_pin_salt for security
};

return NextResponse.json<GetGistMetadataResponse>(responseMetadata, {
Expand Down
20 changes: 10 additions & 10 deletions app/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ export default function CreateGistPage() {
};

return (
<Container className="max-w-6xl py-8">
<Container className="py-8">
<div className="mb-8">
<h1 className="mb-2 text-3xl font-bold">Create New Gist</h1>
<h1 className="mb-2 text-2xl font-bold">Create New Gist</h1>
<p className="text-muted-foreground">
Share code snippets with zero-knowledge encryption. Your files are
encrypted in your browser before being uploaded.
Share code snippets securely with zero-knowledge encryption. Your
files are encrypted locally in your browser before upload.
</p>
</div>

Expand All @@ -220,13 +220,13 @@ export default function CreateGistPage() {
<CardHeader>
<CardTitle>Description</CardTitle>
<CardDescription>
Add an optional description for your gist
Give your gist a memorable title or description
</CardDescription>
</CardHeader>
<CardContent>
<Input
type="text"
placeholder="Enter a brief description..."
placeholder="What's in this gist?"
value={description}
onChange={(e) => setDescription(e.target.value)}
className="w-full"
Expand All @@ -239,7 +239,7 @@ export default function CreateGistPage() {
<CardHeader>
<CardTitle>Files</CardTitle>
<CardDescription>
Add up to 20 files. Each file can be up to 500KB.
Add your code, configs, or notes. Up to 20 files, 500KB each.
</CardDescription>
</CardHeader>
<CardContent>
Expand All @@ -259,7 +259,7 @@ export default function CreateGistPage() {
<CardHeader>
<CardTitle>Options</CardTitle>
<CardDescription>
Configure expiration and edit protection for your gist.
Control who can edit and when your gist expires
</CardDescription>
</CardHeader>
<CardContent className="space-y-4">
Expand All @@ -268,7 +268,7 @@ export default function CreateGistPage() {
<Label htmlFor="expiry">Expiration</Label>
<ExpirySelector value={expiresAt} onChange={setExpiresAt} />
<p className="text-muted-foreground text-sm">
The gist will be automatically deleted after this time.
Your gist will self-destruct at the selected time
</p>
</div>

Expand All @@ -283,7 +283,7 @@ export default function CreateGistPage() {
showConfirm={false}
/>
<p className="text-muted-foreground text-sm">
If set, this PIN will be required to edit or delete the gist.
Lock down your gist - only you can edit or delete it
</p>
</div>
</CardContent>
Expand Down
Loading