Commit Graph

2037 Commits

Author SHA1 Message Date
Alex Gleason 22fc6dfd5b Use transform-scale only for software embeds, responsive iframe for videos
The archive.org embed page has a responsive player for videos/audio
but renders software/games at fixed native pixel dimensions. Fetch the
item's mediatype from the metadata API and branch accordingly.
2026-03-22 15:12:00 -05:00
Alex Gleason 8b73772bf0 Scale archive.org embed iframe with CSS transform to fit narrow viewports
The archive.org embed renders content at native pixel dimensions and
doesn't scale to fill the iframe like YouTube does. On mobile the
550px-wide content overflowed the ~370px container.

Fix: give the iframe its native dimensions and use transform: scale()
with a ResizeObserver to shrink it to fit the container width. Also
reverts the unnecessary overflow-x-hidden on ExternalContentPage.
2026-03-22 15:08:55 -05:00
Alex Gleason dda77c0bdf Fix mobile overflow on external content pages 2026-03-22 15:06:05 -05:00
Alex Gleason cbdbf05cde Use padding-bottom technique for archive.org embed aspect ratio
The CSS aspect-ratio property can cause overflow on narrow viewports.
The padding-bottom percentage trick is always relative to the parent
width, so it scales correctly on mobile.
2026-03-22 15:02:19 -05:00
Alex Gleason 2d508d0d27 Simplify archive.org metadata response parsing 2026-03-22 14:54:56 -05:00
Alex Gleason 590bc6689e Fix archive.org metadata parsing: response is wrapped in { result: [] } 2026-03-22 14:53:00 -05:00
Alex Gleason 81c5d7f275 Fetch correct aspect ratio for archive.org embeds from metadata API 2026-03-22 14:47:33 -05:00
Alex Gleason 489a7bba10 Add Internet Archive embed support with click-to-load facade 2026-03-22 14:41:57 -05:00
Alex Gleason 7522ff13f7 Show actual page title on link pages instead of hostname 2026-03-22 14:37:59 -05:00
Alex Gleason d64a75f7ae Move Nostr identifiers from submit-redirect to autocomplete suggestions
Enter/submit now always performs a text search instead of redirecting
when the query looks like a NIP-05, npub, nevent, etc.

Identifiers are detected in real-time and shown as autocomplete items:
- NIP-05 (user@domain.com, domain.com): resolves to profile via .well-known
- npub/nprofile: shows profile with avatar and metadata
- note/nevent: shows event content preview with author
- naddr: shows addressable event with title/content preview
- hex: shows navigable link to the identifier

Resolved profiles are deduplicated from regular search results.
Works in both desktop sidebar and mobile bottom sheet search.
2026-03-22 14:26:18 -05:00
Alex Gleason 10972064a6 Clean up LinkPreview/LinkEmbed props for consistency
Replace the confusing externalLink/hideActions/showDiscuss props with
a clearer model:

- navigateToComments: opt-in to /i/ navigation (default: card opens
  the URL externally, which is the natural expectation)
- showActions: single prop controlling the action button across both
  LinkPreview and DiscussBar (default: true)

The action button always offers the opposite of what clicking the card
does: 'Discuss' when the card opens externally, 'Open' when the card
navigates to /i/.
2026-03-22 14:04:26 -05:00
Alex Gleason ed26f25f50 Restore Discuss button on link previews in posts, hide on /i/ page
Link previews now show the correct action button based on context:
- In posts (externalLink): card opens externally, shows 'Discuss' button
- In hover cards (!externalLink): card navigates to /i/, shows 'Open' button
- On /i/ page (hideActions): no action button since both would be redundant
2026-03-22 13:59:41 -05:00
Alex Gleason e9e8104b1f Fix link previews in posts opening /i/ instead of externally
LinkEmbed now defaults externalLink to true so link previews embedded
in post content open the URL externally as expected. Only standalone
uses of LinkPreview (like the CommentContext hover card) navigate to
the /i/ comment page.
2026-03-22 13:58:02 -05:00
Alex Gleason eb7f2d1d0d Remove redundant ExternalLink icon next to domain name in link preview 2026-03-22 13:56:39 -05:00
Alex Gleason 669bcf3175 Add 'Open' button to link preview for opening URL externally
When the card navigates to /i/ (the default), show an 'Open' button
with an external link icon that opens the original URL in a new tab.
Hidden when externalLink is true since the whole card already opens
the URL externally.
2026-03-22 13:55:39 -05:00
Alex Gleason e5ef738bf4 Fix hover card link preview navigating externally instead of to /i/ page 2026-03-22 13:54:19 -05:00
Alex Gleason 1e48489978 Make link preview cards navigate to /i/ comment page on click
Remove the Discuss button from LinkPreview since the whole card now
navigates to /i/:url. Add externalLink prop so the card opens the URL
in a new tab instead when already on the /i/ page or in a hover card.
2026-03-22 13:53:08 -05:00
Alex Gleason 45870fcf11 Add link preview hover card to URL comment context 2026-03-22 13:50:25 -05:00
Alex Gleason 370ff05bdb Show page title with favicon in URL comment context
Fetch OEmbed link preview for URL identifiers in CommentContext so
'Commenting on' displays the page title alongside the site favicon
instead of a raw hostname+pathname.
2026-03-22 13:49:16 -05:00
Alex Gleason 61cb27a465 Show page title instead of 'Comment on this link' in URL search option 2026-03-22 13:47:26 -05:00
Alex Gleason af2b68eddd Add 'Comment on this link' option to search autocomplete for URLs
When a full URL (http/https) is entered in the search bar, a new
'Comment on this link' option appears below the existing 'Search for'
option. Clicking it navigates to /i/<url> for commenting. The option
shows a link preview thumbnail (fetched via OEmbed) on the left where
avatars usually are, with the site's favicon as fallback. Works in
both the desktop sidebar dropdown and mobile bottom nav search sheet.
Keyboard navigation updated to support the new item.
2026-03-22 13:28:58 -05:00
Alex Gleason 149955e099 Fix profile timeline gaps by over-fetching and filtering kinds per tab
The profile feed queried all enabled kinds (20+) with limit:15, but the
Posts tab filters client-side to only show non-reply posts. Events from
other kinds (badges, themes, emojis, etc.) consumed the limit, and the
pagination cursor jumped over time ranges containing visible posts.

Three-pronged fix:
- Filter kinds per active tab at query time (exclude kind 1111 on Posts)
- Over-fetch 3x the page size to compensate for reply filtering
- Auto-fetch next page when visible items fall below threshold

Closes #146
2026-03-22 00:22:29 -05: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 58b28f7c1a Fix vanish card stripes overflowing in threaded ancestor view
The vanish layout (kind 62) in NoteCard didn't handle the threaded/
threadedLast props, so when rendered as a parent in AncestorThread,
it used the standard feed card layout where the caution stripes are
siblings of the bordered container — visually appearing to escape
above and below the card.

Add a dedicated threaded branch for vanish cards that:
- Uses the avatar column + connector line pattern like other threaded cards
- Places the stripes INSIDE the bordered container (as top/bottom bands)
  so they stay visually contained within the card boundary
2026-03-21 22:33:37 -05:00
Alex Gleason eab19f0d72 Add mute list recovery dialog to /settings/content
Allow users to browse and restore historical versions of their
kind 10000 mute list, similar to the existing Profile Recovery
dialog. Each snapshot is decrypted and displays a summary of
muted items by type (users, hashtags, words, threads).
2026-03-21 22:23:53 -05:00
Alex Gleason 2942af1823 Remove Sentry session replay integration
The replay integration hooks into every DOM mutation via rrwebWrapped
event listeners, adding ~133ms of overhead during heavy re-renders.
We only use Sentry for error reporting, not session replay.
2026-03-21 22:09:57 -05:00
Alex Gleason d980a8af5b Fix performance regression: cache parsed metadata and memoize NoteCard
The IndexedDB profile cache (d9e943d0) introduced a regression where
parseAuthorEvent() — which runs the full Zod n.metadata().parse() chain —
was called synchronously on every render via TanStack Query's initialData
option. With 50+ NoteCards in a feed and no React.memo, this caused ~970ms
of Zod validation + ~1.3s of Nostrify core overhead per tab navigation.

Fix by:
1. Storing pre-parsed metadata in ProfileCacheEntry so useAuthor can
   provide initialData without re-running Zod on every render
2. Wrapping NoteCard in React.memo to prevent re-renders when props
   haven't changed (event objects are referentially stable from the
   query cache)
2026-03-21 21:58:02 -05:00
Alex Gleason 0451895308 Merge branch 'main' of gitlab.com:soapbox-pub/ditto 2026-03-21 20:57:33 -05:00
Alex Gleason 96e52c1427 Add Follows tab to Profile Recovery dialog for restoring prior kind 3 follow lists 2026-03-21 20:55:05 -05:00
Alex Gleason 77ecd7c417 Apply avatar shape to profile snapshots in recovery dialog 2026-03-21 20:52:11 -05:00
Alex Gleason 2ac38cb0f5 Use req() instead of query() for recovery to bypass NSet replaceable deduplication 2026-03-21 20:48:42 -05:00
Dirk Rost 0c519a9cd9 Merge branch 'fix/account-switch-stale-data' into 'main'
Fix stale user data persisting across account switches

