Skip to content

Group consecutive attachments in feed posts into horizontal scroll - #18

Merged
KallynGowdy merged 1 commit into
devfrom
claude/quirky-heisenberg-jkzwh4
Sep 11, 2026
Merged

KallynGowdy merged 1 commit into
devfrom
claude/quirky-heisenberg-jkzwh4

Conversation

@KallynGowdy

Copy link
Copy Markdown
Contributor

Description

This change improves the presentation of feed posts containing multiple consecutive attachments (images, videos, audio, files) by grouping them into a single horizontally scrollable container, rather than displaying them vertically stacked.

What changed:

  • Added feedAttachmentRuns.ts with logic to classify events as attachments and group consecutive attachment/non-attachment events into "runs"
  • Updated FeedPostCard.tsx to use the new grouping logic and render multi-attachment runs in a horizontal Scroll component from the folds design system
  • Single attachments and non-attachment content continue to render normally

Why:
This provides better UX for posts with galleries of images or multiple media items, allowing users to browse them horizontally without excessive vertical scrolling, while keeping text and single media items in their natural flow.

Testing:
Added comprehensive unit tests in feedAttachmentRuns.test.ts covering:

  • Attachment event classification (image, video, audio, file vs. text, emote, notice, location)
  • Grouping of consecutive attachments into single runs
  • Splitting of trailing captions into separate runs
  • Alternating runs when attachments and text interleave
  • Edge case of empty event lists

All tests pass.

Fixes #

https://claude.ai/code/session_01Gm3fUenbkKEw2B3xHkwVJe

A post's attachment events (image/video/audio/file) now group into one
horizontally scrollable row instead of stacking vertically, so a
multi-attachment post reads like a carousel. Text/caption events keep
their normal stacked layout.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gm3fUenbkKEw2B3xHkwVJe
@KallynGowdy
KallynGowdy merged commit 267f615 into dev Sep 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants