feat: Add Bublr blog publishing integration#83
Open
solomonshalom wants to merge 2 commits intofarzaa:mainfrom
Open
feat: Add Bublr blog publishing integration#83solomonshalom wants to merge 2 commits intofarzaa:mainfrom
solomonshalom wants to merge 2 commits intofarzaa:mainfrom
Conversation
Add the ability to publish freewrite entries directly to Bublr.life as blog posts. ## Features - **Publish button** in bottom nav bar (between "New Entry" and theme toggle) - **API key management**: Users enter their Bublr API key once, stored securely in UserDefaults - **Publish options**: "Publish Now" (public) or "Save as Draft" (private) - **Post URL**: Opens published posts at bublr.life/@username/slug ## User Flow 1. Click "Publish" → Enter API key (get from bublr.life/docs) → Save 2. Click "Publish" → See title preview & word count → Choose publish option 3. Success → "View Post" button opens the published blog post ## Technical Details - API key validation (must start with `bublr_sk_`) - Username fetched from /api/v1/profile and cached - POST to /api/v1/posts with title, content, excerpt, published flag - Full error handling: 401 (invalid key), 404 (user not found), 429 (rate limit), 400 (validation), 500+ (server error) - Content validation: 200 char title limit, 500 char excerpt, 500KB content max - Matches existing UI patterns (hover effects, popover style, colors) ## Files Changed - freewrite/ContentView.swift: +453 lines 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
feat: Add Bublr blog publishing integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds the ability to publish freewrite entries directly to Bublr.life as blog posts. Users can now share their writing with the world without leaving the app.
What's New
bublr.life/@username/slugUser Flow
Screenshots
The UI matches the existing app design:
Technical Details
API Integration:
GET /api/v1/profile- Fetches username for post URLsPOST /api/v1/posts- Creates the blog postValidation:
bublr_sk_Error Handling:
Storage:
UserDefaults(sandboxed, persists across sessions)Code Changes
freewrite/ContentView.swift: +453 linesPublishStatusenum and Bublr API structs@Statevariables for publish flowpublishPopoverContent()andpublishIdleView()view buildersfetchBublrUsername()andpublishToBublr()network functionsextractBlogTitle()helper