Commit Graph

37 Commits

Author SHA1 Message Date
sam e12716722a remove shape stuff 2026-05-11 14:49:11 +07:00
sam b46703eaed remove blobbis 2026-04-30 13:19:22 +07:00
Chad Curtis c009eb4d5c Fix inline zap rendering: add EmbeddedZapCard for kind 9735
Zap receipts embedded via nostr:nevent1 references were falling through
to the generic EmbeddedNoteCard, which rendered the raw JSON content of
the zap request. Add a dedicated EmbeddedZapCard that extracts and
displays the sender, amount, and message using the existing zap utility
functions. Forwards disableHoverCards to prevent nested hover cards.
2026-04-13 19:05:18 -05:00
Chad Curtis 6742792e90 Fix embedded quote review issues
- Add disableMediaEmbeds prop to NoteContent that suppresses images,
  galleries, and video/audio inside embedded quotes while preserving
  link preview cards and lightning invoices
- Render inline fallback links for nevent/naddr references when
  disableNoteEmbeds is true, instead of returning null and leaving
  invisible gaps in quoted text
- Restore tag-based title/description fallback for events with empty
  content (articles, custom addressable kinds) so they don't render
  blank cards
- Migrate EmbeddedProfileBadgesCard to useProfileUrl for consistent
  profile link routing
2026-04-13 18:15:31 -05:00
Chad Curtis 8f6d52a9f9 Fix embedded quote rendering: use NoteContent for DRY media/blobbi display
- Fix stateful global regex bug (IMETA_MEDIA_URL_REGEX) causing every
  other URL to be misclassified when used with .test() in loops; add
  non-global IMETA_MEDIA_URL_TEST_REGEX for safe .test() calls
- Rewrite EmbeddedNoteCard to render content via NoteContent (same as
  NoteCard) with a 260px height cap instead of reimplementing URL
  parsing and content truncation
- Pass disableEmbeds to NoteContent inside quotes to prevent recursive
  nostr:nevent/note references from spawning nested EmbeddedNote
  components
- Add overflow-aware 'Read more' toggle inline with attachment chips;
  fade gradient only renders when content actually overflows
- Add BlobbiStateCard rendering for kind 31124 in both EmbeddedNote
  and EmbeddedNaddr
- Extract EmbeddedCardShell with shared clickable card wrapper and
  author row, deduplicating ~150 lines across EmbeddedNoteCard,
  EmbeddedNaddrCard, and EmbeddedBlobbiCard
- Fix ComposeBox media URL detection using the same regex fix
- Fix EmbeddedNaddr profile links to use useProfileUrl instead of
  hardcoded npub paths
2026-04-13 18:03:09 -05:00
Alex Gleason 0469b6cec9 Display encrypted letters as interactive 3D envelopes with Nushu ciphertext
Register kind 8211 across the event rendering pipeline so encrypted
letters render as 3D interactive envelopes instead of raw ciphertext.
Back shows a sealed envelope with sender/recipient names in script font
and a wax seal avatar. Click flips the envelope (CSS 3D transform),
click again opens it to reveal the ciphertext rendered as Nushu
characters -- a real historical secret women's script from China.
2026-03-31 16:32:27 -05:00
Alex Gleason 1c358a3c79 Add compact badge row preview for embedded profile badges events
Kind 10008/30008 profile badges events now render a compact card with
author info, a row of up to 6 badge thumbnails, and a badge count
when embedded in quotes or reply context. Works in both EmbeddedNote
(nevent references) and EmbeddedNaddr (naddr references).
2026-03-29 15:04:58 -05:00
Alex Gleason 0df942cb9d Display kind 20 photo events in detail view and add Photo indicator
- Add isPhoto detection and PhotoDetailContent in PostDetailPage so kind 20
  events render their image gallery when viewed directly via nevent links
- Add parsePhotoUrls helper and ImageGallery import to PostDetailPage
- Add 'Photo' shell title for kind 20 loading state
- Add KIND_HEADER_MAP entry for kind 20 ('shared a photo') in NoteCard
- Add Photo attachment indicator in EmbeddedNote for kind 20 events in
  quote posts and reply context
2026-03-29 14:09:39 -05:00
Chad Curtis fb3686fef4 Merge branch 'fix/embedded-note-link-preview' into 'main'
Show link preview cards in quoted posts

