update docs for completed social links editor
Some checks failed
deploy / deploy (push) Failing after 10m12s

- Mark tasks 1-9 and 15-16 as done in editor-reorganisation plan
- Update plan status from Planned to In Progress
- Add implementation notes documenting social links architecture
- Update test count to 1800+ in PROGRESS.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jamey
2026-03-28 10:13:03 +00:00
parent 638bb4fb70
commit 5a5103bc42
2 changed files with 57 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
# Editor Panel Reorganisation
Status: Planned
Status: In Progress
## Problem
@@ -197,22 +197,22 @@ end
| # | Task | Depends | Est | Status |
|---|------|---------|-----|--------|
| 1 | Data model: new Settings fields + migrations | — | 1h | planned |
| 2 | Data model: SocialLink schema + seed defaults | 1 | 45m | planned |
| 3 | Data model: NavItem schema + seed defaults | 1 | 45m | planned |
| 4 | Site tab skeleton component | 1 | 30m | planned |
| 5 | Announcement bar: editor UI | 4 | 45m | planned |
| 6 | Announcement bar: read from Settings | 5 | 30m | planned |
| 7 | Announcement bar: style variants | 6 | 15m | planned |
| 8 | Social links: editor UI (list, add, remove, reorder) | 4 | 1.5h | planned |
| 9 | Social links: read from database | 8 | 30m | planned |
| 1 | Data model: new Settings fields + migrations | — | 1h | done |
| 2 | Data model: SocialLink schema + seed defaults | 1 | 45m | done |
| 3 | Data model: NavItem schema + seed defaults | 1 | 45m | done |
| 4 | Site tab skeleton component | 1 | 30m | done |
| 5 | Announcement bar: editor UI | 4 | 45m | done |
| 6 | Announcement bar: read from Settings | 5 | 30m | done |
| 7 | Announcement bar: style variants | 6 | 15m | done |
| 8 | Social links: editor UI (list, add, remove, reorder) | 4 | 1.5h | done |
| 9 | Social links: read from database | 8 | 30m | done |
| 10 | Header nav: editor UI | 4 | 1h | planned |
| 11 | Header nav: page picker component | 10 | 30m | planned |
| 12 | Header nav: read from database | 11 | 30m | planned |
| 13 | Footer nav: editor UI | 10 | 30m | planned |
| 14 | Footer nav: read from database | 13 | 30m | planned |
| 15 | Footer content: about, copyright, newsletter toggle | 4 | 45m | planned |
| 16 | Footer: read new fields | 15 | 30m | planned |
| 15 | Footer content: about, copyright, newsletter toggle | 4 | 45m | done |
| 16 | Footer: read new fields | 15 | 30m | done |
| 17 | Move branding settings from Theme to Site | 4 | 1h | planned |
| 18 | Theme tab: remove branding, polish remaining | 17 | 30m | planned |
| 19 | Merge page settings into Page tab | — | 45m | planned |
@@ -222,6 +222,46 @@ end
**Total estimate: ~15h**
## Implementation Notes
### Completed: Social Links (Tasks 8-9)
The social links feature supports 40+ platforms grouped into 9 categories:
- Social (Instagram, Threads, TikTok, Facebook, Twitter, Snapchat, LinkedIn)
- Video & streaming (YouTube, Twitch, Vimeo, Kick, Rumble)
- Music & podcasts (Spotify, SoundCloud, Bandcamp, Apple Podcasts)
- Creative (Pinterest, Behance, Dribbble, Tumblr, Medium)
- Support & sales (Patreon, Ko-fi, Etsy, Gumroad, Substack)
- Federated (Mastodon, Pixelfed, Bluesky, PeerTube, Lemmy, Matrix)
- Developer (GitHub, GitLab, Codeberg, SourceHut, Reddit)
- Messaging (Discord, Telegram, Signal, WhatsApp)
- Other (Linktree, RSS, Website, Custom)
**URL handling:**
- `normalize_url/1` trims whitespace and adds `https://` to bare domains
- Preserves existing protocols (`http://`, `https://`, app deep links like `tg://`, `spotify:`)
- Preserves other URI schemes (`mailto:`, `tel:`, `rss://`)
**Platform detection:**
- `detect_platform/1` auto-detects platform from pasted URLs
- Works with scheme-based detection (e.g., `tg://` → telegram, `spotify:` → spotify)
- Works with host-based detection (e.g., `github.com` → github, `bsky.app` → bluesky)
- Handles subdomain patterns (e.g., `artist.bandcamp.com` → bandcamp)
- Returns "custom" for unknown domains
**Data flow:**
- Database → `Site.list_social_links/0` → raw structs
- Shop display → `Site.social_links_for_shop/0` → filtered (no empty URLs), formatted maps
- Editor preview → `format_social_links_for_shop/1` in layout.ex → same filtering
- Social links card block now uses database data via `assigns[:social_links]`
**Files:**
- `lib/berrypod/site.ex` - Site context with social links CRUD
- `lib/berrypod/site/social_link.ex` - Schema, URL normalization, platform detection
- `lib/berrypod_web/components/shop_components/site_editor.ex` - Editor UI
- `lib/berrypod_web/page_editor_hook.ex` - Event handlers
- `test/berrypod/site_test.exs` - 35 tests covering all functionality
## UI Wireframes
### Site tab layout