Commit Graph

1322 Commits

Author SHA1 Message Date
Alex Gleason dac751b0a9 Show Bluesky like counts and open comment compose dialog inline
Pass post.likeCount to ExternalReactionButton via new count prop so like
counts display from the Bluesky API. Comment button now opens the
ReplyComposeModal with the post URL instead of navigating away.
2026-03-23 21:46:14 -05:00
Alex Gleason b4eecd2588 Extract shared ExternalReactionButton with emoji picker for NIP-73 reactions
The Bluesky page had a broken inline reaction that just published '+' with
no emoji picker. The /i/ page had the full implementation with Popover,
QuickReactMenu, hover-to-open, and custom emoji support. Extracted the
reaction logic into a reusable ExternalReactionButton component and wired
it into both pages, removing ~230 lines of duplicated/inferior code.
2026-03-23 21:13:27 -05:00
Alex Gleason 0ec844c519 Add Bluesky discovery page with trending posts and search 2026-03-23 20:28:15 -05:00
Alex Gleason a80b667327 Add Wikipedia and Archive results to autocomplete search dropdown
Integrate useWikipediaSearch and useArchiveSearch into both the desktop
sidebar dropdown (ProfileSearchDropdown) and mobile bottom-nav sheet
(MobileSearchSheet). At most 1 result from each source is shown, always
positioned after Nostr profiles to preserve profile precedence. Keyboard
navigation indices updated to include the new items.
2026-03-23 13:53:04 -05:00
Alex Gleason 894f692dea Display rich Wikipedia article content on /i/ pages instead of generic link preview
Detect Wikipedia URLs and render a custom WikipediaArticleHeader with hero
image, article title, Wikidata description, expandable extract, and a
Read on Wikipedia footer link. Also uses the Wikipedia API for accurate
page titles in the header bar and SEO metadata, and navigates back to
/wikipedia on the back button.
2026-03-23 13:31:40 -05:00
Alex Gleason 02a16cad90 Fix Wikipedia icon to use the correct Simple Icons SVG path 2026-03-23 13:24:13 -05:00
Alex Gleason 4dd1ceb9b4 Add custom Wikipedia icon, use it in page header, card fallbacks, and sidebar 2026-03-23 13:23:22 -05:00
Alex Gleason a10feef57d Add 3-dots menu to badge detail page for sidebar and other actions 2026-03-23 12:37:27 -05:00
Alex Gleason 358e25560f Make only tabs sticky on follow pack detail page 2026-03-23 12:28:55 -05:00
Alex Gleason 3ba269172c Merge branch 'main' of gitlab.com:soapbox-pub/ditto 2026-03-23 00:48:15 -05:00
Alex Gleason 6d71fcaa45 Move image quality setting to Network Settings page
Remove the inline toggle from the post composer toolbar and add
imageQuality to AppConfig instead. The setting now lives in
Settings > Network under 'Image Uploads' with a Compressed/Original
pill toggle, persisted to localStorage like other app settings.
2026-03-23 00:44:30 -05:00
Alex Gleason fd740b8c6e Use default TabButton styling for starter pack and list page tabs
Remove custom className/indicatorClassName overrides and icon children
from tab buttons to match the cleaner default style used on badges page.
2026-03-23 00:38:51 -05:00
Alex Gleason 4d07aa050d Add Feed and Members tabs to starter pack detail pages
Starter pack pages now have two tabs: Feed (default) shows posts from all
pack members using useStreamPosts, and Members shows the existing member
list with follow/unfollow buttons.
2026-03-23 00:36:28 -05:00
Alex Gleason 235abf6add Add image quality toggle to post composer
Adds a Compressed/Original toggle button in the ComposeBox toolbar.
When set to Original, images are uploaded as-is without resizing or
re-encoding. Defaults to Compressed.
2026-03-23 00:35:31 -05:00
Alex Gleason fbf8c328f6 Merge branch 'main' of gitlab.com:soapbox-pub/ditto 2026-03-23 00:22:12 -05:00
Alex Gleason e9fee66560 fix: audit cleanup — fix bugs, perf issues, and stale code in badge system
- Fix parseBadgeATag truncating d-tags with colons (use slice+join)
- Fix useEventStats: replace redundant useQuery wrapper with useMemo
- Fix isAddressableKind: remove incorrect kind 0/3 (replaceable, not addressable)
- Fix useBadgeFeed: add follow list to queryKey, compose abort signals
- Fix BadgesPage: move reorder mutation out of state updater, memoize pendingRefs
- Fix useCreateBadge: add onSuccess cache invalidation for badge-feed and my-created-badges
- Remove dead categories param and t-tag code from useCreateBadge
- Remove unnecessary badge-awards-to invalidation from useAcceptBadge
- Remove redundant queryClient usage from CreateBadgeDialog
- Remove stale 'Achievement' wording from extraKinds badge description
- Clean up NIP.md trailing blank lines
2026-03-23 00:21:02 -05:00
Alex Gleason 4b386fe592 Show book title and BookOpen icon for ISBN sidebar items
ExternalContentSidebarItem now fetches the book title from OpenLibrary
via useBookInfo for ISBN entries instead of showing the generic 'Books'
label. The icon uses BookOpen instead of the Globe fallback.
2026-03-23 00:07:12 -05:00
Alex Gleason 201dd60cb7 Add sidebar toggle to external content pages and post 3-dots menu
ExternalContentPage (country, URL, ISBN pages) gains a 3-dots menu on
the right side of the action bar with Add/Remove from sidebar.

