- Migrated Kind 0 profile metadata storage to unified `profileCache.js` with partitioning and persistence.
- Added `defaultDTag` for hashtag preferences in `cachePolicies.js` to ensure consistent key resolution.
- Updated `hashtagPreferencesService.js` to use `profileCache` and implemented legacy data migration.
- Added `handleEvent` to `NostrClient` to centrally ingest Kind 0 events into the cache.
- Updated `authService.js` and `cache.js` to delegate profile operations to the unified cache system.
- Added `PROFILE_METADATA` schema to `nostrEventSchemas.js`.
I modified `js/channelProfile.js` to implement the logic that toggles the "Send" button to "Done" and closes the dialog when clicked. Additionally, I updated `js/ui/zapController.js` to prevent the form from resetting entirely on success, which preserves receipts; instead, it now manually clears the comment and sets the completed state.
These changes ensure consistent "Done" button behavior across both the Channel Profile and Video Modal zap interfaces. I also included minor `package.json` updates for linting dependencies.
This change removes a verbose log message that was cluttering the console output during trusted mute event ingestion. The removal of this log line does not affect any functionality.
Scanned the repository for TODO/FIXME/XXX comments and identified non-trivial items related to tag preference filtering. Since no trivial fixes were found, I have documented the findings in `artifacts/todos.txt` and created a tracking issue document `artifacts/todo_issues.md` outlining the necessary architectural changes in the feed engine.
This work prepares the ground for moving preference-aware filtering from the view layer to the feed engine pipeline.
- Update `cachePolicies.js` to include `defaultDTag` for watch history.
- Update `profileCache.js` to resolve policies dynamically via `SECTION_TO_NOTE_TYPE`.
- Implement `resolveAddressKey` in `profileCache.js` for canonical key generation.
- Implement TTL expiration logic in `profileCache.js`.
- Update `watchHistory.js` to use `NOTE_TYPES.WATCH_HISTORY` for storage operations.
- Add `isSessionActor` helper to `js/nostr/sessionActor.js` to identify ephemeral keys.
- Update `js/nostr/viewEvents.js` to namespace view deduplication caches by `actorPubkey` to prevent data leakage between sessions.
- Block comment publishing for session actors in `js/nostr/commentEvents.js`.
- Block watch history list publishing for session actors in `js/nostr/client.js`.
- Block user block list publishing for session actors in `js/userBlocks.js`.
- Block hashtag preference publishing for session actors in `js/services/hashtagPreferencesService.js`.
- Add inline documentation clarifying variable sources.
- Added `js/utils/lruCache.js` with hit/miss tracking.
- Updated `js/nostr/cachePolicies.js` to set 5-minute TTL for comments/reactions.
- Integrated caching and incremental fetching in `js/nostr/commentEvents.js`.
- Implemented `listVideoReactions` in `js/nostr/reactionEvents.js` with caching logic.
- Updated `profileCache.js` to support clearing runtime memory on signer change.
- Updated `NostrClient` to trigger `clearSignerRuntime` on `setActiveSigner`.
- Updated list services (`subscriptions`, `userBlocks`, `hashtagPreferences`, `watchHistory`) to listen for `runtimeCleared` and reload data.
- Updated `NostrClient` sync metadata methods to default to the active profile pubkey.
- Added `partition-updated` event emission to `profileCache`.
Implements a `SyncMetadataStore` to persist last-seen timestamps for replaceable lists (Kind 10000, 30000, 30002, 30015).
Adds `fetchListIncrementally` helper to `NostrClient` which performs per-relay `since` queries.
Updates `SubscriptionsManager`, `UserBlockListManager`, `HashtagPreferencesService`, and `adminListStore` to utilize incremental fetching.
Prevents local cache wipes when incremental fetches return empty results (indicating "no updates").
Added `scripts/agent/smoke-test.mjs` to verify key application flows in a headless environment.
Features:
- Verifies Relay Connection
- Verifies NSEC Login (Ephemeral)
- Verifies Video Publishing (Sign & Send)
- Verifies Event Retrieval
- Verifies DM Encryption/Decryption
Usage:
```bash
npm install
node scripts/agent/smoke-test.mjs
```
Artifacts (logs/reports) are generated in `artifacts/` and are ignored by git.
Utilizes `scripts/agent/simple-relay.mjs` for a local relay.
Uses `jsdom` to polyfill browser environment for `NostrClient`.
- Replaced `w-full` with `w-56 max-w-full` in `.watch-history-card__thumbnail` class.
- This ensures thumbnails are constrained to ~224px (14rem) on all viewports, fixing the "bleeding" issue on mobile while maintaining the desktop layout.
- The `max-w-full` ensures safety on very narrow screens.
- Updated CSS for `.watch-history-card` to use `flex-col` on mobile for stacked layout, switching to `sm:flex-row` on larger screens.
- Added `w-full` to `.watch-history-card__thumbnail` on mobile to constrain image width.
- Fixed a bug in `js/nostr/watchHistory.js` where `computeWatchHistoryFingerprintForItems` was sorting the live history array in-place by ID, causing the UI to display an incorrect (non-chronological) order. The fix involves creating a shallow copy before sorting.
- Updated `tests/nostr/watchHistory.test.js` to verify behavior against the current storage version (`v5`).
- Updated `js/searchView.js` to augment NIP-50 relay search with a local scan of cached profiles.
- `performProfileSearch` now iterates `nostrClient.activeMap` (locally cached videos) to find unique authors.
- It retrieves profile metadata using `app.getProfileCacheEntry(pubkey)`.
- It matches queries against `name`, `about`, `nip05`, and `lightningAddress`.
- Local results are merged with relay results, ensuring robust search functionality even if relay connections are unstable.
- Preserved existing NIP-50 relay search logic.
- Modified `js/index.js` to handle search queries, detecting npubs for direct navigation.
- Added `views/search.html` and `js/searchView.js` to implement search UI and logic.
- Implemented dual-search strategy:
- Profile search using NIP-50 on Kind 0.
- Video search using NIP-50 on Kind 30078 and local cache search (robustness).
- Registered new search view in `js/viewManager.js`.
- Verified with Playwright tests.
- Updated `js/index.js` to handle search input:
- Redirects valid npubs to the channel profile.
- Redirects other queries to the new search view.
- Created `views/search.html` to display search results.
- Created `js/searchView.js` to perform NIP-50 searches for profiles (Kind 0) and videos (Kind 30078).
- Includes specific handling for hashtag searches (using `#t` filter).
- Updated `js/viewManager.js` to register the new search view.
- Updated `Nip46RpcClient` in `js/nostr/nip46Client.js` to implement `nip04Encrypt`, `nip04Decrypt`, `nip44Encrypt`, and `nip44Decrypt` methods by calling the respective RPC methods on the remote signer.
- Exposed these encryption methods in the `activeSignerCache` object returned by `getActiveSigner()`.
- This ensures that functions relying on encryption (like `StorageService` unlocking and DM decryption) work correctly when logged in via NIP-46.
- Updated `EventDetailsModal` to handle cases where fetching the raw event fails or returns null.
- Implemented `getRawEvent` logic to reconstruct the `content` JSON string from available video metadata (title, thumbnail, description, etc.) if the raw content is missing.
- Ensures the user can inspect key metadata (like thumbnail URLs) even when the original signed event payload is not available in memory or via network fetch.
- Explicitly marks the signature as "unavailable (cached)" in fallback scenarios.
- Simplified `components/login-modal.html` to center the QR code and use a "Copy Link" button instead of a large textarea.
- Updated `js/ui/loginModalController.js` to support the new DOM structure and error handling.
- Added `docs/nip46-roadmap.md` to document current state and future features.
- Fixed `NostrClient.destroy()` usage (synchronous void method) in `js/nostr/client.js`.
- Relaxed NIP-46 `connect` response validation in `js/nostr/client.js` and `js/nostr/nip46Client.js` to accept "ack" (case-insensitive) as a valid success signal, preventing timeouts with signers that do not echo the secret.
- Updated `EventDetailsModal` to handle cases where fetching the raw event fails or returns null.
- Implemented `getRawEvent` logic to reconstruct the `content` JSON string from available video metadata (title, thumbnail, description, etc.) if the raw content is missing.
- Ensures the user can inspect key metadata (like thumbnail URLs) even when the original signed event payload is not available in memory or via network fetch.
- Explicitly marks the signature as "unavailable (cached)" in fallback scenarios.