Closes #94

See merge request soapbox-pub/ditto!95
2026-03-22 01:48:13 +00:00
Mary Kate 8dd9b72630 Fix stale user data persisting across account switches 2026-03-22 01:48:13 +00:00
Alex Gleason d42a8f19fe Skip batcher for replaceable queries without an explicit limit 2026-03-21 20:43:35 -05:00
Alex Gleason 4e02d45081 Fix profile recovery queries getting batched by splitting tabs into separate components 2026-03-21 20:39:11 -05:00
Alex Gleason 98b254e296 Upgrade @nostrify/nostrify to 0.50.5 and @nostrify/react to 0.2.30 2026-03-21 20:35:01 -05:00
Alex Gleason 8c570ed106 Add Profile Recovery dialog to restore historical profiles and themes 2026-03-21 20:12:52 -05:00
Alex Gleason 5a960ff31c Auto-prepend wss:// to relay URLs missing a protocol prefix 2026-03-21 13:54:04 -05:00
Alex Gleason e83f550b89 Resize and convert images to JPEG before upload in post composer
Images attached via ComposeBox are now resized (max 1920px) and
converted to JPEG before uploading, matching the BackgroundPicker
behavior. Non-image files (audio, video, .xdc) are unaffected.
Blurhash is computed from the resized file for consistency.
2026-03-21 10:46:43 -05:00
Alex Gleason 0a86eb70c5 Resize and convert background images to JPEG before upload
Background images uploaded via BackgroundPicker are now resized to a
max of 1920px on the longest side and converted to JPEG (quality 0.85)
before uploading. Images that are already small JPEGs are passed through
unchanged. This reduces file size and improves load times when visiting
profiles with custom backgrounds.
2026-03-21 01:16:50 -05:00
Alex Gleason 852b6faa69 Verify signed event pubkey matches current account before publishing
Adds a check in useNostrPublish that compares the pubkey on the signed
event against the currently selected user's pubkey. This prevents
publishing events from a mismatched signer (e.g. a browser extension
or bunker configured for a different account).
2026-03-20 23:55:01 -05:00
Alex Gleason 7a53aa2238 Add vanish preview in reply composer for kind 62 events
When replying to a Request to Vanish event, the reply composer now
shows a styled vanish preview instead of the generic author+content
card that looked broken for nuked accounts.
2026-03-20 23:37:48 -05:00
Alex Gleason 4b1f015d97 Include kind 62 vanish events in the home feed
Register kind 62 in the EXTRA_KINDS feed system so Request to Vanish
events from followed users appear in the home feed. Enabled by default
via the feedIncludeVanish toggle, and can be disabled in feed settings.
2026-03-20 23:35:50 -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 d0ef3e2575 Add dramatic NIP-62 Request to Vanish display (kind 62)
Implement a visually striking display for kind 62 vanish events with
animated caution stripes, glitch effects, and a grand exit aesthetic.
Since the user has nuked their account, the npub is shown instead of
profile info. Supports both compact feed cards and full detail view
with comments and sharing.
2026-03-20 23:17:25 -05:00
Alex Gleason 077a918de2 Add BookMarked icon back to the left of the repo name 2026-03-20 23:06:13 -05:00
Alex Gleason 40ff6c11ba Revert repo name to default text color for consistency with other cards 2026-03-20 23:05:24 -05:00
Alex Gleason 0cd5dd372d Simplify GitRepoCard: remove icon, hashtags, and Public badge
The activity indicator header above the post already shows the git
branch icon and 'shared a repository' text, making the in-card icon
redundant. Hashtags and the Public badge add noise without value.
2026-03-20 23:04:13 -05:00
Alex Gleason 0838efc7df Redesign GitRepoCard to mirror GitHub repository card layout
Use a GitHub-inspired structure: repo icon + name (as primary-colored
link text) + Public/Fork pill badge on the first line, description on
the second line, and hashtags rendered as language-dot metadata in a
compact bottom row. Clone URL and action buttons follow below.
2026-03-20 23:03:14 -05:00
Alex Gleason 3e859f9b74 Redesign development kind cards with bordered card style and activity indicators
Wrap GitRepoCard, PatchCard, PullRequestCard, and CustomNipCard content
in rounded-2xl bordered containers matching the quote post / embedded
note visual pattern. Add KIND_HEADER_MAP entries for all four dev kinds
(30617, 1617, 1618, 30817) so the feed shows activity labels like
'shared a repository', 'submitted a patch', 'opened a pull request',
and 'proposed a NIP' above each post.
2026-03-20 23:01:48 -05:00