Commit Graph

59 Commits

Author SHA1 Message Date
Gigi
1b8c276529 chore: upgrade applesauce packages to v4.0.0
- Update all applesauce packages from 3.1.0 to 4.0.0
- Add applesauce-factory dependency
- Version 4.0.0 includes app-data helpers needed for NIP-78
2025-10-05 02:35:28 +01:00
Gigi
1b381a0f8c fix: export app-data helpers from applesauce-core
- Add app-data.js export to helpers index
- Update import path in settingsService to use applesauce-core/helpers
2025-10-05 02:33:46 +01:00
Gigi
35aa9d6cce feat: add collapse-on-article-open setting
- Add collapseOnArticleOpen setting (default: true)
- Position as first setting in settings panel
- Auto-collapse bookmark bar when user opens an article
- User can disable this behavior in settings
2025-10-05 02:31:23 +01:00
Gigi
f8c8ab5402 feat: add settings panel with NIP-78 storage
- Create settings service using Kind 30078 for user preferences
- Add Settings component with UI for configuring app preferences
- Wire settings icon to open settings modal
- Store settings like default view mode, sidebar collapse states, etc.
- Use d tag: com.dergigi.boris.user-settings
2025-10-05 02:30:30 +01:00
Gigi
e0ddd43fe4 feat: add localStorage caching for fetched articles
- Cache articles in localStorage with 7-day TTL
- Check cache before fetching from jina.ai
- Add optional bypassCache parameter
- Automatically expire and cleanup old cached content
2025-10-05 02:14:53 +01:00
Gigi
c0de624fe6 refactor: use applesauce helpers for highlight parsing
- Replace manual tag parsing with applesauce-core helper functions
- Use getHighlightText, getHighlightContext, getHighlightComment, etc.
- Add support for highlight comments in UI
- Extract author from attributions using proper helper
- Handle both event and address pointers correctly
- Add styling for highlight comments

This follows applesauce best practices and makes the code more robust.
2025-10-04 20:41:26 +01:00
Gigi
1d7ab59272 feat: deduplicate highlight events by ID
- Add dedupeHighlights function to remove duplicate events from multiple relays
- Log both raw and deduplicated event counts for debugging
- Follows same pattern as bookmark deduplication
2025-10-04 20:39:25 +01:00
Gigi
7390104414 feat: add NIP-84 highlights panel with three-pane layout
- Add HighlightsPanel component with collapsible functionality
- Add HighlightItem component to display individual highlights
- Create highlightService to fetch kind 9802 events
- Add Highlight type definitions for NIP-84
- Update Bookmarks to support three-pane layout (bookmarks, content, highlights)
- Add comprehensive CSS styling for highlights panel
- Update README with highlights feature documentation

The highlights panel mirrors the bookmark sidebar on the right side, showing
all NIP-84 highlights with context, source links, and timestamps. Both panels
are independently collapsible for flexible viewing.
2025-10-04 19:47:45 +01:00
Gigi
0964156bcc feat(bookmarks): sort by added_at (recently added first), fallback to event time\n\n- Track synthetic added_at on processed items\n- Keep order aligned with append semantics from Kind 10003 guidance (newest at end)\n- Cite: https://nostrbook.dev/kinds/10003 2025-10-03 01:41:11 +02:00
Gigi
2ca350ee5f fix(bookmarks): show bookmarked event author instead of list signer\n\n- During hydration, set IndividualBookmark.pubkey to hydrated event.pubkey\n- Ensures author resolution uses the actual author of the bookmarked event 2025-10-03 00:21:24 +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
de32807995 feat(reader): add lightweight readability fetcher via r.jina.ai proxy
- Provide fetchReadableContent(url) returning simplified HTML
- Avoid heavy deps and CORS issues using proxy
- Extract <title> best-effort
2025-10-02 23:32:00 +02:00
Gigi
50b32a66de feat(bookmarks): extract URLs from content into urlReferences for each item 2025-10-02 22:34:06 +02:00
Gigi
1b41b6e823 fix(timestamps): use seconds for created_at fallbacks; UI date formatting remains ms-converted 2025-10-02 22:30:31 +02:00
Gigi
2696bdb57a fix(bookmarks): dedupe individual bookmarks by id to avoid duplicates in UI 2025-10-02 22:28:47 +02:00
Gigi
1226124566 refactor(services): extract helpers and event processing; keep files <210 lines; lint+types clean 2025-10-02 22:03:47 +02:00
Gigi
8967963535 refactor(services): remove usages in bookmarkService, add type guards; lint clean 2025-10-02 21:42:51 +02:00
Gigi
c748f173b3 feat(bookmarks): surface manually decrypted hidden tags in UI; convert JSON tags via Helpers.parseBookmarkTags and include in private items immediately 2025-10-02 21:37:37 +02:00
Gigi
51f009a489 feat(bookmarks): try NIP-44 then NIP-04 for manual decryption; cache decrypted hidden tags for display/debug 2025-10-02 21:30:12 +02:00
Gigi
18d936e222 feat: add detailed debugging for decryption process
- Add logging for what content is being sent to browser extension
- Add fallback to try string conversion if object is passed
- Add parsing of extension error responses
- Help identify exact format expected by browser extension
2025-10-02 21:17:27 +02:00
Gigi
ce7fbdbdf3 feat: implement direct decryption for unrecognized event kinds
- Add manual decryption using signer's nip04 capabilities directly
- Parse decrypted content as JSON array of bookmark tags
- Cache decrypted content properly for getHiddenBookmarks to find
- Enable decryption of legacy bookmark events (kind 30001) with encrypted content
2025-10-02 21:08:20 +02:00
Gigi
6e6d43cb25 feat: add manual decryption for unrecognized event kinds
- Add fallback decryption for events with encrypted content but unrecognized kinds
- Temporarily change event kind to 10003 to use applesauce's standard decryption
- Enables decryption of legacy bookmark events (kind 30001) that contain private bookmarks
- Maintains compatibility with standard NIP-51 bookmark events
2025-10-02 20:59:19 +02:00
Gigi
0ed7c1497f feat: sort individual bookmarks by timestamp (newest first)
- Sort allBookmarks array by created_at timestamp in descending order
- Ensures newest bookmarks appear first in the UI
- Maintains chronological order with most recent bookmarks at the top
2025-10-02 20:56:34 +02:00
Gigi
a2c31b32de feat: increase bookmark loading timeout by 2x
- Increase timeout from 10s to 20s for bookmark fetching
- Increase timeout from 10s to 20s for event hydration
- Provide more time for slow relays to respond
2025-10-02 20:54:31 +02:00
Gigi
cdce972e72 feat: enhance bookmark debugging and fetch legacy formats
- Add detailed logging for events with content (potentially encrypted)
- Fetch legacy bookmark format (kind 30001) in addition to NIP-51 standards
- Show content preview for all events to identify encrypted content
- Help identify if private bookmarks are in different event formats
2025-10-02 20:51:20 +02:00
Gigi
00638410c0 feat: add more relays and fix logging for better bookmark debugging
- Add more popular relays for better bookmark discovery
- Fix variable scoping in bookmark event logging
- Enhanced debugging to see dTag and tag content structure
2025-10-02 20:50:07 +02:00
Gigi
2e5d0e3725 feat: add detailed logging to debug bookmark event structure
- Add logging for raw events before deduplication to see all fetched events
- Add detailed tag inspection for bookmark events including dTag and first few tags
- Help identify if private bookmarks are in separate bookmark sets (30003) or main lists (10003)
2025-10-02 20:48:16 +02:00
Gigi
a66c051444 fix: correct bookmark event kinds to match NIP-51 standards
- Fix bookmark list kind from 30001 to 10003 (kinds.BookmarkList)
- Fix bookmark sets kind from 30001 to 30003 (kinds.Bookmarksets)
- Update dedupeNip51Events to handle correct NIP-51 event kinds
- Now fetching the correct bookmark events that support hidden tags
2025-10-02 20:41:53 +02:00
Gigi
eb282fcbb0 fix: fix hidden bookmark detection by using applesauce's built-in logic
- Remove custom isEncryptedContent function that was too restrictive
- Use applesauce's hasHiddenContent() and hasHiddenTags() functions instead
- These properly detect encrypted content regardless of format
- Remove failing relay.snort.social from relay list
- Add detailed logging to show hidden content detection status
2025-10-02 20:38:46 +02:00
Gigi
d54313b015 fix: correct NIP-51 bookmark event kinds and deduplication
- Fix bookmark event kinds: use 30001 (BookmarkList) and 30003 (Bookmarksets) instead of incorrect 10003
- Update dedupeNip51Events to properly handle both bookmark lists and bookmark sets
- Add detailed logging to inspect bookmark event structure and content
- Should now properly detect Amethyst private bookmarks
2025-10-02 20:26:52 +02:00
Gigi
08fc541eaa fix: properly configure browser extension signer for hidden bookmarks
- Fix signer extraction for ExtensionAccount to use nip04/nip44 capabilities
- Add debug logging to understand hidden bookmarks unlocking process
- Ensure ExtensionAccount can be used as HiddenContentSigner for decryption
- Handle both ExtensionAccount and raw signer for maximum compatibility
2025-10-02 19:46:34 +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
ac7f1007a7 feat(bookmarks): fetch all NIP-51 events; dedupe 10003/30001; unlock private via applesauce; hydrate ids; trim logs 2025-10-02 11:22:07 +02:00
Gigi
2eda8f3227 chore(debug): log per-event hidden/locked state; log unlock attempts and results 2025-10-02 11:01:23 +02:00
Gigi
64825175a7 fix(bookmarks): unlock based on applesauce hidden-tags state only; keep file compact 2025-10-02 10:59:06 +02:00
Gigi
5ee0f49b69 feat(bookmarks): hydrate event content for pointers; robust unlock (nip04->nip44); aggregate across events 2025-10-02 10:51:33 +02:00
Gigi
ab00bd84e6 fix(bookmarks): hide encrypted ciphertext from title/preview; prefer plaintext content 2025-10-02 10:39:57 +02:00
Gigi
ec4473fc51 feat(bookmarks): aggregate list(10003) + set(30001); unlock hidden per-event; merge results 2025-10-02 10:35:07 +02:00
Gigi
0f57338866 fix(bookmarks): avoid unlock with empty ciphertext; require hidden tags + ciphertext 2025-10-02 10:32:02 +02:00
Gigi
a8cdeeaef2 feat(bookmarks): unlock hidden bookmarks via applesauce helpers and signer; reduce logs 2025-10-02 10:30:18 +02:00
Gigi
92d49468cd fix: resolve TypeScript type issues
- Update AccountWithExtension interface to be more flexible
- Add type guard for runtime type checking
- Change fetchBookmarks parameter to accept unknown type with validation
- All linting and type checks now pass
2025-10-02 10:23:01 +02:00
Gigi
a625203fe4 refactor: clean up bookmark service and use proper applesauce approach
- Remove unused imports and variables
- Keep the enhanced debugging for multiple bookmark list events
- Use native applesauce getHiddenBookmarks which should trigger browser extension
- This follows the applesauce models pattern for handling private bookmarks
2025-10-02 10:21:44 +02:00
Gigi
e3efcd4a7c debug: enhance private bookmark detection with detailed logging
- Check multiple bookmark list events for encrypted content
- Add detailed logging for signer availability and type
- Use native applesauce getHiddenBookmarks which should trigger browser extension
- This will help identify why private bookmarks aren't being detected
2025-10-02 10:20:55 +02:00
Gigi
ba76a6a9ef feat: enhance private bookmark detection
- Fetch multiple bookmark list events (limit 10) to find private bookmarks
- Check all events for encrypted content before selecting one
- Add detailed logging to identify which event has encrypted content
- This should help find your private bookmarks if they exist in a different event
2025-10-02 10:19:37 +02:00
Gigi
c5a32b911d debug: add detailed logging for bookmark content
- Check if bookmark list has encrypted content
- Log content preview to understand the structure
- This will help determine why browser extension isn't triggered
2025-10-02 10:15:34 +02:00
Gigi
610de95481 feat: improve private bookmark handling
- Use proper error handling for getHiddenBookmarks
- Add detailed logging to understand what's happening
- The browser extension should be triggered automatically when needed
- This follows the applesauce examples pattern for decryption
2025-10-02 10:14:16 +02:00
Gigi
82c63e5d18 revert: remove manual decryption approach
- Removed manual decryption implementation
- Back to using applesauce helpers directly
- The issue is likely that browser extension needs permission for decryption
- getHiddenBookmarks returns undefined because extension hasn't been triggered yet
- All linting passes
2025-10-02 10:11:13 +02:00
Gigi
b112520056 debug: enhance account signer debugging
- Added detailed logging for account signer capabilities
- Check if account has signer with decrypt method
- This will help identify if the ExtensionAccount has proper NIP-44 decryption capabilities
- Following applesauce examples pattern for signer usage
2025-10-02 10:06:37 +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
559e7ee944 fix: handle applesauce bookmark structure correctly
- Added processApplesauceBookmarks function to handle applesauce return format
- Fixed processing of {notes: [], articles: [], hashtags: [], urls: []} structure
- Added ApplesauceBookmarks interface for proper typing
- Now correctly processes all bookmark types from applesauce helpers
- Should now show all 13 bookmarks (12 notes + 1 article) instead of just 1
- All linting and type checking passes
2025-10-02 09:46:04 +02:00