Skip to content

Kind 20 support for picture notes posted from Olas#1753

Open
rabble wants to merge 26 commits intomainfrom
kind_20_support
Open

Kind 20 support for picture notes posted from Olas#1753
rabble wants to merge 26 commits intomainfrom
kind_20_support

Conversation

@rabble
Copy link
Copy Markdown
Contributor

@rabble rabble commented Feb 4, 2025

Issues covered

Add support for picture notes in feeds

Description

This PR adds support for displaying picture notes (posts containing images) in the feed with an optimized layout. Key changes include:

  • Added new PictureNoteCard view component for image-focused note display
  • Updated feed views to detect and use picture-specific layout when appropriate
  • Added image loading and caching support
  • Handles both single and multiple image scenarios
  • Maintains consistent styling with existing note cards

How to test

  1. Launch app and navigate to main feed
  2. Look for posts containing images - they should now show the image prominently
  3. Test posting a new note with an image attachment
  4. Verify images load properly in both light and dark mode
  5. Check that tapping images opens them in full screen viewer
  6. Verify multiple image handling works as expected

Screenshots/Video

Updated UI
Screenshot 2025-02-04 at 1 59 47 PM

Screenshot 2025-02-04 at 2 00 35 PM

Old version not displaying kind 20 events.
Screenshot 2025-02-04 at 2 01 04 PM

rabble and others added 5 commits April 7, 2025 11:58
- Remove duplicate videoPost method in JSONEvent+Kinds.swift
- Simplify constructors using tuple assignment
- Add better error handling and loading states to VideoNoteCard
- Fix conditional bug in NoteCard.swift
- Implement helper methods for tag parsing
- Improve RepliesLabel error handling with fallbacks
- Add throttling to avoid excessive avatar computations
- Add type safety improvements with tagArray computed property

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Added EventTagHelpersTests.swift to test tag parsing helpers
- Added tests for Picture Post and Video Post JSONEvent methods
- Created comprehensive documentation in doc/nip68_71_implementation.md
- Updated KIND_20_IMPROVEMENTS.md with completed checklist

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Enhanced URL parsing to handle various format of video URLs
- Added MIME type detection and format checking for better video identification
- Improved video player with robust error handling and status reporting
- Added playback controls and loading states for better UX
- Added fallback options for various kinds of media tags
- Separated dedicated VideoPlayerView component for better maintainability

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

Co-Authored-By: Claude <noreply@anthropic.com>
Added Logger import to fix compile error

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix implicit return warnings in tag helper methods
- Fix brace formatting in NoteCard conditional logic
- Add comprehensive tests for MIME type detection and video tag identification
- Improve code formatting and readability
Change 'error as NSError' to 'error as? NSError' to correctly handle the optional type conversion
@rabble rabble enabled auto-merge May 19, 2025 17:18
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.

1 participant