Commit Graph

60 Commits

Author SHA1 Message Date
Gigi
a2620caa29 feat(ui): add 'Read now' button next to each URL in bookmarks\n\n- Display inline book-open icon button per URL\n- Clicking loads readability content in the right panel\n- Added styles for url rows and inline button 2025-10-03 00:32:16 +02:00
Gigi
609e15a738 feat(ui): truncate long bookmark text with expand/collapse chevron\n\n- Show first 210 chars by default\n- Toggle expansion with FontAwesome chevrons\n- Add minimal styles for the toggle 2025-10-03 00:27:31 +02:00
Gigi
fdb8511c87 chore(ui): change 'Author:' label to 'by:' in bookmark cards 2025-10-03 00:26:16 +02:00
Gigi
bdecb1409e refactor(ui): remove copy-to-clipboard buttons from bookmark cards
- Remove copy buttons for event id and author pubkey
- Clean up unused code and imports
2025-10-03 00:22:25 +02:00
Gigi
20f37b94e1 fix(profile): enable reactive profile fetch via address loader lookup relays and improve fallback display\n\n- Configure createAddressLoader with common profile relays (purplepag.es, primal, nostr.band)\n- Avoid sticky 'Loading profile...' label; fallback to short pubkey until profile loads 2025-10-03 00:16:04 +02:00
Gigi
21890f002d chore(lint): fix hooks rule error by separating content resolver component and helpers
- Move shared helpers into src/utils/helpers.ts
- Add ContentWithResolvedProfiles component file to avoid hooks rule violation
- Use strong IconDefinition type in icon map
- Resolve linter warnings and errors
2025-10-03 00:12:40 +02:00
Gigi
5495890204 feat(ui): improve logged-in user profile resolution
- Add debug logging to track profile loading
- Show 'Loading profile...' while profile data is being fetched
- Better handling of profile loading states
- Ensures user sees proper name instead of pubkey when available
2025-10-03 00:04:11 +02:00
Gigi
6d585dcef6 feat(ui): resolve nprofile strings to human-readable names
- Add extractNprofilePubkeys utility to parse nprofile strings from content
- Create ContentWithResolvedProfiles component using applesauce ProfileModel
- Replace nprofile strings with @displayName in bookmark content
- Update BookmarkItem to use resolved content rendering
- Improves readability by showing names instead of long nprofile strings
2025-10-03 00:02:22 +02:00
Gigi
0bae6674ce feat(ui): resolve author names using applesauce ProfileModel
- Import useEventModel and Models from applesauce-react
- Use ProfileModel to fetch author profile data for each bookmark
- Display author name/display_name/nip05 instead of raw pubkey
- Fallback to short pubkey if profile not available
- Improves readability by showing human-readable author names
2025-10-03 00:00:04 +02:00
Gigi
096509baf6 feat(ui): replace kind numbers with FontAwesome icons
- Import all kind-specific icons from FontAwesome
- Add getKindIcon mapping function based on kind-icons.txt
- Replace 'Kind: X' text with visual icon in bookmark-meta
- Add styling for kind-icon with blue accent color
- Fallback to file icon for unmapped kinds
2025-10-02 23:59:11 +02:00
Gigi
4c2626f3c4 feat(ui): add spinner to content loading state
- Replace text with FontAwesome spinner icon
- Add loading-spinner styles for proper alignment
- Improve visual feedback during content fetch
2025-10-02 23:54:19 +02:00
Gigi
719ddf3f0b feat(readability): render Markdown when proxy provides it
- Detect markdown blocks from r.jina.ai output
- Add react-markdown + remark-gfm for rendering
- Extend ContentPanel to render markdown or HTML
- Add styles for markdown content
2025-10-02 23:46:33 +02:00
Gigi
4163ffa4ba feat(ui): add READ NOW button to bookmark cards
- Shows when a bookmark has URLs
- Triggers onSelectUrl to load readability content in main panel
- Added styles for prominent call-to-action
2025-10-02 23:41:03 +02:00
Gigi
cf230623a4 chore: remove unused faLock import to satisfy linter 2025-10-02 23:39:04 +02:00
Gigi
96d93d0e17 feat(layout): add two-pane layout and content fetching pipeline
- Left: bookmark list; Right: content panel
- Selection triggers readability fetch via readerService
- ContentPanel renders title and HTML
- Wires selection from BookmarkItem -> BookmarkList -> Bookmarks
2025-10-02 23:34:21 +02:00
Gigi
1d10c10a44 feat: propagate URL selection through BookmarkList to parent 2025-10-02 23:33:42 +02:00
Gigi
dab35820b7 feat: add onSelectUrl to BookmarkItem and intercept URL clicks
- Adds optional onSelectUrl callback
- Prevents default navigation to open in main content panel
- Keeps middle-click/target blank behavior if no handler
2025-10-02 23:33:05 +02:00
Gigi
9d5e8c194b feat(ui): add ContentPanel component to render readable HTML
- Shows loading/empty states
- Renders title and HTML via dangerouslySetInnerHTML
- Minimal API for integration
2025-10-02 23:32:32 +02:00
Gigi
b671e0e259 feat: update bookmark icons to use fa-bookmark and fa-user-lock
- Replace faGlobe with faBookmark for public bookmarks
- Add faUserLock icon alongside faBookmark for private bookmarks
- Import faBookmark and faUserLock from FontAwesome
- Update CSS to handle icon spacing with flexbox and gap
- Private bookmarks now show both bookmark and user-lock icons
2025-10-02 23:23:57 +02:00
Gigi
9400faa00f feat: display URLs clearly in individual bookmarks
- Extract URLs from bookmark content using extractUrlsFromContent()
- Display extracted URLs in a dedicated section with proper styling
- URLs are clickable and open in new tabs
- Reuse existing CSS styles for consistent appearance
2025-10-02 23:11:22 +02:00
Gigi
5173a37b69 feat: remove 'EVENT' text from bookmark type labels
- Remove bookmark.type display next to lock/globe icons
- Keep only the visual icons for private/public indication
2025-10-02 23:10:42 +02:00
Gigi
3eca2879ef fix: resolve all linting and type checking issues
- Fix empty catch blocks in BookmarkItem and bookmarkService
- Replace any types with proper NostrEvent interface
- Add proper error handling with console.warn
- Use eslint-disable for unavoidable any types in applesauce integration
2025-10-02 11:26:12 +02:00
Gigi
4db147ddf3 feat(ui): add copy-to-clipboard icons for event id and author pubkey 2025-10-02 11:02:43 +02:00
Gigi
7d26372878 feat(ui): add FontAwesome globe/lock icons; render content identically for private/public 2025-10-02 10:44:06 +02:00
Gigi
4be8eff80a feat: add debugging for private bookmark decryption
- Added detailed logging to understand why getHiddenBookmarks returns undefined
- Check bookmark list content and encryption format
- Verify account has decryption capabilities
- Pass full account object with extension capabilities to applesauce helpers
- This will help diagnose the NIP-44 vs NIP-04 encryption issue
2025-10-02 10:02:50 +02:00
Gigi
a7cfc802d1 fix: resolve linting and type checking issues
- Fixed TypeScript error by properly handling undefined activeAccount
- Removed unnecessary 'as any' type assertion
- All linting rules now pass with 0 warnings
- TypeScript compilation passes without errors
2025-10-02 09:38:32 +02:00
Gigi
79f83b214f feat: add private bookmarks support with NIP-51 and visual indicators
- Updated bookmark types to support private bookmarks with isPrivate and encryptedContent fields
- Enhanced bookmark service to detect encrypted content and mark bookmarks as private
- Added visual indicators for private bookmarks with lock icon and special styling
- Added CSS styles for private bookmarks with red accent border and gradient background
- Updated BookmarkItem component to show private bookmark indicators
- Maintained compatibility with existing public bookmark functionality
2025-10-02 09:36:46 +02:00
Gigi
2253172e04 refactor: extract components and utilities to keep files under 210 lines
- Extract types to src/types/bookmarks.ts
- Extract utility functions to src/utils/bookmarkUtils.tsx
- Extract BookmarkItem component to src/components/BookmarkItem.tsx
- Extract BookmarkList component to src/components/BookmarkList.tsx
- Extract bookmark fetching logic to src/services/bookmarkService.ts
- Reduce main Bookmarks component from 416 to 100 lines
- Maintain all functionality while improving code organization
- Pass all linting and type checking
2025-10-02 09:19:44 +02:00
Gigi
15d155c565 fix: resolve undefined timeoutId variable in fetchBookmarks function
- Move timeoutId declaration outside try block to make it accessible in both try and catch blocks
- Fixes ESLint no-undef error and TypeScript compilation error
2025-10-02 09:17:05 +02:00
Gigi
934043f858 fix: resolve loading state stuck issue
- Remove loading check from early return condition
- Add timeout to ensure loading state gets reset
- Clear timeout when function completes
- This should allow fetchBookmarks to run properly
2025-10-02 09:15:04 +02:00
Gigi
774ce0f1bf debug: add detailed logging to fetchBookmarks function
- Add console logs to track if fetchBookmarks is called
- Log early return conditions
- This will help identify why the function might not be executing
2025-10-02 09:14:24 +02:00
Gigi
6481dd1bed fix: remove unused NostrEvent import
- Fix TypeScript compilation error
- Remove unused import that was causing build issues
2025-10-02 09:13:43 +02:00
Gigi
d7b5b4f9b4 debug: add obvious console log to verify new code is running 2025-10-02 09:13:28 +02:00
Gigi
bed0f3d508 refactor: implement proper bookmark fetching flow
- Fetch bookmark list event (kind 10003) first
- Extract event IDs from e tags
- Fetch each individual event by ID
- Remove complex async parsing logic
- Simplify to direct sequential fetching
- Remove unused functions
2025-10-02 09:12:05 +02:00
Gigi
44954a6c15 debug: add test filter to check if any events are found
- Add broader test filter to see if user has any events
- Log event kinds to understand what events exist
- This will help diagnose if the issue is with bookmark events specifically
2025-10-02 09:09:05 +02:00
Gigi
a43e742183 fix: temporarily disable individual bookmark fetching
- Disable individual bookmark fetching to isolate the issue
- Keep basic bookmark list functionality working
- Add TODO to re-enable individual bookmark fetching later
2025-10-02 09:08:51 +02:00
Gigi
a97808b23e debug: add debugging logs to bookmark fetching
- Add console logs to track bookmark fetching progress
- Add early return when no bookmark events found
- Reduce timeout for individual bookmark fetching
- Add debugging for individual bookmark fetching process
2025-10-02 09:08:45 +02:00
Gigi
bf79bbceb8 feat: implement individual bookmark fetching and display
- Add IndividualBookmark interface for individual bookmark events
- Implement fetchIndividualBookmarks function to fetch events by e and a tags
- Update parseBookmarkEvent to be async and fetch individual bookmarks
- Add renderIndividualBookmark component for displaying individual bookmarks
- Update UI to show individual bookmarks in a grid layout
- Add CSS styles for individual bookmarks with dark/light mode support
- Support both event references (e tags) and article references (a tags)
- Use applesauce content parsing for proper content rendering
2025-10-02 09:05:32 +02:00
Gigi
e2690e7177 fix: resolve duplicate events and React key warnings
- Add event deduplication by ID to prevent duplicates from multiple relays
- Fix React key warnings by using unique keys with index
- Prevent multiple simultaneous fetchBookmarks calls with loading state check
- Optimize useEffect dependencies to only depend on pubkey
- Add logging for deduplication process
2025-10-02 09:00:23 +02:00
Gigi
30c4057625 fix: implement correct applesauce RelayPool.req() pattern
- Replace relayPool.query() with relayPool.req() method
- Add proper RxJS imports (lastValueFrom, takeUntil, timer, toArray)
- Add completeOnEose from applesauce-relay for proper EOSE handling
- Use proper Filter type from nostr-tools
- Fix relay URLs extraction from RelayPool.relays Map
- Follow applesauce documentation pattern for event fetching
2025-10-02 08:58:07 +02:00
Gigi
ae9f2607a1 fix: implement proper applesauce relay pool query pattern
- Replace addressLoader with direct relayPool usage
- Use relayPool.query() with proper filter for kind:10003 events
- Add RelayPool import to Bookmarks component
- Update TypeScript interfaces to use RelayPool instead of addressLoader
- Follow applesauce documentation pattern for querying events
2025-10-02 08:53:39 +02:00
Gigi
77b9a01a1d fix: properly configure addressLoader with query parameters
- Call addressLoader as function with kind and pubkey parameters
- Update TypeScript interface to reflect function signature
- Add logging to show query configuration
- This should now properly query for kind:10003 events for the specific pubkey
2025-10-02 08:51:37 +02:00
Gigi
ed1ea94662 refactor: simplify addressLoader usage as Observable
- Remove unnecessary function type checking since addressLoader is always an Observable
- Update TypeScript interface to reflect Observable type
- Simplify code by directly subscribing to the Observable
- Remove redundant conditional logic
2025-10-02 08:47:15 +02:00
Gigi
d801af81a4 fix: handle addressLoader as both function and Observable
- Add type checking to handle addressLoader as either function or Observable
- Fix TypeError: addressLoader is not a function error
- Add debugging logs to understand addressLoader type at runtime
- Support both function and Observable patterns for addressLoader usage
2025-10-02 08:45:55 +02:00
Gigi
ff7da4c6a2 debug: add detailed logging to diagnose addressLoader type issue
- Log addressLoader creation and type in App.tsx
- Log addressLoader type and value in Bookmarks component
- This will help identify why addressLoader is not a function
- The error shows addressLoader exists but isn't callable

