Open
Description
Description
Implement complete viewing workflow integrating existing GistViewer component with decryption.
Priority
CRITICAL - This is a core functionality required for the application to be usable.
Tasks
- Implement
/g/[id]
page route - Wire up GET /api/gists/[id] and /api/blobs/[id]
- Handle URL fragment for encryption key
- Integrate existing GistViewer component
- Connect FileList component for file switching
- Use existing CodeEditor with syntax highlighting
- Wire up CopyButton component throughout
- Use existing error states for expired/deleted gists
Technical Requirements
- Must handle decryption using Web Crypto API
- URL fragments (#key=...) must be preserved and not sent to server
- Support both single and multi-file gists
- Handle expired and one-time gists appropriately
- Ensure proper error boundaries are in place
Acceptance Criteria
- Gists decrypt and display correctly
- File navigation works smoothly
- Copy/download functions work
- Expired gists show appropriate message
- One-time gists are handled properly
- Loading states are shown during data fetching
- Error states handle all failure scenarios gracefully
Dependencies
- Phase 5 APIs (GET endpoints)
- Existing UI components from Phase 4:
- GistViewer
- FileList
- CodeEditor
- CopyButton
- LoadingState
- ErrorBoundary
Estimated Time
3-4 days
References
- Phase 6 Tracking:
docs/PHASE_6_ISSUE_TRACKING.md
(Issue feat: implement R2 storage foundation #111) - API Specification:
docs/SPEC.md
- Security Guidelines:
docs/SECURITY.md