Commit Graph

4447 Commits

Author SHA1 Message Date
Chad Curtis 771b3df9d8 fix lightbox: stable image keys prevent reload, dialog z-index above lightbox, media tab auto-open 2026-03-02 23:56:06 -06:00
Chad Curtis bcbb89163a render consecutive inline images as gallery grid in kind 1 notes 2026-03-02 23:44:53 -06:00
Derek Ross 6abe9fade0 Hide FAB while ComposeBox is visible, fade in on scroll
Use IntersectionObserver on the ComposeBox wrapper in Feed.tsx to track
its visibility. When visible, hide the FAB to avoid redundancy. When the
user scrolls past the compose area, the FAB smoothly fades in with an
upward slide animation. Extends LayoutStore with fabHidden state that
is part of the snapshot so useSyncExternalStore triggers re-renders.
2026-03-02 21:35:36 -05:00
Derek Ross 3c733b58bd Fix lightbox image clipping, passive touchmove warning, and swipe loading
Add responsive padding to lightbox swipe slots to clear the top bar and
bottom bar overlays. Change LightboxImage from w-full/h-full to
max-w-full/max-h-full so images scale within the padded area instead of
stretching behind the UI controls.

Register touchmove handler via addEventListener with passive:false
instead of React's onTouchMove prop, fixing the 'Unable to
preventDefault inside passive event listener' console warning.

Fix swiped images never appearing by checking img.complete on mount —
cached images from the pre-rendered prev/next slots may not fire onLoad,
leaving them stuck at opacity-0.
2026-03-02 21:10:05 -05:00
Chad Curtis aa643fb8d7 fix(media): kind-1 comment button navigates to post instead of opening sheet
Eliminates the stale-replies problem entirely for kind-1 events by linking
to the post detail page rather than showing an inline comments overlay.
2026-03-02 18:18:00 -06:00
Chad Curtis 529761f409 fix(comments): key CommentsSheet on event.id to force remount on image change
Keying on event.id ensures the component fully unmounts and remounts when
swiping to a new image, clearing stale replies instantly.
2026-03-02 18:14:17 -06:00
Chad Curtis 7cef7aafaa fix(comments): show skeleton while fetching new event's replies
React Query serves cached data instantly for the previous event while the
new fetch is in-flight, causing stale replies to flash. Track the event id
the current data belongs to and treat any in-flight fetch for a different
event as a loading state, showing skeletons instead of stale replies.
2026-03-02 18:13:07 -06:00
Chad Curtis b8170bc971 fix(comments): clear stale replies immediately on event change
Previously the query was gated on 'open', so when swiping to a new image
the old event's replies stayed visible until the new query resolved.
Now the event is always passed so the query key updates instantly.
2026-03-02 18:11:41 -06:00
Chad Curtis 4bcc589e94 feat(media): video/audio support, profile sidebar click, kind-1 reply handling
- MediaGrid/Lightbox: support video (VideoPlayer) and audio (AudioVisualizer)
  with proper per-type rendering in grid thumbs and lightbox strip slots
- Audio thumb shows author avatar with idle-ring animation instead of plain icon
- LightboxSlot renders VideoPlayer/AudioVisualizer constrained to max-w-lg
  matching the audio visualizer width; resolves author avatar for audio via useAuthor
- useProfileMedia: add audio kinds 36787, 34139, 30054, 30055 to query
- CommentsSheet: kind-1 events query only kind-1 replies (not 1111), show
  'Replies' header and 'Add a reply…' placeholder; all other events use 1111
- PhotoBottomBar: simplified back to single CommentsSheet; removed ReplyComposeModal
- CommentsSheet z-index raised to z-[200] so it appears above the Lightbox (z-[100])
- ProfileRightSidebar: onMediaClick callback; ProfilePage wires it to switch
  to media tab and open lightbox at the clicked URL via initialOpenUrl prop
2026-03-02 18:09:44 -06:00
Chad Curtis 83fae3bfea fix(lightbox): show per-event image counter, smooth swipe commit, lower threshold
- MediaGrid flat entries now carry indexInEvent + countInEvent; counter in
  top bar shows '2 / 4' for the current event only, hidden when single image
- swipeCommitted ref + rAF reset so strip snaps invisibly after commit
- Commit threshold lowered from 30% to 20% viewport width
2026-03-02 17:52:36 -06:00
Chad Curtis ad0efdff60 fix(lightbox): smoother swipe and consistent top/bottom padding
Swipe: replace React state-driven translation (caused re-renders + jarring
snap-back) with direct DOM mutation via ref. Axis is locked on first
significant movement; at edges resistance is 20% rubber-band. On release,
if past the 30% threshold the next/prev fires and the position resets
without animation; otherwise it springs back with a single cubic-bezier
transition.

