Commit Graph

122 Commits

Author SHA1 Message Date
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
3d8b19d05f feat: add nostr.band relay for better bookmark coverage
- Add wss://relay.nostr.band to relay list
- Increase relay diversity for better bookmark discovery
- nostr.band is a popular relay with good event coverage

This should improve the chances of finding bookmarks
across different relay networks.
2025-10-02 08:36:01 +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
Gigi
b6721f685b fix: properly parse NIP-51 bookmark lists (kind 10003) according to specification
- Parse bookmark lists correctly according to NIP-51 specification
- Handle 'e' tags for event references (the actual bookmarks)
- Handle 'a' tags for article references
- Handle 'r' tags for URL references
- Display bookmark count and organize references by type
- Show event IDs in a readable format with truncation
- Add proper CSS styling for bookmark list display
- Update Bookmark interface to include metadata fields

This fixes the issue where kind:10003 bookmark lists weren't being
displayed properly. Now follows the NIP-51 specification exactly
as shown in the example event structure.
2025-10-02 08:31:19 +02:00
Gigi
9eeda77132 improve: use applesauce-react event models for better profile handling
- Import useEventModel hook and Models from applesauce-core
- Use ProfileModel to automatically fetch and manage user profile data
- Display user name, display_name, or nip05 instead of just public key
- Follow applesauce-react best practices for event model usage
- Improve user experience with proper profile information display
- Maintain fallback to formatted public key if profile data unavailable

This follows the applesauce-react documentation pattern for using
event models instead of manual event parsing.
2025-10-02 08:29:38 +02:00
Gigi
208dbb17cf fix: resolve all linting and TypeScript issues
- Set up comprehensive ESLint configuration with TypeScript support
- Fix React import issues by adding explicit React imports
- Replace 'any' types with proper TypeScript types (unknown, specific interfaces)
- Add proper type definitions for addressLoader function signature
- Make relays parameter optional in addressLoader interface
- Fix TypeScript strict null checks and function call signatures
- Ensure all code passes ESLint with zero warnings
- Verify TypeScript compilation with no errors
- Maintain strict linting rules without reducing code quality

All linting and type checking now passes successfully.
2025-10-02 07:32:12 +02:00
Gigi
1b11d36de3 improve: optimize relay usage following applesauce-relay best practices
- Organize relay URLs in a centralized array for better maintainability
- Use RelayPool with extraRelays configuration for automatic relay management
- Remove manual relay specification in address loader calls
- Let the pool handle relay selection and deduplication automatically
- Add comments explaining relay group benefits and deduplication
- Follow applesauce-relay documentation patterns for efficient relay usage

This improves relay efficiency by letting the pool handle relay selection,
deduplication, and connection management automatically.
2025-10-02 07:30:18 +02:00
Gigi
b4ce082b91 refactor: use proper applesauce-loaders for NIP-51 bookmark fetching
- Replace manual event fetching with applesauce Address Loader
- Use Loaders.createAddressLoader() for proper replaceable event loading
- Configure loader with eventStore, bufferTime, and relay hints
- Remove manual RxJS subscription handling in favor of applesauce patterns
- Add applesauce-loaders dependency for specialized loading methods
- Clean up unused imports and variables
- Follow applesauce best practices for event loading

This implements the proper applesauce pattern for fetching kind:10003
bookmark events as recommended in the applesauce-loaders documentation.
2025-10-02 07:29:37 +02:00
Gigi
b245a11ade fix: implement proper NIP-51 bookmark fetching from nostr relays
- Add RelayPool to connect to nostr relays (damus.io, nos.lol, snort.social)
- Fix bookmark fetching to actually query relays instead of empty local store
- Use eventStore.filters() with Observable subscription to fetch kind 10003 events
- Add proper RxJS imports for takeUntil and timer
- Implement 5-second timeout for relay queries
- Add applesauce-relay dependency for relay connectivity
- Fix critical bug where bookmarks were never fetched from network

This ensures we're actually displaying kind:10003 bookmark events from the
logged-in user as specified in NIP-51, not just querying an empty local store.
2025-10-02 07:28:12 +02:00
Gigi
0369ece6f4 refactor: migrate to applesauce-accounts for proper account management
- Replace manual WebSocket connections with applesauce-accounts
- Use ExtensionAccount.fromExtension() for nostr browser extension integration
- Add AccountsProvider to component tree for account management
- Use useActiveAccount hook to get current user account
- Simplify user display to show formatted public key (profile fetching TODO)
- Remove manual profile fetching WebSocket code
- Improve architecture with proper applesauce account system
- Add applesauce-accounts dependency to package.json

This provides a more robust and standardized approach to nostr account
management using the applesauce ecosystem.
2025-10-02 07:24:37 +02:00
Gigi
496b19f021 feat: display user profile name instead of public key
- Fetch user profile from nostr relay on login
- Display NIP-05, display name, or username instead of public key
- Priority: NIP-05 > name > username > public key
- Add WebSocket connection to fetch profile events (kind 0)
- Update Login component to fetch and pass profile data
- Update Bookmarks component to show user-friendly display name
- Fallback to formatted public key if no profile available
- Improve user experience with recognizable identity
2025-10-02 07:21:55 +02:00
Gigi
fe35f45a42 feat: display user public key after successful login
- Add userPublicKey state to App component
- Pass public key from Login to App to Bookmarks
- Display formatted public key in bookmarks header
- Show 'Logged in as: abc12345...xyz67890' format
- Update header layout to accommodate user info
- Add styling for user info display
- Improve login success feedback for users
2025-10-02 07:19:35 +02:00
Gigi
f99c29ce78 chore: set initial version to 0.0.1
- Update package.json version from 0.1.0 to 0.0.1
- This represents the initial MVP release of markr
2025-10-02 07:18:34 +02:00
Gigi
16a95facc5 chore: remove vite cache files from tracking
- Remove .vite/deps_temp_* files that were previously tracked
- These files are now properly ignored by .gitignore
- Clean up repository to exclude build artifacts
2025-10-02 07:18:18 +02:00
Gigi
4af9cd646b chore: add comprehensive .gitignore file
- Ignore node_modules and dependency files
- Exclude build outputs (dist/, build/, .vite/)
- Ignore environment variables and secrets
- Exclude IDE/editor files (.vscode/, .idea/)
- Ignore OS generated files (.DS_Store, Thumbs.db)
- Exclude logs, cache, and temporary files
- Add TypeScript and Vite specific ignores
2025-10-02 07:18:04 +02:00
Gigi
5d53a827e0 feat: initialize markr nostr bookmark client
- Add project structure with TypeScript, React, and Vite
- Implement nostr authentication using browser extension (NIP-07)
- Add NIP-51 compliant bookmark fetching and display
- Create minimal UI with login and bookmark components
- Integrate applesauce-core and applesauce-react libraries
- Add responsive styling with dark/light mode support
- Include comprehensive README with setup instructions

This is a minimal MVP for a nostr bookmark client that allows users to
view their bookmarks according to NIP-51 specification.
2025-10-02 07:17:07 +02:00