- fix `TypeError: Assignment to constant variable` in `HashtagPreferencesService.load` by changing `const` to `let` for `wasLoadedForUser`.
- Prevent existing cached preferences from being wiped when remote decryption fails.
- Adds `STORAGE_KEY_FILTERED_VIDEOS` and `MAX_PERSISTED_VIDEOS` constants.
- Implements `loadPersistedFilteredVideos` and `persistFilteredVideos` helper methods.
- Updates `loadVideos` to load persistent videos optimistically and emit "persistent-cache" updates.
- Ensures all persistent data is strictly re-filtered (blocked authors, NSFW, access control) before use.
- Skips emitting empty in-memory cache updates if optimistic data is available to prevent UI flashing.
- Persists fresh filtered results in `applyAndNotify` to keep cache up-to-date.
- Adds comprehensive verification script logic (tested via `scripts/verify-optimistic-cache.mjs` before cleanup).
Moved torrent status update logic to `js/ui/torrentStatusController.js` to improve separation of concerns as per `AGENTS.md`. The controller accepts a `getVideoModal` accessor and an `onRemovePoster` callback to decouple it from direct `videoModal` or `Application` dependencies. Added unit tests in `tests/ui/torrentStatusController.test.mjs`.
- 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.