The Nostr profile editor in the account settings has grown from three fields into a fuller editor. This branch adds the missing kind-0 fields, lets users replace their avatar and header image (cropped server-side and uploaded to Blossom), and cleans up a few rough edges.
What's included
More kind-0 fields.about (bio) and website are now editable. The display name reads and writes every popular variant (display_name, displayName, name, username), and a profile with no usable picture gets the account avatar's public URL written into it on save.
Avatar and header image editing. Each has an "Edit" affordance over the preview. An image is uploaded to akkounts, cropped server-side (avatar 400×400, header 1500×500), and shown as the preview; animated GIFs pass through untouched, EXIF/GPS is stripped, and transparency is flattened to white. Saving the profile signs a kind-24242 Blossom upload token with the browser's NIP-07 key, and the app uploads the stored bytes to the configured Blossom server, writing the returned URLs into the kind-0 content.
Clearer save feedback. The save-time error sits inline with the Save button on desktop and above it on mobile, and the publish endpoint now returns and logs the specific rejection reason (public key mismatch, stale created_at, invalid id/signature, …) instead of a generic "Invalid event".
Layout & housekeeping. The editor uses a responsive two-column layout; the CSRF-token lookup is a shared lib/csrf.js helper; upload caps are per field (1 MB avatar, 2 MB header).
Notes and limitations
Image processing is server-side (Rails/Vips), so uploads work over plain-HTTP origins with no Web Crypto dependency. Uploaded images are stored on akkounts as one pending attachment per field until the profile is saved or the image is replaced.
An image flushed to Blossom but whose profile is never published is left orphaned on the Blossom server; Blossom dedupes by hash, so re-saving is free.
Requires a configured Blossom server URL (admin → Services → Nostr); the edit affordances are hidden otherwise.
Testing
bundle exec rspec — 533 examples, 0 failures. New coverage: the image processor (crop dimensions, GIF passthrough, alpha handling), the store endpoint (crop, per-field caps, types, rate limit, preview route), and the flush endpoint (multiple fields, uncovered hashes, 409 dedupe, partial-failure hard-fail).
The Nostr profile editor in the account settings has grown from three fields into a fuller editor. This branch adds the missing kind-0 fields, lets users replace their avatar and header image (cropped server-side and uploaded to Blossom), and cleans up a few rough edges.
## What's included
- **More kind-0 fields.** `about` (bio) and `website` are now editable. The display name reads and writes every popular variant (`display_name`, `displayName`, `name`, `username`), and a profile with no usable `picture` gets the account avatar's public URL written into it on save.
- **Avatar and header image editing.** Each has an "Edit" affordance over the preview. An image is uploaded to akkounts, cropped server-side (avatar 400×400, header 1500×500), and shown as the preview; animated GIFs pass through untouched, EXIF/GPS is stripped, and transparency is flattened to white. Saving the profile signs a kind-24242 Blossom upload token with the browser's NIP-07 key, and the app uploads the stored bytes to the configured Blossom server, writing the returned URLs into the kind-0 content.
- **Clearer save feedback.** The save-time error sits inline with the Save button on desktop and above it on mobile, and the publish endpoint now returns and logs the specific rejection reason (public key mismatch, stale `created_at`, invalid id/signature, …) instead of a generic "Invalid event".
- **Layout & housekeeping.** The editor uses a responsive two-column layout; the CSRF-token lookup is a shared `lib/csrf.js` helper; upload caps are per field (1 MB avatar, 2 MB header).
## Notes and limitations
- Image processing is server-side (Rails/Vips), so uploads work over plain-HTTP origins with no Web Crypto dependency. Uploaded images are stored on akkounts as one pending attachment per field until the profile is saved or the image is replaced.
- An image flushed to Blossom but whose profile is never published is left orphaned on the Blossom server; Blossom dedupes by hash, so re-saving is free.
- Requires a configured Blossom server URL (admin → Services → Nostr); the edit affordances are hidden otherwise.
## Testing
`bundle exec rspec` — 533 examples, 0 failures. New coverage: the image processor (crop dimensions, GIF passthrough, alpha handling), the store endpoint (crop, per-field caps, types, rate limit, preview route), and the flush endpoint (multiple fields, uncovered hashes, 409 dedupe, partial-failure hard-fail).
The profile editor only covered display name, NIP-05 and Lightning address. Add the bio (`about`) and `website` fields, read from the existing profile and written back on save (with `website` validated as an http(s) URL).
Lay the form out in a responsive two-column grid (single column on mobile) and align the submit button with the other account settings forms. Also fix the avatar size utility (`size:28` -> `size-28`), which left the avatar unsized on small screens and let it overlap the display-name label.
Avatar and banner image editing is still to come.
When the published profile has no usable `picture` (missing, blank, or not an http(s) URL), the editor previews the account avatar and writes its public URL into the profile on save. An existing valid picture is left untouched.
The component exposes the account avatar URL to the Stimulus controller, which applies it in `content()` only when `picture` is absent or not a URL, so the preview and the published content agree.
The save-time error (e.g. a rejected signature) sat on its own line above the button. Move it into the footer row: at the start of the line and vertically centered on desktop, and on the line above the full-width button on mobile.
The publish endpoint collapsed every validation failure into a generic "Invalid event", making a real-world rejection impossible to diagnose. Return and log the specific reason instead: public key mismatch, non-integer created_at/kind, disallowed kind, invalid id/signature, stale created_at, content/tags too large, or a malformed request.
Four controllers each read the csrf-token meta tag themselves. Move the lookup into lib/csrf.js and import it, ahead of the profile image upload controller that also needs it.
Add a server-side API for avatar and header images: uploads are cropped with Vips (400x400 and 1500x500, GIFs passed through, EXIF stripped, transparency flattened to white) and stored as one pending attachment per field. Saving the profile flushes them to the configured Blossom server, authorized by a user-signed kind-24242 token whose x tags cover the stored hashes.
The editor gains edit affordances over the avatar and header image and an upload panel that stores the image (previewing the server-cropped result) and records it as pending. Saving the profile signs a Blossom upload token, flushes the pending images, merges the returned URLs into the kind-0 content, and keeps pending state until the publish succeeds so a retry re-flushes.
raucao
marked the pull request as ready for review 2026-11-19 18:04:36 +00:00
raucao
requested review from greg 2026-11-19 18:04:41 +00:00
raucao
changed title from Add about and website fields to the Nostr profile editor to Nostr profile editor: about/website fields and avatar/header image uploads2026-11-19 18:05:28 +00:00
raucao
changed title from Nostr profile editor: about/website fields and avatar/header image uploads to Nostr profile editor improvements2026-11-19 18:06:03 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The Nostr profile editor in the account settings has grown from three fields into a fuller editor. This branch adds the missing kind-0 fields, lets users replace their avatar and header image (cropped server-side and uploaded to Blossom), and cleans up a few rough edges.
What's included
about(bio) andwebsiteare now editable. The display name reads and writes every popular variant (display_name,displayName,name,username), and a profile with no usablepicturegets the account avatar's public URL written into it on save.created_at, invalid id/signature, …) instead of a generic "Invalid event".lib/csrf.jshelper; upload caps are per field (1 MB avatar, 2 MB header).Notes and limitations
Testing
bundle exec rspec— 533 examples, 0 failures. New coverage: the image processor (crop dimensions, GIF passthrough, alpha handling), the store endpoint (crop, per-field caps, types, rate limit, preview route), and the flush endpoint (multiple fields, uncovered hashes, 409 dedupe, partial-failure hard-fail).Add about and website fields to the Nostr profile editorto Nostr profile editor: about/website fields and avatar/header image uploadsNostr profile editor: about/website fields and avatar/header image uploadsto Nostr profile editor improvements👍