Commit Graph

1003 Commits

Author SHA1 Message Date
Alex Gleason fbcd40e164 Fix share toggle to include fonts/background in active profile theme
ThemeSelector was constructing a new ThemeConfig with only colors when
sharing, discarding the fonts and background from the customTheme.
Now passes the full customTheme (which already is a ThemeConfig).
2026-02-26 14:50:20 -06:00
Alex Gleason 3b15044919 Implement ThemeConfig type system with bundled fonts and NIP.md-compliant event parsing
- Add ThemeConfig wrapper type (colors + fonts + background) replacing bare CoreThemeColors
- Sync theme event parsing/building with NIP.md spec: colors in c tags (hex), fonts in f tags, background in bg tags (imeta-style), empty content field
- Legacy backward compat: parse old JSON-in-content format and bare CoreThemeColors in localStorage/encrypted settings
- Bundle 10 curated fonts via fontsource (Inter, DM Sans, Outfit, Montserrat, Lora, Merriweather, Playfair Display, JetBrains Mono, Comfortaa, Comic Neue) with lazy dynamic imports
- Create font loader (src/lib/fontLoader.ts) for @font-face injection from remote URLs and CSS override application for title/body roles
- Rewrite FontPicker as dual title/body picker using bundled fonts instead of Google Fonts CDN
- Remove Google Fonts integration (useGoogleFont.ts, GoogleFontLoader.tsx)
- Resolve bundled font family names to CDN URLs when publishing to Nostr
- Apply profile theme fonts when visiting other users' profiles
- Update all consumers: AppProvider, useTheme, usePublishTheme, useEncryptedSettings, ThemeSelector, ThemeBuilderPage, ProfilePage, EditProfileForm, InitialSyncGate, NostrSync
2026-02-26 14:46:30 -06:00
Alex Gleason 51304a3a7c Add font (f) and background (bg) tags to theme event spec
Replace the u tag with a richer bg tag using imeta-style key-value
pairs (url, mode, m required; dim, blurhash optional). Add f tag for
font declarations (family, role, and font file URL required). Both
tags are documented in a shared definitions section for kind 33891
and kind 11667.
2026-02-26 14:26:08 -06:00
Alex Gleason 8b98154361 Add dynamic Google Font picker for per-user custom base font
Loads any Google Font on demand, applies it site-wide via injected
stylesheet, and persists the selection in localStorage. Available
in Settings > Theme alongside the existing color theme selector.
2026-02-26 12:57:05 -06:00
Alex Gleason 14dcb8ce81 Add optional u tag for background image to both theme kinds 2026-02-26 12:45:05 -06:00
Alex Gleason ed8a1d59b5 Remove description and t tags from kind 33891 2026-02-26 12:40:15 -06:00
Alex Gleason 9d0efe76a3 Update kind 33891 to use c tags for hex colors instead of content JSON
Align theme definition event with kind 11667 by replacing the HSL
color token JSON in the content field with c tags using 6-digit hex
color codes and required markers (primary, text, background).
2026-02-26 12:39:19 -06:00
Alex Gleason 2c3260760a Update kind 11667 to use c tags for hex colors instead of content JSON
Replace the HSL color tokens in the content field with c tags using
6-digit hex color codes and required markers (primary, text, background).
Remove the a tag for theme attribution. Add optional title tag.
2026-02-26 12:35:56 -06:00
Alex Gleason 1a17a3a068 Show pencil icon on color swatches always, not just on hover 2026-02-26 11:59:13 -06:00
Alex Gleason 970c0119b1 Replace hint text with pencil overlay on color swatches for intuitive editability 2026-02-26 11:53:59 -06:00
Alex Gleason 1c8761440c Improve theme color editor discoverability with circle swatches and hint text 2026-02-26 11:51:15 -06:00
Alex Gleason 3e46966457 Add interaction buttons to threaded ancestor posts in thread view 2026-02-26 11:45:49 -06:00
Alex Gleason 30328c77d4 Add relay hints to kind 1 posts we create 2026-02-26 11:16:00 -06:00
Chad Curtis 1dd795845e fix: remove unused variables to resolve ESLint errors 2026-02-26 06:51:49 -06:00
Chad Curtis d42ca5f300 feat: add 'Set as theme' button to color moment palettes with WCAG-enforced color mapping 2026-02-26 06:10:33 -06:00
Chad Curtis 01e190476b fix: theme page mobile layout, remove white from quick theme toggle, use SwatchBook icon for theme nav item 2026-02-26 06:02:39 -06:00
Chad Curtis 82b465836b feat: split search and trends into separate pages, prefill accounts with follows, hide bottom nav items from mobile drawer 2026-02-26 05:57:26 -06:00
Chad Curtis ea3c488918 fix: always show edit sidebar in more menu, hide divider when no hidden items 2026-02-26 05:46:00 -06:00
Chad Curtis 04b601c646 feat: rename lavender preset to white, place before black 2026-02-26 05:43:04 -06:00
Chad Curtis 7f0614f36a feat: primary-colored active nav links, primary-tinted borders, lavender as default light theme 2026-02-26 05:41:21 -06:00
Chad Curtis 8e5b59c44e feat: use planet icon for feed nav item 2026-02-26 05:37:19 -06:00
Chad Curtis 79c143fab1 fix: replace image URLs with newline in disableEmbeds preview mode 2026-02-26 05:37:01 -06:00
Chad Curtis 0576775a57 fix: suppress image URLs in triple-dot menu post preview
When disableEmbeds is true, image-embed tokens now return null instead of
rendering the raw URL as a link. This fixes the triple-dot (more menu)
preview showing bare blossom/image URLs instead of clean post text.
2026-02-26 05:36:27 -06:00
Chad Curtis 6f5a07c0a9 Render images inline at their position in post content
- Images now render inline via NoteContent at the position of their URL
  rather than collected into a gallery block below the text
