🏗️ Architecture
- Refactored flat Go files into
cmd/server/ + internal/{api,models,storage,util} package layout
- Extracted monolithic
index.html into Go html/template components (layout/, components/)
- Migrated inline JavaScript to ES modules (
static/js/{main,state,dom,ui,paste,diff,utils}.js)
- Dockerfile updated to build from
cmd/server/ and copy templates + static assets
✨ Features
- Diff workspace — side-by-side line-level diff viewer powered by go-difflib. Diffs can be saved, listed, searched, and shared with permanent URLs at
/diff/<id>
- Command palette —
Cmd/Ctrl + K opens a fuzzy-searchable palette for workspace switching and quick actions
- OG preview images — each paste generates a syntax-highlighted PNG preview (1200×630, Dracula theme) via Chroma + gg for rich social media link unfurling
- Paste editing —
PUT /api/pastes/{id} allows in-place updates to existing pastes
- Diff search —
GET /api/search_diffs?q={query} for full-text search across saved diffs
- Code formatting —
Cmd/Ctrl + Shift + F formats code in the paste editor
📦 New Dependencies
| Package |
Purpose |
| go-difflib |
Structured line-level diff computation |
| Chroma |
Server-side syntax highlighting for OG preview images |
| gg + x/image |
2D graphics and font rendering for preview PNGs |
🔧 API Changes
New Endpoints
| Method |
Path |
Description |
PUT |
/api/pastes/{id} |
Update an existing paste |
GET |
/api/pastes/{id}/preview.png |
Syntax-highlighted OG preview image |
POST |
/api/diff |
Compute a diff (returns opcodes + lines) |
POST |
/api/saved_diffs |
Save a diff |
GET |
/api/saved_diffs |
List saved diffs (time-bucketed) |
GET |
/api/saved_diffs/{id} |
Get a saved diff |
DELETE |
/api/saved_diffs/{id} |
Delete a saved diff |
GET |
/api/search_diffs?q={query} |
Search across diffs |
⌨️ Keyboard Shortcuts
| Shortcut |
Action |
Ctrl/Cmd + S |
Save current paste or diff |
Ctrl/Cmd + K |
Open command palette |
Ctrl/Cmd + N |
New paste or diff |
Ctrl/Cmd + Shift + F |
Format code (paste editor) |
Escape |
Close palette / sidebar |
📝 Docs
- Rewrote README.md — condensed from ~450 to ~230 lines with grouped features and API endpoint tables
- Updated all
.agent/ files (ARCHITECTURE, PHILOSOPHY, STYLE, STATUS, TESTING)
🐛 Fixes (included in this release)
- Fixed
.gitignore pattern server → /server to prevent excluding cmd/server/ (#25)
- Added
.dockerignore for proper Docker build context (#25)
- Added missing
cmd/server/main.go that was blocked by the old gitignore (#26)
Full Changelog: v1.2.0...v1.3.0