Audit found the search pipeline largely real (token parser, local + NIP-50 relay
search, enforced author/tag/date/has/nsfw/kind filters, wired modal) with dead
spots, now fixed:
- sort: offered in the modal but never applied. New pure sortSearchResults —
recent (default), views (shared view-count cache), trending (views weighted by
recency), longest — applied in searchView.
- duration filter only read nip71.duration, so bitvid's OWN kind-30078 videos
(top-level duration) never matched. Both video types now satisfy duration
filters; same shapes cover the planned live (30311) / shorts kinds.
- textScope now enforced in the local title/description match (all|title|description).
- relay: now scopes the video relay-search to that relay (was parsed-but-unused).
- FEATURE_SEARCH_FILTERS removed: dev-only flag consumed by NOTHING while the
filter UI ships and works everywhere (plumbing + setter deleted, no consumers).
Tests (tests/search-filters.test.mjs, 4 — surface previously had zero): parser
tokens; matcher enforces tags/date/has:magnet/duration for BOTH duration shapes;
views/longest/recent sorts (no input mutation); trending ranks fresh-riser above
stale-hit. Lint + build green.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Refactored `js/searchView.js` to use safe DOM APIs (`document.createElement`, `replaceChildren`, `textContent`) instead of `innerHTML`.
This reduces the attack surface for XSS vulnerabilities.
Updated `scripts/check-innerhtml.mjs` baseline.
Verified with unit tests and a frontend verification script.
Co-authored-by: PR0M3TH3AN <[email protected]>
Moves the sidebar density and toggle initialization logic in `js/index.js` to execute immediately after `loadSidebar` completes, rather than waiting for `applicationReadyPromise`. This resolves a race condition where the sidebar toggle was unresponsive during application startup (e.g. relay connection), causing `overlay-layers.spec.ts` to timeout.
Also updates the visual baseline for `video-modal-mobile` in `kitchen-sink.spec.ts` to match current rendering (height change), addressing the reported visual regression failure.
Verified with reproduction script and running visual tests locally.
- Added info buttons to Most Recent, Subscriptions, History, Channel Profile, Search, and Explore views
- Attached popovers with descriptions of feed filtration methods
- Used `attachFeedInfoPopover` helper for consistent implementation
- Verified with Playwright script (verified popover visibility and text content)
- Added a "Show More" button to `views/search.html`.
- Implemented responsive truncation logic in `css/tailwind.source.css` using `nth-child` selectors to show 5 items on mobile, 6 on desktop (LG), and 8 on large screens (XL).
- Updated `js/searchView.js` to handle the logic for displaying the button and toggling the limit class.
- Compiled CSS.
- 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.