See merge request soapbox-pub/ditto!107
2026-03-28 12:05:15 +00:00
Alex Gleason 64e11e4001 Replace full images in compact post views with 'Image' indicator chip
Embedded/quoted posts (EmbeddedNote, EmbeddedNaddr) no longer display
full image thumbnails. Instead, images are shown as a small icon+label
indicator at the bottom, consistent with how videos and audio are
already represented. This keeps compact views lightweight and focused
on text content.
2026-03-25 13:48:23 -05:00
Alex Gleason 6dde7bba0f Improve kind 4 DM display: simplify card style and add compact view for embeds
Remove gradient background and encryption footer from the full card, use
a clean bordered card with centered sender description. Add
EncryptedMessageCompact for quote posts, reply indicators, and the reply
composer — dispatched from EmbeddedNote like vanish events.
2026-03-25 00:26:07 -05:00
Alex Gleason a8cb7240bf Use specific kind labels in embed cards instead of parent category name
Add getKindLabel() to extraKinds.ts as the canonical resolver for
per-kind labels. Kinds in extraFeedKinds (like nsites 15128/35128)
now show 'nsite' instead of the parent category 'development'.
2026-03-24 20:57:20 -05:00
Alex Gleason d94ff90bc7 Show kind label with icon in compact embed cards for non-text kinds
Embed cards for non-text kinds (nsites, follow packs, etc.) now show a kind
label line with icon below the title/description, giving context about what
the event is. Previously a quoted nsite just showed 'ditto' with no indication
it was an nsite deployment.
2026-03-24 20:53:13 -05:00
Alex Gleason ae236718e3 Remove NOTECARD_KINDS — render all quote posts and hover cards as compact embed cards
Quote posts and hover previews should always be compact (author + title/content).
Rendering a full NoteCard with action headers, buttons, and nested card components
inside a quote post or hover card is too much UI for an inline context.

- Remove NOTECARD_KINDS from EmbeddedNote.tsx and EmbeddedNaddr.tsx
- Remove NoteCard imports from both embed components
- Add tag-based metadata fallback (title/name/d, summary/description) to
  EmbeddedNoteCard for non-text kinds with empty content
- Update AGENTS.md checklist to reflect that embeds no longer need per-kind registration
2026-03-24 20:48:20 -05:00
Alex Gleason 8e76650a5f Render nsite events correctly across all views
Add NsiteCard rendering to PostDetailPage, reply composer, quote
embeds, comment context labels, and external content headers so
kind 15128/35128 events display properly everywhere.
2026-03-24 20:23:17 -05:00
The Daniel 926ad380f3 feat: show link preview cards in quoted posts instead of raw URLs 2026-03-23 17:02:43 -04:00
Alex Gleason 85b47a7a62 Consolidate 4 duplicate vanish compact cards into VanishCardCompact
The same stripes + glitch icon + title + npub + reason layout was
duplicated across EmbeddedVanishCard, EmbeddedVanishPost,
VanishEventContent compact mode, and an inline version in NoteCard's
threaded branch. Extract a single VanishCardCompact component and
replace all four copies with it.

Net reduction of 76 lines.
2026-03-21 22:39:13 -05:00
Alex Gleason 7ed142fb9c Add embedded vanish card for quoted kind 62 events
When a Request to Vanish event is quoted/embedded inside another
post, it renders as a compact card with caution stripes, the glitch
icon, title, npub, and optional reason — matching the dramatic style
of the full vanish display.
2026-03-20 23:26:22 -05:00
Alex Gleason 7f0f25aeb7 Make quoted event tombstones clickable with NIP-19 identifiers
When a quoted event fails to load, the 'this post could not be loaded'
indicator is now clickable, navigating to the event's page. Constructs
nevent1 for regular events and naddr1 for addressable events, including
relay hints and author pubkey when available from the parent event's tags.
2026-03-19 14:34:34 -05:00
Alex Gleason eb0f4270b1 Show tombstone when quoted posts can't be loaded
Replace silent null returns in EmbeddedNote and EmbeddedNaddr with a
visible tombstone UI showing 'This post could not be loaded' with a
dashed border and icon, so users know a quote was referenced even when
the event can't be fetched from relays.
2026-03-15 03:41:21 -05:00
Alex Gleason 434e4ad806 Fix lists not rendering in quote posts
When a kind 30000 list is quoted, ComposeBox encodes it as a nevent
which routes through EmbeddedNote. EmbeddedNote had no kind-specific
handling, so lists appeared as generic text cards instead of the rich
card with title, member avatars, and description.

