Commit Graph

10 Commits

Author SHA1 Message Date
Alex Gleason 9d899cfe87 Sanitize all user-supplied URLs from Nostr events to prevent javascript: XSS
Add a shared sanitizeUrl() utility that validates URLs are well-formed
https: before they reach href attributes, window.open(), or openUrl().

Apply sanitization across all components that render untrusted URLs:
- CalendarEventDetailPage: r-tag links
- ZapstoreAppContent: url and repository tags
- ZapstoreReleaseContent: asset url tags passed to openUrl()
- AppHandlerContent: web handler tags and metadata.website
- NsiteCard: source tag
- GitRepoCard: web tag URLs passed to openUrl()
- FileMetadataContent: url tag used in download href
- ProfilePage: metadata.website (tighten weak startsWith check)
- useUserStatus: r-tag URL

Document sanitizeUrl usage in AGENTS.md for future agent use.
2026-04-10 14:22:42 -05:00
Chad Curtis 258b643ac5 Fix avatar shape not respected in notifications, audio visualizer, and follow pack cards 2026-03-16 03:55:21 -05:00
Chad Curtis 600841705f fix: populate OS media controls with event image, title, and artist at all player call sites 2026-03-03 06:13:47 -06: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
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 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