NoteMoreMenu gets an Add/Remove from sidebar item after 'Add to list',
so any post can be pinned to the sidebar from its options menu.

Both locations toggle between add (PanelLeft icon) and remove (Trash2
icon) based on whether the item is already in the sidebar.
2026-03-23 00:02:00 -05:00
Alex Gleason e2503f3573 refactor: remove custom badge tag extensions (t categories and tier)
Remove all non-standard NIP-58 extensions:
- Delete BadgeTierPill component and badge tier system (bronze/silver/gold/diamond)
- Delete isShopBadge, isAchievementBadge, getBadgeTier, BadgeTier type
- Delete publish-achievement-badges.sh script
- Remove kind 30009 section from NIP.md
- Clean up badge category pills from detail page and tier pills from badge rows

Badges now use pure standard NIP-58 with no custom tags.
2026-03-22 23:59:03 -05:00
Alex Gleason b782297514 Support external content (URLs, iso3166, isbn) as sidebar items
External i-tag identifiers like https:// URLs, iso3166:US country
codes, and isbn: values can now be added as sidebar menu items.

URLs show their favicon and hostname. Country codes show their
flag emoji and name. ISBN shows the book label. Clicking navigates
to /i/<encoded-value>.

The 'Add link' input (renamed from 'Add Nostr link') now accepts
all identifier types: Nostr URIs, URLs, iso3166 codes, and ISBNs.
2026-03-22 23:50:03 -05:00
Alex Gleason 0d8e0053d2 feat: add Feed tab to badge detail page showing posts from holders
The badge detail page now has three tabs: Awarded To, Feed, and
Comments. The Feed tab shows an infinite-scroll feed of kind 1 posts
authored by users who hold the badge, giving a community-feed view
centered around each badge.
2026-03-22 23:45:43 -05:00
Alex Gleason 5e55213315 Use Scroll icon for lists in sidebar, add 'Add to sidebar' on list detail page
Kind 30000 (NIP-51 lists) now shows the Scroll icon instead of the
generic FileText fallback. Added a KNOWN_KIND_ICONS map in
NostrEventSidebarItem for kinds not covered by EXTRA_KINDS.

ListDetailPage gains an 'Add to sidebar' dropdown action that
creates a nostr:naddr sidebar entry for the current list. The
option is hidden once the list is already pinned.
2026-03-22 23:36:22 -05:00
Alex Gleason 11c4675e05 fix: use NIP-85 addr stats (kind 30384) for addressable events
useEventStats now accepts an optional event object. For addressable
events (kinds 30000-39999), it queries kind 30384 stats by the a-tag
coordinate instead of kind 30383 by event ID, so reply/reaction counts
display correctly for badge collections, badge definitions, articles,
and other addressable event types.

All 8 call sites updated to pass the event object.
2026-03-22 23:32:25 -05:00
Alex Gleason 34f0cf74cf Add Nostr event/profile items to customizable sidebar
Support nostr: URIs (npub, nprofile, note, nevent, naddr) as
sidebar menu items. Profiles show their avatar and display name;
other events show a kind-based icon and label fetched from relays.

Users can add Nostr links via the 'Add Nostr link' button in
sidebar edit mode. Clicking navigates to /:nip19.
2026-03-22 23:23:17 -05:00
Alex Gleason 89bc522ff7 feat: render quoted badge definitions as compact showcase instead of link preview
Kind 30009 badge definition embeds now show a smaller version of the
badge showcase (centered image with rotating light rays, name, and
description) instead of the generic link-preview card with cover image.
2026-03-22 23:21:51 -05:00
Alex Gleason 9e21dc06b3 feat: add react, repost, and comments to badge detail page
- Add action bar with ReactionButton (kind 7), RepostMenu (kind 16),
  and comment count button below the badge info section
