Commit Graph

4447 Commits

Author SHA1 Message Date
Alex Gleason 930e4dc006 Use FAB + full compose dialog for comments on external content pages
Widen ComposeBox.replyTo and ReplyComposeModal.event to accept URL,
enabling the standard post composer for NIP-22 comments on external
content. Replace the inline CommentForm on /i/ pages with a FAB that
opens ReplyComposeModal, giving users the full compose experience
with file uploads, emoji picker, and content warnings.
2026-02-27 23:45:27 -06:00
Alex Gleason ebca2ec761 Extract shared ExternalContentHeader and show parent preview on comment detail
Refactor the external content header components (URL, Book, Country)
and helpers out of ExternalContentPage into a shared module at
ExternalContentHeader.tsx. Both the /i/ page and PostDetailPage now
import from this shared module.

Add a compact ExternalContentPreview component that shows a rich
inline preview (thumbnail, title, favicon) of the external content
being commented on. This is displayed above the focused comment on
the nevent detail page for kind 1111 comments with I tags, similar
to how AncestorThread shows the parent for kind 1 replies.
2026-02-27 23:37:20 -06:00
Alex Gleason 54a33bd108 Replace CommentsSection with NoteCard threading on external content pages
Use the same NoteCard-based threaded comment display on /i/ pages
that the rest of the app uses for post detail views. This replaces
the custom recursive Comment tree with the standard threaded layout
(direct replies + first sub-reply preview).

Also fix PostDetailPage and ComposeBox to handle I (external content)
tags when reconstructing the root for kind 1111 comments, enabling
proper threading when viewing or replying to comments on URLs.
2026-02-27 23:30:21 -06:00
Alex Gleason e11a12646a Use runtime ridge detection for pixelated logo easter egg
Replaces the SVG filter approach with dynamic pixel art generation:
rasterize the logo SVG to a 16x16 canvas, run ridge detection to
extract thin 1px strokes, and use the result as a CSS mask. Works
with any custom logo. Triggers ~1 in 20 page loads using crypto random.
2026-02-27 23:14:13 -06:00
Alex Gleason dc4ca2616f Add random pixelation effect to DittoLogo on page load 2026-02-27 22:46:54 -06:00
Alex Gleason 56570a9f0d Fix replies not showing when viewing a kind 1111 comment directly
When viewing a kind 1111 comment, reconstruct the original root event
from its uppercase tags (K, P, A, E) and pass that to useComments so
the full comment tree is fetched. Then use getDirectReplies(event.id)
to show only the replies to the specific comment being viewed.
2026-02-27 22:22:22 -06:00
Alex Gleason 5cbe4d57b7 Merge branch 'main' of gitlab.com:soapbox-pub/ditto-mew 2026-02-27 22:17:51 -06:00
Chad Curtis 761bbb0526 Fix image rendering in note content: full width, preserve aspect ratio, re-measure after image load
- Images now render at full width with natural aspect ratio (no cropping)
- Single-image posts skip the 'Read more' truncation
- Re-measure scrollHeight after images load to correctly detect overflow on multi-image posts
2026-02-27 21:41:01 -06:00
Alex Gleason ccf5f85aa9 Add CommentContext component showing 'Commenting on [name]' for kind 1111
Replace the previous ReplyContext approach for kind 1111 with a new
CommentContext component that fetches the root event and displays its
title/name. Handles all root types:
- Addressable events (A tag): fetches event, shows title/d-tag
- Regular events (E tag): fetches event, shows title with hover preview
- External content (I tag): shows URL hostname, ISBN, hashtag, etc.
  with links to the /i/ discussion page

Used in both NoteCard (feed/thread views) and PostDetailContent
(expanded post detail view).
2026-02-27 21:36:53 -06:00
Alex Gleason 8e5cebf5fc Show 'Replying to' context for kind 1111 comments in feeds
Kind 1111 comments now show reply context using the root author from
the uppercase P tag, with a hover preview of the root event from the
uppercase E tag. Previously only kind 1 replies showed this context.
2026-02-27 21:29:11 -06:00
Alex Gleason f07ebab004 Include kind 1111 comments in feeds and profile 'Posts & replies' tab
Add kind 1111 to EXTRA_KINDS tied to feedIncludePosts so comments
appear in all feeds (follows, global, communities) and profile feeds.
Explicitly exclude kind 1111 from profile 'Posts' tab since they are
always replies. Treat kind 1111 like kind 1 in streaming filter so
reply/search/media filtering applies consistently.
2026-02-27 21:25:29 -06:00
Alex Gleason 515d817e1a Render kind 1111 comments as NoteCards on non-kind-1 post detail pages
Use useComments hook to fetch NIP-22 comments for non-kind-1 events
instead of useReplies (which only fetches kind 1), and render them
with the same NoteCard threaded layout used for kind 1 replies.
Also invalidate comments cache when posting NIP-22 replies.
2026-02-27 21:20:23 -06:00
Alex Gleason eb675309f7 Support bare (non-encoded) URLs in /i/ route by reattaching query string 2026-02-27 20:36:25 -06:00
Alex Gleason 60760a2214 Add Discuss button to link previews in feeds to navigate to /i/:url 2026-02-27 20:32:49 -06:00
Alex Gleason 2e8b966a82 Use YouTubeEmbed player for YouTube URLs on external content page 2026-02-27 20:30:47 -06:00
Alex Gleason e2affa55a3 Add NIP-73 external content page at /i/:uri with URL, Book, and Country support 2026-02-27 20:27:45 -06:00
Alex Gleason a9bd7bb2b5 Rename /timeline/:domain route to /feed/:domain 2026-02-27 20:07:27 -06:00
Alex Gleason 08b5018a7c Restore top 3 emoji reactions on post detail page
NIP-85 stats provide counts but not emoji data. Fetch actual kind 7
reaction events via useEventInteractions for the focused post only,
derive the top 3 emojis by frequency, and display them in the stats
row. Ancestors and descendants are unaffected.
2026-02-27 19:58:31 -06:00
Alex Gleason c5b9ca685a Fix Blossom upload URL rewritten to a server that may not have the blob 2026-02-27 19:40:48 -06:00
Alex Gleason d88f1b4ec2 Fix webxdc icon tag missing from NIP-94 event due to stale iconUrl closure 2026-02-27 19:33:18 -06:00
Alex Gleason 1302f5933c Replace regex manifest.toml parsing with smol-toml for correct TOML handling 2026-02-27 19:27:56 -06:00
Alex Gleason 19500367f2 webxdc apps should have a white background by default 2026-02-27 18:42:53 -06:00
Alex Gleason 20114c7d78 Support NIP-73 hashtag identifiers in commenting system
Port changes from mkstack: add `#${string}` type support for hashtag
roots, refactor usePostComment into shared makeCommentTags helper with
proper K tag values for hashtags, URLs, and protocol schemes, and update
nostr-comments skill docs with full NIP-73 identifier examples.
2026-02-27 18:41:44 -06:00
Alex Gleason 6980d09018 Refactor NIP-22 replies to use usePostComment hook instead of inline tag construction
Removes duplicated NIP-22 tag logic from ComposeBox and delegates to
usePostComment, which correctly handles addressable/replaceable events
without adding spurious e tags. When replying to a kind 1111 comment,
the root event info is reconstructed from the comment's uppercase tags.

Added optional tags parameter to usePostComment so ComposeBox can pass
through hashtags, mentions, imeta, CW, and quote tags.
2026-02-27 18:26:44 -06:00
Alex Gleason 53b8c0854e Use NIP-22 kind 1111 comments when replying to non-kind-1 events
Previously, clicking Reply on non-kind-1 events (treasures, themes, vines,
etc.) would create a kind 1 event with NIP-10 tags. NIP-22 specifies that
comments on non-kind-1 events must use kind 1111 with proper uppercase
(root) and lowercase (parent) tag structure.

