Skip to content

Commit 8d91b3f

Browse files
nullcoderclaude
andcommitted
feat: implement gist viewing flow with client-side decryption
Implement comprehensive gist viewing page with complete decryption capabilities and polished UI. Add client-side decryption for both file content and metadata, handle encrypted metadata retrieval, implement auto-height code editor, fix button styling consistency, and enhance text content with engaging copy. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 019e480 commit 8d91b3f

File tree

10 files changed

+387
-36
lines changed

10 files changed

+387
-36
lines changed

app/api/gists/[id]/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ export async function GET(
8282
indent_size: metadata.indent_size,
8383
wrap_mode: metadata.wrap_mode,
8484
theme: metadata.theme,
85-
// Note: We exclude edit_pin_hash, edit_pin_salt, and encrypted_metadata for security
85+
encrypted_metadata: metadata.encrypted_metadata,
86+
// Note: We exclude edit_pin_hash and edit_pin_salt for security
8687
};
8788

8889
return NextResponse.json<GetGistMetadataResponse>(responseMetadata, {

app/create/page.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ export default function CreateGistPage() {
205205
};
206206

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

@@ -220,13 +220,13 @@ export default function CreateGistPage() {
220220
<CardHeader>
221221
<CardTitle>Description</CardTitle>
222222
<CardDescription>
223-
Add an optional description for your gist
223+
Give your gist a memorable title or description
224224
</CardDescription>
225225
</CardHeader>
226226
<CardContent>
227227
<Input
228228
type="text"
229-
placeholder="Enter a brief description..."
229+
placeholder="What's in this gist?"
230230
value={description}
231231
onChange={(e) => setDescription(e.target.value)}
232232
className="w-full"
@@ -239,7 +239,7 @@ export default function CreateGistPage() {
239239
<CardHeader>
240240
<CardTitle>Files</CardTitle>
241241
<CardDescription>
242-
Add up to 20 files. Each file can be up to 500KB.
242+
Add your code, configs, or notes. Up to 20 files, 500KB each.
243243
</CardDescription>
244244
</CardHeader>
245245
<CardContent>
@@ -259,7 +259,7 @@ export default function CreateGistPage() {
259259
<CardHeader>
260260
<CardTitle>Options</CardTitle>
261261
<CardDescription>
262-
Configure expiration and edit protection for your gist.
262+
Control who can edit and when your gist expires
263263
</CardDescription>
264264
</CardHeader>
265265
<CardContent className="space-y-4">
@@ -268,7 +268,7 @@ export default function CreateGistPage() {
268268
<Label htmlFor="expiry">Expiration</Label>
269269
<ExpirySelector value={expiresAt} onChange={setExpiresAt} />
270270
<p className="text-muted-foreground text-sm">
271-
The gist will be automatically deleted after this time.
271+
Your gist will self-destruct at the selected time
272272
</p>
273273
</div>
274274

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

0 commit comments

Comments
 (0)