This should reveal what createAddressLoader actually returns.
2025-10-02 08:41:54 +02:00
Gigi
e1b87138b1 fix: replace alert with proper console.log debugging
- Remove intrusive alert popup
- Use console.log for all debugging output
- Maintain comprehensive logging for diagnosis
- Keep debugging professional and non-intrusive

Much better debugging approach! 🎯
2025-10-02 08:39:23 +02:00
Gigi
f0cf31252f debug: add extensive logging and alerts to diagnose bookmark fetching
- Add console logs for relay group creation and relay URLs
- Add detailed logging in Bookmarks useEffect to track dependencies
- Add alert to confirm bookmark fetch is starting
- Log addressLoader and activeAccount availability
- Track when fetchBookmarks is called vs when dependencies are missing

This will help diagnose why bookmarks aren't appearing and
why console logs might not be visible.
2025-10-02 08:37:50 +02:00
Gigi
8058a99cf2 improve: optimize applesauce-relay usage following documentation patterns
- Create relay group using pool.group() for better event deduplication
- Follow applesauce-relay documentation for relay group management
- Remove manual relay connection monitoring (handled by pool)
- Use pool directly with address loader for optimal performance
- Add logging for relay group creation
- Maintain extraRelays configuration for address loader
- Follow applesauce-relay best practices for relay pool usage

