Skip to content

feat: Gist — browser-local code snippet manager#3

Merged
slhmy merged 2 commits intomainfrom
copilot/add-gist-feature-code-snippets
Apr 16, 2026
Merged

feat: Gist — browser-local code snippet manager#3
slhmy merged 2 commits intomainfrom
copilot/add-gist-feature-code-snippets

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

Adds a Gist tool for saving, organizing, and viewing code snippets entirely in localStorage.

Data layer

  • src/types/gist.tsGist shape: { id, title, language, content, createdAt, updatedAt }
  • src/hooks/use-gists.ts — CRUD + batch-delete over localStorage, state synced on every mutation

UI components (radix-ui primitives, matching project style)

  • dialog.tsx, select.tsx, checkbox.tsx, label.tsx, badge.tsx

Gist page (/gist)

  • Create / Edit — optional title, 23-language dropdown, monospace textarea; form opens in a Dialog
  • Syntax highlightingreact-syntax-highlighter (Prism, oneDark) with line numbers, rendered on row expand
  • Copy — per-snippet clipboard button with async error handling
  • Search — filters by title, content, or language in real time
  • Batch delete — per-row checkboxes + select-all across filtered results; confirmation dialog before destructive action

Routing

  • New /gist route in App.tsx; "Storage > Gist" entry added to sidebar

@slhmy slhmy marked this pull request as ready for review April 16, 2026 06:33
@slhmy slhmy merged commit 5170587 into main Apr 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants