Commit Graph

988 Commits

Author SHA1 Message Date
Alex Gleason 14ffa8f7e4 Fix FAB on Webxdc page by passing onFabClick through KindFeedPage
KindFeedPage's own useLayoutOptions was overwriting the onFabClick
set by WebxdcFeedPage. Now onFabClick is a KindFeedPage prop that
gets forwarded to useLayoutOptions, so only one call wins.
2026-02-27 11:24:56 -06:00
Alex Gleason 658c7d1dc1 Refactor Webxdc page to use standard Feed with tag filters
Replace the custom WebxdcFeedPage with KindFeedPage, powered by
a new tagFilters option on useFeed/Feed/KindFeedPage. The webxdc
page now uses the same follows/global tabs, pull-to-refresh, and
NoteCard rendering as every other feed.

- useFeed: accept optional tagFilters (e.g. { '#m': [...] })
- Feed/KindFeedPage: pass tagFilters through
- FloatingComposeButton: accept onFabClick callback override
- LayoutOptions: add onFabClick for custom FAB behavior
- Remove useWebxdcFeed (no longer needed)
2026-02-27 11:21:58 -06:00
Alex Gleason d540d234ce Render description as a separate card below media
Description now appears in its own rounded bg-secondary/50 card
below the media element, similar to YouTube's description box.
Media renders unwrapped at full width.
2026-02-27 11:16:38 -06:00
Alex Gleason 61a7636919 Use text-sm for description text in FileMetadataContent 2026-02-27 11:13:33 -06:00
Alex Gleason ec5c1611ef Wrap FileMetadataContent in a card with description as footer
Each MIME type now renders inside a rounded border card. The media
is the hero at the top and the description sits in a separated
footer section below. When there's no description, images and
videos skip the card wrapper to stay clean.
2026-02-27 11:06:50 -06:00
Alex Gleason 3eac7a7310 Redesign FileMetadataContent with media-first layout
Media (webxdc embed, image, video, audio) is now the hero element
rendered first. Descriptions appear below as captions. Audio gets
a styled card with track name, file size, and download button.
Generic files get a polished card with MIME label and size info.
2026-02-27 11:05:37 -06:00
Alex Gleason 23d93c0774 Add NIP-94 kind 1063 rendering in feed cards and detail pages
Kind 1063 file metadata events now dispatch to FileMetadataContent
which renders based on MIME type: webxdc apps get WebxdcEmbed,
images get ImageGallery, videos get VideoPlayer, audio gets a
native player, and unknown types show a download link.
2026-02-27 11:03:09 -06:00
Alex Gleason 5155ec2d76 Fix missing image tag for webxdc app icon in upload dialog 2026-02-27 10:56:08 -06:00
Alex Gleason 9c54592a13 Add dedicated Webxdc upload dialog for publishing kind 1063 events
Upload a .xdc file, extract manifest metadata (name, icon),
add a description, and publish a NIP-94 kind 1063 file metadata
event with url, m, x, alt, and webxdc tags. The FAB on the
/webxdc page opens this dialog instead of the kind-1 composer.
2026-02-27 10:29:44 -06:00
Alex Gleason e117c54814 Revert "Enable compose FAB on the Webxdc feed page"
This reverts commit 1655dc91bf.
2026-02-27 10:25:51 -06:00
Alex Gleason 1655dc91bf Enable compose FAB on the Webxdc feed page
The compose dialog already handles .xdc file uploads with full
webxdc metadata extraction (name, icon, UUID), so the FAB uses
fabKind: 1 to open the standard compose flow.
2026-02-27 10:23:54 -06:00
Alex Gleason 8fae0cf97a Add /webxdc feed page and sidebar menu item
Query NIP-94 kind 1063 events filtered by #m tag for
application/x-webxdc MIME type. Includes infinite scroll,
pull-to-refresh, embedded webxdc launcher, and onboarding
content selection.
2026-02-26 22:21:33 -06:00
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 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