Bottom bar: matches top bar rhythm (px-4 py-3 + safe-area-bottom).
Gradient scrim is now a fixed h-32 pseudo-element that extends upward from
the bottom of the bar, independent of the content height, so it fades
cleanly over the image without needing extra pt-10 padding on the strip.
2026-03-02 17:40:42 -06:00
Chad Curtis 1cb05e4212 refactor: extract MediaGrid + PhotoBottomBar; wire profile media tab to grid view
- Extract PhotoBottomBar into its own component; remove the bottom-nav clearance
  padding (the full-screen lightbox overlay covers the nav bar, only safe-area
  inset is needed)
- Create MediaGrid: generic 3-col square-thumbnail grid that handles imeta tags
  (NIP-68/94 native kinds) and kind-1 inline image URLs; self-contains overlay
  state and opens Lightbox with PhotoBottomBar + cross-event navigation
- PhotosFeedPage now delegates entirely to MediaGrid + MediaGridSkeleton
- Profile media tab replaced: was a NoteCard list, now renders MediaGrid for a
  proper Instagram-style grid experience matching the /photos page
2026-03-02 17:35:54 -06:00
Chad Curtis 485e7cd1c9 refactor(photos): DRY up PhotosFeedPage by extending Lightbox instead of custom overlay
Replace the bespoke PhotoSlide / PhotoCard / PhotoDetailOverlay stack (~250 lines) with a
thin extension of the existing Lightbox component. Lightbox gains bottomBar, onNextEvent,
and onPrevEvent props; ImageGallery forwards them through. PhotosFeedPage now opens a plain
Lightbox with author info + reactions injected via bottomBar, and cross-event swipe/keyboard
navigation wired through onNextEvent/onPrevEvent. Page shrinks from 626 → ~300 lines.
2026-03-02 17:30:46 -06:00
Alex Gleason 9da62f46cf Change wall compose placeholder to 'Write on {user}'s wall' 2026-03-02 14:16:02 -06:00
Alex Gleason 5657c0d7cd Improve NIP-72 community context for comments: show 'Posted in' with community preview 2026-03-02 13:30:22 -06:00
Alex Gleason d8dd662380 Add NIP-72 community detail view for kind 34550 events 2026-03-02 13:19:42 -06:00
Alex Gleason 98459638db Fix sidebar search input width with min-w-0 instead of spacer div
Remove the invisible spacer div hack (w-8 shrink-0) and restore gap-3
on the search row. The actual fix is min-w-0 on the input, which lets
it shrink below its intrinsic minimum width in the flex container.
2026-03-02 12:18:09 -06:00
Alex Gleason d10d87bcb4 Fix sidebar More menu search input pushing content out of bounds
The search input with flex-1 extended ~32px further right than item
labels below (which have a Plus button consuming that space). Added a
matching w-8 spacer and min-w-0 so the input aligns with item labels
and cannot force the row wider than the dropdown.
2026-03-02 12:15:46 -06:00
Alex Gleason 37b16e4332 Remove bg-muted from sidebar More menu search bar to fix visual clipping
The bg-muted/50 background on the search row extended wider than the
item rows below (which have a Plus button consuming right-side space),
creating a visible purple block and visual misalignment that made
content appear truncated on the left.
2026-03-02 12:13:45 -06:00
Alex Gleason 6c3fb905d9 Open sidebar More menu upward to prevent bottom clipping
The More... trigger sits at the bottom of the sidebar, so the dropdown
was opening downward into very little available space, getting clipped.
Use side="top" so it opens upward where there is ample room, and add
collisionPadding for a safety margin from viewport edges.
2026-03-02 12:12:30 -06:00
Alex Gleason 28507550de Restore border-b to NoteCard, remove compensating divide-y from containers
The original border-b border-border was removed from NoteCard in 9bd646b
for a photos overlay feature that no longer uses NoteCard. This forced
every container to add divide-y divide-border as a workaround, but
several pages were missed (Bookmarks, Events, Trends, Search, etc).

Restore NoteCard's self-bordering and remove the now-redundant divide-y
wrappers. Existing overrides (EmbeddedNaddr !border-b, Notifications
border-0) continue to work correctly.
2026-03-02 12:00:13 -06:00
Alex Gleason 62446b3e4f Add bottom border to pinned posts section to separate from regular feed 2026-03-02 11:31:27 -06:00
Alex Gleason fed69f2cc5 Merge branch 'main' of gitlab.com:soapbox-pub/ditto 2026-03-02 11:22:02 -06:00
Chad Curtis d597b0c383 Fix missing top/bottom borders on profile feed note cards 2026-03-02 16:51:02 +00:00
Alex Gleason 543eda02ee Fix linter errors: conditional hook, unused vars/imports, and unstable deps 2026-03-02 10:24:32 -06:00
Alex Gleason 64810d3acc Fix post composer dialog to autofocus textarea instead of X button 2026-03-02 10:17:27 -06:00
Alex Gleason 53757a3886 Increase eoseTimeout to 300ms 2026-03-02 10:12:08 -06:00
Chad Curtis 3868eaf1c3 Revert "Memoize NoteCard to prevent re-renders when feed state changes"
This reverts commit 364e95873d.
2026-03-02 04:47:41 -06:00
Chad Curtis 364e95873d Memoize NoteCard to prevent re-renders when feed state changes 2026-03-02 03:54:31 -06:00
Chad Curtis 08acab793d Revert h-full on feed and auto-prefetch removal 2026-03-02 03:46:23 -06:00
Chad Curtis 055067145e FAB on extra kind pages opens info modal; feed content is h-full 2026-03-02 03:41:10 -06:00
Chad Curtis 64427401e0 Remove inline mode from SidebarMoreMenu, use dropdown on mobile too 2026-03-02 03:35:36 -06:00
Chad Curtis 06bd7fdcc2 Hide leading/consecutive dividers in mobile sidebar when items above them are filtered out 2026-03-02 03:33:32 -06:00
Chad Curtis 4786a09928 Add search to More menu, divider only in edit mode, fix overflow with max-height 2026-03-02 03:28:04 -06:00
Chad Curtis c3010a6282 Add sidebar divider support, only available in edit mode 2026-03-02 03:20:26 -06:00
Chad Curtis ce8f9bb8fc Sync page header icons with sidebar (BookMarked for Books, Earth for World) 2026-03-02 03:12:44 -06:00
Chad Curtis 7f9852c2a9 Remove vines comment sidebar and raise min zap preset to 21 2026-03-02 03:09:25 -06:00
Chad Curtis f0af3f0191 Fix onboarding theme wipe on keygen; restore Treasures to content picker; add Join pill to sidebar 2026-03-02 03:03:44 -06:00
Chad Curtis 0721e5c90a Remove blurry empty state icon; fix streams showing on follows tab with no followers 2026-03-02 02:51:52 -06:00
Chad Curtis 920ad42145 Add divide-y to feed items container to restore borders between notes 2026-03-02 02:47:57 -06:00
Chad Curtis b465747573 Remove rounded-lg from NoteCard article wrapper 2026-03-02 02:46:30 -06:00
Chad Curtis 9259f4ced2 Overhaul videos page and video playback
- Redesign VideosFeedPage: 2-column YouTube-style grid, compact live
  strip with drag/edge-hover scroll, shorts horizontal shelf
- Show 4 videos when live streams present, 6 otherwise, with show more
- Add HLS playback support via hls.js for .m3u8 streams
- Generate thumbnails from video frames as fallback when no image tag;
  handles MP4/WebM/MOV via loadedmetadata+seeked, HLS via hls.js
- Export useVideoThumbnail from VideoPlayer for reuse in feed cards
- Fix kind 21/22 post detail page: render VideoDetailContent with player,
  title, description and hashtags instead of falling through to text note
- Section headers use text-sm uppercase tracking
2026-03-02 02:11:51 -06:00
Chad Curtis eb68ac91a7 Revert "Redesign videos page to YouTube-style vertical feed"
This reverts commit 0e665758ab.
2026-03-02 01:46:57 -06:00
Chad Curtis 0e665758ab Redesign videos page to YouTube-style vertical feed
Replace the fragmented horizontal-scroll sections with a single clean
vertical list of video cards (thumbnail + title + author + timestamp),
matching the normie-familiar YouTube homepage pattern.

- Normal videos (kind 21): full-width aspect-video card with large
  thumbnail, YouTube-style info row (avatar left, title/author/time right)
- Shorts (kind 22): compact portrait card (100px wide thumbnail + text),
  tapping still opens the TikTok-style snap-scroll player
- Live now shelf: compact horizontal strip with smaller chips, sits above
  the feed behind a border separator rather than floating mid-page
- Empty state links directly to 'Switch to Global' inline
2026-03-02 01:46:20 -06:00
Chad Curtis 9bd646b160 Photos overlay: vine-style layout with swipe, comments modal, and shared action buttons 2026-03-02 01:33:58 -06:00
Chad Curtis efed412495 Fix AI chat height on desktop by using CSS class instead of inline style 2026-03-02 01:33:58 -06:00
Chad Curtis 6faa292d05 Fix minimized audio bar clamping on mount; fix AI chat height for PWA safe areas 2026-03-02 01:33:58 -06:00
Alex Gleason b70dcfa974 Remove slop file 2026-03-02 00:57:50 -06:00
Alex Gleason 1cc0679966 Merge branch 'main' of gitlab.com:soapbox-pub/ditto 2026-03-02 00:52:59 -06:00
Mary Kate Fain d029ab4aab Fix theme not updating when switching between logged-in accounts
NostrSync's internal sync state (lastSyncedTimestamp, profileThemeSynced)
was never reset on account switch, so the new user's encrypted settings
were skipped. Add a prevPubkey effect that resets these refs when the
active user changes, allowing the encrypted settings sync to apply the
new user's theme immediately.

Also handle users who never saved a theme: when switching to an account
whose encrypted settings don't contain a theme (or have no encrypted
settings at all), reset to the app default ('system') so the previous
user's theme doesn't bleed through.
2026-03-02 00:48:04 -06:00