Skip to content

Conversation

@tonyespinoza1
Copy link
Contributor

@tonyespinoza1 tonyespinoza1 commented Dec 9, 2025

Summary

  • Adds new image-gallery.tsx pattern for uploading and displaying images
  • Uses ct-image-input component for file selection from local filesystem
  • Displays images in a scrolling list sorted by timestamp (newest first)
  • Uses lift() for reactive sorting of the image array

Test plan

  • Deploy pattern with ct charm new
  • Upload multiple images using "Add Photos" button
  • Verify images appear in chronological order (newest at top)
  • Verify scrolling works without image clipping

🤖 Generated with Claude Code


Summary by cubic

Adds a reusable Image Gallery pattern that lets users upload multiple images and browse them in a scrollable, newest-first list. The gallery updates reactively as images are added or timestamps change.

  • New Features
    • New pattern: packages/patterns/image-gallery.tsx
    • Upload multiple images via ct-image-input (max 50)
    • Auto-sort by timestamp (newest first) using lift() for reactive updates
    • Scrollable list with image name and optional timestamp, no clipping

Written for commit 793c67d. Summary will update automatically on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

}

// Sorting function lifted for reactivity
const sortByTimestamp = lift((imgs: ImageData[]) =>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change this to lift((imgs: { timestamp: number }[]) => ... so that the system knows to only read the timestamp and not the whole image for this function.

[...imgs].sort((a, b) => (b.timestamp || 0) - (a.timestamp || 0))
);

export default recipe<Input>("Image Gallery", ({ images }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the new pattern style, so pattern<Input>(({ images }) => {

Pattern allows uploading multiple images from local filesystem and displays
them in a scrolling list sorted by timestamp (newest first). Uses ct-image-input
component with lift() for reactive sorting.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@tonyespinoza1 tonyespinoza1 force-pushed the add-image-gallery-pattern branch from 459533c to 793c67d Compare December 9, 2025 22:02
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.

3 participants