From 5a5103bc42fb573daa8e174211eb1562ea549cfa Mon Sep 17 00:00:00 2001 From: jamey Date: Sat, 28 Mar 2026 10:13:03 +0000 Subject: [PATCH] update docs for completed social links editor - 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 --- PROGRESS.md | 8 ++-- docs/plans/editor-reorganisation.md | 64 +++++++++++++++++++++++------ 2 files changed, 57 insertions(+), 15 deletions(-) diff --git a/PROGRESS.md b/PROGRESS.md index cf6433d..b85f15c 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -30,7 +30,7 @@ Tier 1 MVP complete. Tier 2 production readiness complete (except Litestream and - Fully Tailwind-free CSS (12 KB gzipped shop+theme, 95 KB gzipped admin total) - CI pipeline (compile warnings, format, credo, dialyzer, tests) - Deployed on Fly.io with observability (LiveDashboard, ErrorTracker, structured logging) -- 1759+ tests passing, 99-100 PageSpeed mobile +- 1800+ tests passing, 99-100 PageSpeed mobile ## Next up @@ -157,13 +157,15 @@ Restructure the 3-tab editor panel for better discoverability. Replace Settings |---|------|-----|--------| | 1-4 | Data model + Site tab skeleton | 3h | done | | 5-7 | Announcement bar (editable text, link, styles) | 1.5h | done | -| 8-9 | Social links editor | 2h | done | +| 8-9 | Social links editor (CRUD, reorder, platform detection, URL normalization) | 2h | done | | 10-14 | Header & footer navigation editors | 3h | planned | | 15-16 | Footer content (about, copyright, newsletter toggle) | 1.25h | done | | 17-18 | Move branding from Theme to Site | 1.5h | planned | | 19-20 | Merge page settings into Page tab, remove Settings tab | 1h | planned | | 21-22 | Polish and testing | 2h | planned | +Social links now support 40+ platforms (grouped by category), auto-detect platform from pasted URLs (including deep links like `tg://` and `spotify:`), normalize bare domains to https://, preserve custom protocols, and filter empty URLs from shop display. + ### Unified editor session ([plan](docs/plans/unified-editor-session.md)) — Complete Unified "optimistic preview with explicit save" across all editor tabs. Changes show immediately but only persist on Save. Free tab switching without warnings. Navigation blocking with Save/Discard/Cancel modal. @@ -250,7 +252,7 @@ All plans in [docs/plans/](docs/plans/). Completed plans are kept as architectur | [profit-aware-pricing.md](docs/plans/profit-aware-pricing.md) | Planned | | [security-hardening.md](docs/plans/security-hardening.md) | Planned | | [draft-publish-workflow.md](docs/plans/draft-publish-workflow.md) | Planned | -| [editor-reorganisation.md](docs/plans/editor-reorganisation.md) | Planned | +| [editor-reorganisation.md](docs/plans/editor-reorganisation.md) | In Progress | | [seo-enhancements.md](docs/plans/seo-enhancements.md) | Planned | | [competitive-gap-analysis.md](docs/plans/competitive-gap-analysis.md) | Reference | | [competitive-gaps.md](docs/plans/competitive-gaps.md) | Planned | diff --git a/docs/plans/editor-reorganisation.md b/docs/plans/editor-reorganisation.md index 5bf4c93..2719346 100644 --- a/docs/plans/editor-reorganisation.md +++ b/docs/plans/editor-reorganisation.md @@ -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