- Replace flat awardees list with tabbed interface: 'Awarded To' and
  'Comments'
- Comments tab uses useComments (NIP-22 kind 1111 on addressable event),
  ComposeBox for inline composition, and ThreadedReplyList for display
- Add rotating light rays spotlight effect to the badge detail hero
- Replace full-width image with centered badge showcase (size-36)
2026-03-22 23:04:52 -05:00
Alex Gleason ea838cca29 fix: remove gradient background from badge showcase container 2026-03-22 22:57:14 -05:00
Alex Gleason 260ac7896c fix: center rotating light rays behind badge image
Separate centering (translate) and rotation (animate) into nested divs
so the rotation transform doesn't override the centering transform.
2026-03-22 22:56:53 -05:00
Alex Gleason 3853c1e6cc feat: redesign badge definition card with centered showcase and rotating spotlight
Replace the link-preview-style layout (full-width image + text below) with
a centered badge showcase: the image is displayed at badge size (112px)
with name and description centered beneath it, and a slow-rotating conic
gradient spotlight behind it for a grand presentation feel.
2026-03-22 22:55:06 -05:00
Alex Gleason 41a82a50ec fix: remove border and background from badge grid in profile badges content 2026-03-22 22:52:27 -05:00
Alex Gleason dd9f2bcbe4 fix: remove border from badge thumbnails to preserve transparency 2026-03-22 22:51:50 -05:00
Alex Gleason bc93fa5dd6 refactor: consolidate badges into two-tab page with create dialog
- Replace three separate pages (/badges/create, /badges/created,
  /badges/manage) with a single /badges page
- Two tabs: 'My Badges' (accepted + pending + created sections)
  and 'Follows' (badge feed from followed users)
- Convert badge creation form into a CreateBadgeDialog opened via FAB
- Remove Global tab
- Delete BadgeCreatePage, BadgeCreatedPage, BadgeManagePage
- Update BadgeShowcaseGrid editPath to /badges
- Simplify useBadgeFeed to only support follows tab
2026-03-22 22:49:11 -05:00
Alex Gleason 064913d703 fix: address badge MR review feedback
- Fix incorrect npub in publish-achievement-badges.sh (was wrong bech32 encoding)
- Show actual badge names in award notifications by fetching kind 30009 definitions,
  with fallback to un-slugified d-tag identifier
- Strip price/supply UI from shop page and badge detail (no purchase flow exists)
- Document custom badge tag extensions and DVM claim-achievement flow in NIP.md
- Remove unused badge-glow CSS animation (duplicate of pending-glow in Tailwind)
- Make badge award notifications respect user preferences instead of force-enabled
- Add badges toggle to notification settings page
2026-03-22 22:15:34 -05:00
Alex Gleason 4087457b70 Merge remote-tracking branch 'origin/main' into experimental-badges
# Conflicts:
#	src/lib/sidebarItems.tsx
2026-03-22 21:55:31 -05:00
Alex Gleason 0bfdbeea2e Show title and external link below embeds, fix YouTube page title
- Enhanced DiscussBar below embeds (YouTube, Archive.org, Spotify, etc.)
  to show title, author, provider name, and an external link, matching
  the style of generic LinkPreview cards
- Always show the info bar (title, domain, external link) below embeds,
  even on /i/ pages where showActions=false; only hide the Discuss button
- Added native OEmbed fetching for YouTube, Spotify, and Reddit directly
  from their provider endpoints, since the generic link preview proxy
  fails for these sites
- For Archive.org, fetch title/creator from the metadata API and
  transform into OEmbed-compatible shape
- Removed the !title guard in useLinkPreview that discarded OEmbed
  responses without a title field
- Falls back to the generic link preview proxy for unknown providers
2026-03-22 20:11:41 -05:00
Alex Gleason c56a973958 Add source code link to LinkFooter 2026-03-22 17:17:12 -05:00
Alex Gleason fd1b78834e Add autoplay=1 to archive.org embed iframes
When users click the play overlay, the iframe now loads with autoplay=1
so the content plays immediately, matching the YouTube embed behavior.
Also adds allow='autoplay' to the iframe attribute so browsers permit
the autoplay request from the embedded frame.
2026-03-22 15:39:01 -05:00
Alex Gleason 894f7c02d8 Fix mobile search result order for URL and identifier suggestions 2026-03-22 15:22:56 -05:00
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 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 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