This follows the applesauce-relay documentation exactly as shown
in the Relay Group example, providing better deduplication and
connection management.
2025-10-02 08:37:05 +02:00
Gigi
5d6e329030 fix: properly connect to relays and add debugging for bookmark fetching
- Connect to relays using pool.relay() before creating address loader
- Add relay connection event listeners for debugging
- Add console logging to track bookmark fetching process
- Increase timeout to 10 seconds for better relay response time
- Log received events and parsed bookmarks for debugging
- Track relay connection status and errors

This should fix the issue where bookmarks weren't being fetched
due to missing relay connections.
2025-10-02 08:34:59 +02:00
Gigi
c1e0e82704 feat: integrate applesauce-content for proper content parsing and rendering
- Install applesauce-content package for content parsing
- Use getParsedContent() to parse nostr content according to applesauce patterns
- Create proper TypeScript interfaces for ParsedNode and ParsedContent
- Add renderParsedContent() component to render parsed content with proper styling
- Handle mentions, links, and text content with appropriate styling
- Add CSS styles for nostr-mention and nostr-link classes
- Follow applesauce-content documentation patterns for content rendering
- Maintain type safety with proper interfaces instead of 'any' types

This follows the applesauce-content documentation exactly as shown
in the examples, providing proper content parsing and rendering.
2025-10-02 08:33:00 +02:00