Commit Graph

1039 Commits

Author SHA1 Message Date
Chad Curtis 11c4579dfd Remove sub-reply indent wrapper, fix inline author layout with threadedLast 2026-02-26 19:47:52 -06:00
Chad Curtis 4d83a6c934 Improve reply threading: show first sub-reply as hint, use text color for connector line 2026-02-26 19:44:05 -06:00
Chad Curtis dd628c62e9 Filter trends, search, and global feed to protocol:nostr only 2026-02-26 19:26:53 -06:00
Alex Gleason a3b2fbdf19 Merge branch 'main' of gitlab.com:soapbox-pub/ditto-mew 2026-02-26 18:09:48 -06:00
Chad Curtis fb9064cb0e Add pull-to-refresh to notifications; simplify Android notifications to use 'Someone' instead of fetching kind 0 metadata 2026-02-26 18:06:53 -06:00
Chad Curtis 223849070c fix: deduplicate browser PWA notifications to prevent showing twice
Remove nostr from useEffect dependencies (replacing with a ref) so the
subscription is not torn down and re-opened on every render cycle.
Add a seenIds Set to guard against the same event ID firing multiple
notifications even if the relay delivers it more than once.
2026-02-26 18:06:53 -06:00
Alex Gleason be6980359f Eliminate duplicated schema by deriving DittoConfigSchema from AppConfigSchema
Delete the separate config/schema.ts that duplicated every Zod schema.
DittoConfigSchema is now simply AppConfigSchema.partial().strict(),
defined in src/lib/schemas.ts alongside everything else. vite.config.ts
imports it directly via a relative path.
2026-02-26 17:57:55 -06:00
Alex Gleason 3eb92f472c Support build-time ditto.json config file
Read an optional ditto.json (or CONFIG_FILE env) at build time, validate
it with Zod, and inject the result via Vite's define. At runtime the
build-time values are merged between the hardcoded defaults and user
localStorage, giving precedence: user > build-time > hardcoded.

