Commit Graph

1065 Commits

Author SHA1 Message Date
Alex Gleason 86357bbc85 Sync active profile theme from kind 16767 on pageload when autoShareTheme is enabled 2026-02-26 21:38:31 -06:00
Alex Gleason 893201a5e5 Add Themes link to the left sidebar 2026-02-26 21:19:07 -06:00
Alex Gleason 82a92b50d2 Add 'Browse themes' link at the bottom of /settings/theme 2026-02-26 21:17:20 -06:00
Alex Gleason 7bf433efb1 Add theme publishing and editor mode to ThemeSelector
- Rename 'Colors' card heading to 'Custom'
- Add 'Publish Theme' button that opens a dialog to publish kind 36767 events
- Query and display user's published themes in the grid after presets
- Clicking a user theme enters editor mode, showing 'Update Theme' alongside
  'Publish Theme' to update the existing event in place
- Exit editor mode when selecting a builtin theme or preset
2026-02-26 21:04:16 -06:00
Alex Gleason 35d3eb67bd Move auto-share theme toggle into its own card below the customize card 2026-02-26 20:56:07 -06:00
Alex Gleason aa6bf00c7b Fix color picker dropping background image and font from theme presets
When changing a color via the inline color picker in ThemeSelector,
the handler was passing bare CoreThemeColors to applyCustomTheme(),
which replaced the entire customTheme config and dropped the font
and background fields. Now spreads the existing customTheme before
applying the new colors, matching the pattern used by FontPicker
and BackgroundPicker.
2026-02-26 20:54:34 -06:00
Alex Gleason 95b11365ff Remove 'Share theme on profile' toggle from edit profile form 2026-02-26 20:29:07 -06:00
Alex Gleason c7f6cc5947 Default to Inter font on profiles with no f tag to prevent font leakage
When visiting a profile that has theme colors but no font tag,
the effective font was undefined, which removed the font override
entirely — letting the visitor's custom font bleed through. Now
profiles without an f tag explicitly default to Inter.
2026-02-26 20:20:42 -06:00
Alex Gleason 7c43a39caf Use dropdown menu for palette button when profile theme differs
When viewing your own profile and your custom theme differs from the
published one, the palette button now opens a dropdown with 'Update
Profile Theme' and 'Delete Profile Theme' options instead of directly
opening the update dialog. The initial share scenario (no published
theme yet) keeps the single-click tooltip behavior.
2026-02-26 20:17:30 -06:00
Alex Gleason 3cad0fddc9 Fix copied theme not persisting after navigating away from profile
The profile page useEffect cleanup was restoring the user's theme from
stale closure values captured before Copy Theme was clicked. Use a ref
to always read the latest ownTheme/ownCustomTheme/configuredThemes at
cleanup time so the newly copied theme is correctly restored.
2026-02-26 20:13:29 -06:00
Alex Gleason 32e5d8740f Move Copy Theme into palette dropdown menu and fix it to apply immediately
Instead of a standalone link that redirected to /settings/theme?import=,
the Copy Theme action is now a menu item inside the palette icon dropdown
on other users' profiles. It immediately applies the profile's theme as
the user's custom app theme (including font and background), and if
autoShareTheme is enabled, auto-publishes a kind 16767 event too.
2026-02-26 20:05:10 -06:00
Alex Gleason ed21e5371c Merge branch 'main' of gitlab.com:soapbox-pub/ditto-mew 2026-02-26 19:54:16 -06:00
Alex Gleason 14f75ed50d Add auto-share theme toggle: automatically publish custom theme changes to profile 2026-02-26 19:53:46 -06:00
Chad Curtis 2d2fdfb2a5 Fix missing divider border between notification items 2026-02-26 19:51:45 -06:00
Chad Curtis 5b1304ca79 Add border-b to threadedLast NoteCard to separate from next reply 2026-02-26 19:50:30 -06:00
Chad Curtis a83ddb5009 Refactor NoteCard: DRY up action buttons and merge threaded layouts into one branch 2026-02-26 19:49:30 -06:00
Chad Curtis 11c4579dfd Remove sub-reply indent wrapper, fix inline author layout with threadedLast 2026-02-26 19:47:52 -06:00
Alex Gleason 8fbe3d58e6 Remove 'Display my theme to others' toggle from theme settings page 2026-02-26 19:44:05 -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 aaee65f4f2 Replace remove-theme tooltip button with dropdown menu for two-step confirmation 2026-02-26 19:25:42 -06:00
Alex Gleason 690800ccaa Fix font comparison to use family name only, ignoring CDN URL added at publish time 2026-02-26 19:23:46 -06:00
Alex Gleason 5fb57745b6 Fix theme comparison to use hex values, avoiding HSL precision loss from round-trip 2026-02-26 19:21:28 -06:00
Alex Gleason 667455aa1e Add palette button to remove profile theme when in sync or on non-custom theme 2026-02-26 19:19:53 -06:00
Alex Gleason 36de53dda8 Show share-theme prompt when app theme differs from published profile theme 2026-02-26 19:16:45 -06:00
Alex Gleason 3e686d90d8 Style share-theme dialog with the user's custom theme colors 2026-02-26 19:08:08 -06:00
Alex Gleason e86c734456 Apply system theme fallback on own profile when no profile theme is published 2026-02-26 19:00:56 -06:00
Alex Gleason 619db458ae Fall back to system theme on profiles with no custom theme when visitor uses a custom theme 2026-02-26 18:59:14 -06:00
Alex Gleason ff65072afe Move Themes section above Customize card on theme settings page 2026-02-26 18:17:43 -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