- Detect non-kind-1 reply targets and switch to kind 1111
- Build NIP-22 tags: A/E/I + K + P for root scope, a/e/i + k + p for parent
- Handle addressable, replaceable, and regular event kinds
- Copy uppercase root tags from kind 1111 targets when replying to comments
- Invalidate comments cache instead of replies cache for NIP-22 events
2026-02-27 18:20:14 -06:00
Alex Gleason a25700126f Dynamically recolor favicon to match the active theme's primary color 2026-02-27 17:49:53 -06:00
Alex Gleason 5b06ac95a5 Add bg-background/85 to profile selector button in left sidebar 2026-02-27 17:08:27 -06:00
Alex Gleason 2efedafa11 Reduce right sidebar top padding to keep section headings at original position 2026-02-27 17:07:37 -06:00
Alex Gleason d0a1ac067e Reduce right sidebar outer padding to compensate for section inner padding 2026-02-27 17:06:41 -06:00
Alex Gleason d9ed93d1ed Improve right sidebar visibility on custom theme backgrounds 2026-02-27 17:04:48 -06:00
Alex Gleason 9782d8d2d4 Start improving visibility of sidebar content on busy custom backgrounds 2026-02-27 17:00:17 -06:00
Alex Gleason 1c0e390c2c Merge branch 'main' of gitlab.com:soapbox-pub/ditto-mew 2026-02-27 16:35:04 -06:00
Alex Gleason c9f8f23e4d Render theme events on post detail page
Add ThemeContent to PostDetailContent's kind-based dispatch so theme
events (kind 36767/16767) display their preview when viewed directly
via nevent/naddr URLs.
2026-02-27 16:20:00 -06:00
Alex Gleason cb0a9b1487 Merge branch 'opencode/1772228939' 2026-02-27 16:11:55 -06:00
Alex Gleason f1a5aa19f7 Replace theme swatch card with scaled-up mini-mockup preview
Use the same ThemePreviewCard design from /settings/theme (simulated
header bar, text lines, button, sidebar strip) scaled ~4x to fill
the feed card. Includes background image support and title/description
bar below the mockup.
2026-02-27 16:11:37 -06:00
Alex Gleason 6248b584e3 Rename 'active themes' to 'profile themes' in feed settings and labels 2026-02-27 16:07:58 -06:00
Mary Kate Fain bef3d75a5d Fix 3 pre-existing eslint errors blocking CI pipeline
- Remove eslint-disable for non-existent jsx-a11y/media-has-caption rule
- Prefix unused previousCss variable with underscore
- Remove unused eslint-disable-line directive
2026-02-27 16:05:12 -06:00
Alex Gleason 84c1c9112d Fix jarring theme flash when visiting own profile
Delay the system-fallback theme override until the profile theme
query has settled (isFetched). Previously, while the query was
loading, the system fallback would kick in immediately — replacing
the user's custom theme with the basic builtin theme, only to
switch back once the profile theme loaded. This was especially
noticeable when visiting your own profile with a matching theme.
2026-02-27 16:03:16 -06:00
Alex Gleason 5399b577b4 Always show both theme kinds on /themes page
The dedicated page should show all content regardless of feed toggle
settings - those control mixed feed inclusion, not the page itself.
2026-02-27 16:02:32 -06:00
Alex Gleason e423cc8ec1 Render theme events (kind 16767/36767) as feed posts with full interactions
Migrate themes from a standalone card to the standard NoteCard rendering
pattern (like treasures), so theme events appear as interactive posts
with reply, repost, reaction, and zap buttons.

- Create ThemeContent component for inline theme color preview
- Add ThemeHeader for 'shared a theme' / 'updated their theme' labels
- Support both kind 36767 (definitions) and 16767 (active themes) in feeds
- Convert extraKinds themes entry to use subKinds pattern with toggles
- Create ThemesPage wrapper (like TreasuresPage) for sub-kind filtering
- Update ContentSettings to sync both sub-kind feed toggles
2026-02-27 15:58:05 -06:00
Mary Kate Fain adceba5a54 Add 7 Y2K aesthetic theme presets with bundled display fonts
Add Skater, Kawaii, Grunge, MS Paint, Retro Pop, Bubblegum, and Gamer
theme presets derived from the ditto-1 aesthetic designs. Each preset
includes tailored CoreThemeColors, a display font, and a Blossom-hosted
background image.

Install and register 7 new fontsource display fonts (Permanent Marker,
Cherry Bomb One, Creepster, Silkscreen, Bungee Shade, Luckiest Guy,
Press Start 2P) in the bundled font registry so they appear in the
FontPicker for custom theme building as well.
2026-02-27 15:55:40 -06:00
Alex Gleason 7578223467 Merge branch 'main' of gitlab.com:soapbox-pub/ditto-mew 2026-02-27 11:31:44 -06:00
Alex Gleason acc339ae9e Fix feed not refreshing after publishing a webxdc app
The query key was still targeting the deleted useWebxdcFeed hook.
Invalidate ['feed'] to match the useFeed query key.
2026-02-27 11:29:07 -06:00
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