- Clicking an inline image opens a full lightbox with navigation across
  all images in the post; lightbox index is tracked by position so
  duplicate URLs open at the correct index
- Removed separate ImageGallery/extractImages from NoteCard,
  PostDetailPage, and ComposeBox to prevent double-rendering
- Added disableEmbeds to NoteMoreMenu clamped preview to avoid block
  embeds inside a line-clamp-3 container
- Fixed hasPreviewableContent in ComposeBox to detect image-only posts
  so the Preview tab appears correctly
- Removed mp3/ogg/wav/pdf from MEDIA_URL_REGEX suppression list; those
  URLs now render as clickable links instead of being silently dropped
- Added avif to IMAGE_URL_REGEX; added cursor-pointer to InlineImage
2026-02-26 04:35:03 -06:00
Alex Gleason f5ee5f0d02 Nudge notification dot upward in mobile bottom nav 2026-02-26 04:18:46 -06:00
Alex Gleason 65fe8bdabf Nudge notification dot slightly upward in sidebar 2026-02-26 04:16:49 -06:00
Alex Gleason 808ba73860 Clear active theme by publishing empty replacement instead of kind 5
Publish a new kind 11667 event with empty content and tags to clear
the active profile theme, replacing the previous kind 5 deletion
approach. The parser already returns null for empty content, so the
toggle state updates correctly.
2026-02-26 04:13:44 -06:00
Alex Gleason 5ca237e8a6 Include 'e' tag in active theme deletion events
Pass the event ID of the active profile theme to clearActiveTheme so
the kind 5 deletion includes both an 'a' tag and an 'e' tag. Updated
all call sites (ThemeSelector and EditProfileForm).
2026-02-26 04:12:31 -06:00
Alex Gleason 808d44aeff Reconcile theme settings changes and add share toggle
Merge upstream changes with the theme settings refactor. Adds a
'Display my theme to others' toggle that publishes a kind 11667
active profile theme event when enabled and issues a kind 5 deletion
when disabled. Split /settings/appearance into /settings/theme and
/settings/content. Move theme builder to /settings/theme/edit.
2026-02-26 04:10:23 -06:00
Alex Gleason 2ef7d3873a Merge branch 'main' of gitlab.com:soapbox-pub/ditto-mew 2026-02-26 03:57:30 -06:00
Chad Curtis c4723ccd41 Reconcile upstream changes with mobile nav refactor 2026-02-26 03:53:15 -06:00
Chad Curtis 68f0dd742a Refactor mobile nav with shared sidebar components and improved drawer UX 2026-02-26 03:51:33 -06:00
Alex Gleason 230e43d365 Add Theme as an optional sidebar item
Add 'theme' to BUILTIN_SIDEBAR_ITEMS so it can be added to the left
sidebar via the More menu or drag-and-drop. Uses the Paintbrush icon
and navigates to /settings/theme. Active state detection distinguishes
it from the general Settings highlight.
2026-02-26 03:31:46 -06:00
Alex Gleason ff6c9c5b67 Move color editor above the themes grid 2026-02-26 03:25:32 -06:00
Alex Gleason 0913111f64 Always show color editor, remove Custom button
The color pickers are now always visible below the theme grid,
reflecting the effective colors of whatever theme is active. Changing
a color automatically switches to a custom theme. Removed the
explicit Custom card and the customSelected state tracking.
2026-02-26 03:23:41 -06:00
Alex Gleason 304da7780e Replace My Themes section with inline Custom theme editor
Remove 'Create Theme' and 'Public Themes' buttons from the theme
selector. Add a 'Custom' option at the end of the presets grid that
opens an inline color editor (background, text, primary) with live
preview. The Custom option auto-selects on page load when the active
theme doesn't match any preset.
2026-02-26 03:17:40 -06:00
Alex Gleason 69875bd57a Split /settings/appearance into /settings/theme and /settings/content
Replace the tabbed Appearance settings page with two separate pages:
- /settings/theme for theme selection
- /settings/content for feed and content preferences