Add the same NOTECARD_KINDS check (kind 30000, 39089) that EmbeddedNaddr
already uses, delegating to NoteCard compact for these kinds.
2026-03-15 02:32:13 -05:00
Alex Gleason 10bb16abfb Clean up avatar shape code: remove magic strings, type casts, and inconsistencies
- avatar.tsx: consolidate to single isEmojiShape boolean, fix AvatarFallback using same logic as Avatar
- avatarShape.ts: accept NostrMetadata directly in getAvatarShape (no cast needed)
- Remove 'as Record<string, unknown>' casts from all ~50 call sites
- Replace 'circle' magic string with empty string in form defaults and parseShape
- Use isValidAvatarShape instead of string comparison in save logic
- ProfileCard: extract IIFE overlay style into useMemo, use isEmojiShape throughout
2026-03-13 21:14:03 -05:00
Alex Gleason 3b79b384e5 Add avatar shapes: users can set a shape (circle, triangle, hexagon, star, etc.) for their avatar via kind 0 metadata
- New 'shape' property on kind 0 profile metadata with 7 predefined shapes:
  circle, triangle, inverted-triangle, hexagon, star, inverted-star, hexagram
- Avatar component updated with clip-path support for non-circle shapes
- Visual shape picker added to both EditProfileForm and ProfileSettings
- Shape applied across all 49 avatar render sites in the app
- New UserAvatar wrapper component for future simplified avatar rendering
- Unknown shape values gracefully fall back to circle (forward compatible)
2026-03-13 16:14:40 -05:00
Chad Curtis e1e5bbe696 Render audio uploads as video-style visualizer with avatar and sinewave
- Add AudioVisualizer component: mirrors VideoPlayer chrome exactly (same overlay controls, progress bar, hide-on-idle, scroll-pause) with a canvas sinewave and author avatar in the centre
- Wire audio into NoteCard (kind 1 notes), FileMetadataContent (kind 1063), and ComposeBox preview
- Extract shared utilities: formatTime, usePlayerControls hook, and mediaUrls (regexes + mimeFromExt) to eliminate duplication across VideoPlayer, AudioVisualizer, NoteCard, NoteContent, ComposeBox, and EmbeddedNote
- Fix ComposeBox: audio URLs now get correct imeta MIME tags and are excluded from link-embed detection
2026-02-28 23:35:17 -06:00
Chad Curtis fc5dbc3e80 Pass relay and author hints from nevent1 to EmbeddedNote
When a nostr:nevent1 URI is decoded in NoteContent, the relay hints and
author pubkey embedded in the identifier were being discarded. This meant
EmbeddedNote would only query the user's configured relays and skip the
relay hints, causing quoted events hosted on other relays to silently fail
to load. Now the hints are stored in the nevent-embed token and forwarded
to EmbeddedNote → useEvent.
2026-02-28 16:19:38 -06:00
Alex Gleason 64768ffafe Disable nested hover cards inside reply context preview
ProfileHoverCards on avatar, name, and @mentions inside EmbeddedNote
are now suppressed when rendered within the reply context hover card,
preventing nested hover card nesting.
2026-02-24 20:43:14 -06:00
Alex Gleason 439ab94ea3 Merge branch 'main' of gitlab.com:soapbox-pub/ditto-mew 2026-02-23 20:19:22 -06:00
Alex Gleason 64cf10f381 Fix useProfileUrl to call useNip05Verify directly instead of peeking cache
The cache-peek approach always returned npub because the cache was empty
at render time. Replace it with a proper hook that calls useNip05Verify,
relying on TanStack Query's deduplication to avoid redundant requests.

Also fix the dot separator in NoteCard to hide when NIP-05 is unverified,
and refactor ProfileSearchDropdown to pass the verified URL through
onClick rather than recomputing it in an event handler.
2026-02-23 19:39:13 -06:00
Mary Kate Fain 379282ecea Fix horizontal overflow on posts with links when reposting
- Add overflow-hidden to NoteCard article elements in both normal and
  threaded layouts to clip content that exceeds card width
- Add overflow-hidden to NoteContent root div to prevent link preview
  cards and embedded content from pushing beyond container bounds
- Strip .xdc URLs in EmbeddedNote content preview (was missing from
  the media URL regex, causing raw long URLs to render in quote embeds)
- Add overflow-hidden to EmbedContentPreview paragraph for defense
  against long unbreakable strings
- Use disableEmbeds on NoteContent inside ReplyComposeModal's embedded
  post preview so URLs render as plain links instead of full preview
  cards that overflow the clamped container
- Add attachment indicator chips to EmbeddedNote (images, videos, apps,
  links) so stripped media URLs still have a visible presence
2026-02-23 16:46:49 -06:00
Chad Curtis eb483469bb Add NIP-36 content warning support with blur/hide/show settings
Respect content-warning tags on events. Users can choose how to handle
them in Settings > Content > Sensitive Content:

- Blur (default): Shows a grey placeholder overlay with the warning
  reason in quotes. Media is not loaded until the user clicks reveal.
- Hide: Removes content-warned posts from the feed entirely.
- Show: Ignores content warnings and displays everything normally.

The setting syncs across devices via encrypted NIP-78 settings.
2026-02-20 16:45:33 -06:00
Alex Gleason 77ff88c2f6 Render NIP-30 custom emoji in all remaining display name locations
Apply EmojifiedText to mentions inside embedded/quote posts,
embedded note author names, and all other secondary UI locations
where display names were still rendered as plain text.
2026-02-19 21:43:56 -06:00
Chad Curtis 35422ec6bb Fix optimistic updates, show user reaction emoji, compact embeds, and unify repost menu
- Add true optimistic updates for reactions and reposts via setQueryData
  instead of only invalidating queries after publish
- Track user's own reaction per event and display their emoji in place of
  the Heart icon across feed, post details, and notifications
- Strip whitespace around block embeds and skipped media URLs to eliminate
  blank lines caused by whitespace-pre-wrap
- Only render link preview cards for standalone URLs; inline URLs in
  sentences render as plain clickable links
- Remove border-b separators and use fixed-height object-cover on preview
  images to eliminate gaps
- Tighten padding on EmbeddedNote and EmbeddedNaddr cards
- Use fixed-height object-cover for ImageGallery grid images
- Unify RepostMenu to use Popover on all screen sizes instead of Drawer
  on mobile
2026-02-19 16:19:19 -06:00
Chad Curtis aa231797af Add NIP-05 domain feeds, profile hover cards, gallery lightbox, and NIP-05 profile URLs
- Domain feed page at /timeline/:domain fetches .well-known/nostr.json and queries events from domain users
- NIP-05 domains are clickable in usernames throughout the app (Nip05Badge, NoteCard, PostDetailPage, etc.)
- @_@domain.com renders as @domain.com (underscore prefix hidden)
- Profile hover cards on avatars, usernames, and mentions across all components
- Clicking avatar/banner on profile page opens image in gallery lightbox with safe-area support
- NIP-05 verified users get clean profile URLs (e.g. /user@domain.com) instead of /npub1...
- NIP19Page unified dispatcher handles NIP-19, NIP-05, and profile routing at /:param
- Removed /u/:npub and /d/:domain routes in favor of root-level routing
- CORS proxy fallback for NIP-05 resolution on non-CORS-compliant servers
- Mobile top bar logo links to home
- Safe area fixes for gallery lightbox, mobile drawer, and sheet close button
2026-02-19 15:37:53 -06:00
shakespeare.diy a830b4a1e8 Fix feed/vine skeletons to match NoteCard layout; skeleton-load profile names and avatars
- Feed NoteCardSkeleton: restructured to match NoteCard's avatar + stacked
  name/handle header with full-width content below (was incorrectly nested)
- VinesPage VineSkeleton: restructured to match vine card layout with
  header, title, video placeholder, hashtags, and actions
- SearchPage PostSkeleton: aligned with Feed skeleton for consistency
- NoteCard: show skeleton for avatar and name while useAuthor is loading,
  resolves to real data or fallback when relay responds/gives up
- RepostHeader: skeleton for reposter name while author loads
- ReplyContext: skeleton for reply-to name while author loads
- PostDetailPage: skeleton for author row in both main post and parent note
- EmbeddedNote: skeleton for author row in embedded note card
- EmbeddedNaddr: skeleton for author row in embedded naddr card

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-17 02:58:22 -06:00
shakespeare.diy 9964d02775 Render npub/nprofile as @username mentions in embedded note previews
Parse nostr:npub1… and nostr:nprofile1… references within embedded note
card text and render them as clickable @username mentions (resolving the
display name via useAuthor), matching the style used in NoteContent.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-16 23:18:38 -06:00
shakespeare.diy fa32b45ee8 Strip nested nevent/note references from embedded note previews
Embedded note cards now strip out nostr:nevent1... and nostr:note1...
references from the content preview text, preventing recursive embedding
and keeping the preview clean.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-16 23:17:35 -06:00
shakespeare.diy d48d4dc8b6 Render nevent/note references as inline embedded post cards
- Create EmbeddedNote component with avatar, author name, timestamp,
  truncated content preview, and optional image thumbnail
- Update NoteContent tokenizer to detect note1 and nevent1 references
  and render them as embedded cards instead of plain text links
- Collapse whitespace around embedded note cards like link previews
- Clicking an embedded card navigates to the full post detail page

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-02-16 23:16:17 -06:00