Extract canonical Zod schemas into config/schema.ts (no path aliases)
so they can be imported from both vite.config.ts and runtime code.
Move AppConfigSchema out of AppProvider into src/lib/schemas.ts to
eliminate duplication.
2026-02-26 17:53:54 -06:00
Alex Gleason d45adf604a Route all light/dark theme resolution through resolveThemeConfig()
Every place that previously read builtinThemes directly for light/dark
mode now calls resolveThemeConfig(), which checks config.themes first
and falls back to builtinThemes. This ensures configured themes are
actually used for colors, fonts, and backgrounds in all code paths:
AppProvider, useTheme, ThemeSelector, ThemeBuilderPage, ProfilePage.
2026-02-26 17:41:31 -06:00
Alex Gleason 6b0972945e Update theme kind numbers in code: 33891 -> 36767, 11667 -> 16767 2026-02-26 17:32:33 -06:00
Alex Gleason c0c65047fa Update NIP.md kind numbers: 33891 -> 36767, 11667 -> 16767 2026-02-26 17:31:05 -06:00
Alex Gleason 97f873118e Add themes config to AppConfig for configurable light/dark themes
Allow self-hosters to override the builtin light/dark themes by setting
a themes field in AppConfig with full ThemeConfig objects (colors, fonts,
backgrounds) for each mode.
2026-02-26 17:29:54 -06:00
Alex Gleason ee3374a762 Make "system" the default theme 2026-02-26 16:44:12 -06:00
Alex Gleason a03d8454e3 Apply background image from profile theme when viewing other users' profiles 2026-02-26 16:35:25 -06:00
Alex Gleason 92c1d98fe2 Merge branch 'main' of gitlab.com:soapbox-pub/ditto-mew 2026-02-26 16:22:53 -06:00
Alex Gleason dd2f7af3d3 Don't put black overlay over color picker items 2026-02-26 16:22:39 -06:00
Alex Gleason 01e689a3b5 Only show custom font/background in pickers when theme is 'custom'
When switching to builtin themes (Light/Dark/System), setTheme doesn't
clear customTheme, so the FontPicker and BackgroundPicker were still
showing the previous preset's font/background. Now they check that the
active theme is 'custom' before displaying the current selection.
2026-02-26 16:17:16 -06:00
Alex Gleason cd6d5f7a7c Replace Comic Neue with Comic Relief in bundled fonts 2026-02-26 16:15:09 -06:00
Alex Gleason 3247624600 Fix font not updating when switching between presets
Use primitive fontFamily/fontUrl strings as effect dependencies instead
of the font object reference, matching the same fix applied to
background handling.
2026-02-26 16:13:51 -06:00
Alex Gleason 4be0c49aa5 Remove White, Black, Midnight, and Ocean preset themes 2026-02-26 16:12:22 -06:00
Alex Gleason 724df5e5d9 Fix background not clearing when switching to a preset without one
Use primitive bgUrl/bgMode strings as effect dependencies instead of
the background object reference, ensuring React detects the change
when switching between presets with and without backgrounds.
2026-02-26 16:03:15 -06:00
Alex Gleason 0211648162 Show background image in theme preset preview tiles 2026-02-26 15:58:41 -06:00
Alex Gleason 1a2ada9942 Add cherry blossom background to Pink preset, pass background through all preset application sites 2026-02-26 15:56:32 -06:00
Alex Gleason 0af913c6ab Actually, only put background on center column 2026-02-26 15:54:34 -06:00
Alex Gleason 0b7928d38b Apply background color to main layout 2026-02-26 15:32:34 -06:00
Chad Curtis cbecefad84 Fix Android launcher icons: generate ic_launcher.png and ic_launcher_round.png with logo
The icon generation script was only producing ic_launcher_foreground.png
(adaptive icon layer) and leaving ic_launcher.png/ic_launcher_round.png as
solid purple squares with no logo. This caused the app icon to appear as a
big purple circle on device. The script now generates all three icon types
at all density buckets.
2026-02-26 15:32:02 -06:00
Alex Gleason b5a59ac9a6 Remove 'contain' background mode from NIP.md and codebase, keep only cover and tile 2026-02-26 15:22:35 -06:00
Chad Curtis a742e89872 Add new file 2026-02-26 21:20:15 +00:00
Alex Gleason 78169c62d3 Add background image picker to theme settings
Upload images via Blossom, store in ThemeConfig.background, and apply
as a fixed CSS background on <body>. Supports cover/tile/contain modes.
Background picker sits in the consolidated customize card between the
font picker and the share toggle.
2026-02-26 15:14:00 -06:00
Alex Gleason 3487d87e5e Consolidate colors, font, and share toggle into a single card on theme settings 2026-02-26 15:08:33 -06:00
Alex Gleason 108c4139ca Add font pairings to theme presets (Pink/Comfortaa, Toxic/JetBrains Mono, Sunset/Lora)
Also fix all preset application sites (ThemeSelector, SidebarThemeDropdown,
LeftSidebar, InitialSyncGate) to pass the font along with colors when
selecting a preset.
2026-02-26 15:05:58 -06:00
Chad Curtis fa250e6a19 Wire notifications toggle to encrypted settings; add PWA browser notification support
- Add notificationsEnabled to EncryptedSettings schema and interface
- NotificationSettings now persists the toggle to encrypted settings (synced across devices) instead of ephemeral local state
- useNativeNotifications: Capacitor path skips DittoNotification.configure when notificationsEnabled is false
- useNativeNotifications: web/PWA path opens a live Nostr req subscription and fires browser Notification API events when permission is granted and the setting is enabled
2026-02-26 15:05:47 -06:00
Alex Gleason 2acabeb833 Move FontPicker into ThemeSelector, below colors and above share toggle 2026-02-26 15:01:02 -06:00
Alex Gleason 1555fe342b Add FontPicker to theme builder page below the colors section 2026-02-26 14:59:33 -06:00
Alex Gleason bc4cc80581 Simplify theme fonts to a single font (remove heading/body roles)
Reduce font complexity from two-role (title/body) to a single font
that applies globally to all text. Updates NIP.md f tag format from
["f", family, role, url] to ["f", family, url], removes ThemeFonts
wrapper in favor of a single ThemeFont on ThemeConfig.font, and
simplifies FontPicker to a single dropdown.
2026-02-26 14:57:41 -06:00
Chad Curtis 8c6747e46f Regenerate Android adaptive icon foreground PNGs 2026-02-26 14:56:50 -06:00
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