Move the theme builder from /settings/theme to /settings/theme/edit to
avoid the route conflict. Update all navigation links across the codebase.
2026-02-26 03:11:04 -06:00
Alex Gleason 29a9a0f36c Merge branch 'add-custom-theme-editor-ui' 2026-02-26 02:28:23 -06:00
Alex Gleason 28e10e4daf Use muted-foreground color for mobile top bar menu icon 2026-02-26 02:27:53 -06:00
Alex Gleason 7836dc34d1 Move menu button to right side of mobile top bar 2026-02-26 02:27:19 -06:00
Alex Gleason 62e1bc90cf Move menu to left, center logo in mobile top bar 2026-02-26 02:26:07 -06:00
Alex Gleason f1aae4c027 Move Edit sidebar to bottom of More menu 2026-02-26 00:59:52 -06:00
Alex Gleason 8be85e50a2 Align More menu padding and hover styles across all items 2026-02-26 00:59:17 -06:00
Alex Gleason e25168e4ce Use subtle secondary hover for More menu item links 2026-02-26 00:58:16 -06:00
Alex Gleason 3e51984567 Fix More menu: separate link and + button hover states, close on click 2026-02-26 00:57:20 -06:00
Alex Gleason 7582266de2 Redesign More menu: items navigate on click, + button adds to sidebar 2026-02-26 00:54:02 -06:00
Alex Gleason 4c5e2fb72d Restore gap-0.5 between sidebar nav items 2026-02-26 00:47:37 -06:00
Alex Gleason 438c59b0b4 Move search bar from right sidebar into left sidebar permanently 2026-02-26 00:45:32 -06:00
Alex Gleason 863ef9114c Show 'Edit sidebar' button directly when no hidden items remain 2026-02-26 00:43:10 -06:00
Alex Gleason ff3e9b3f53 Fix Edit sidebar icon hover state to match other dropdown items 2026-02-26 00:41:53 -06:00