Commit Graph
20 Commits
Author SHA1 Message Date
thePR0M3TH3ANandClaude Opus 4.8 a6a6d4b0f7 [search] Wire sort/textScope/relay:, fix dual-type duration, drop dead flag, first tests
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]>
2026-07-02 23:07:22 -04:00
google-labs-jules[bot]andPR0M3TH3AN df62585106 perf: enable lazy loading for avatars and thumbnails
Added `loading="lazy"` and `decoding="async"` attributes to dynamically created `<img>` elements in:
- `js/historyView.js` (avatars)
- `js/ui/subscriptionHistoryController.js` (channel icons)
- `js/searchView.js` (added `decoding="async"`)
- `js/ui/profileModal/ProfileDirectMessageRenderer.js` (attachment previews, avatars)
- `js/ui/profileModalController.js` (attachment previews, saved profile avatars)

This reduces initial page load impact and bandwidth usage by deferring off-screen image loading.

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-12 16:56:06 +00:00
google-labs-jules[bot]andPR0M3TH3AN fd9daef40b [security] Remove innerHTML usage from searchView.js
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]>
2026-02-12 03:41:34 +00:00
google-labs-jules[bot] 29afba2199 chore(ai): remove dead code (agent)
Removed unused `js/search/searchFacetState.js` and cleaned up broken calls in `js/searchView.js`.
2026-01-23 20:33:06 +00:00
thePR0M3TH3AN efcaf02e8c Add search filter unit tests 2026-01-23 13:48:54 -05:00
thePR0M3TH3AN 4a7b9dc602 Merge branch 'unstable' into jules-fix-sidebar-and-baseline-297374874061158968 2026-01-23 13:37:52 -05:00
thePR0M3TH3AN d378ee2be6 Add suggested facet counts to search filters 2026-01-23 13:35:00 -05:00
google-labs-jules[bot] a01814b962 fix(ui): initialize sidebar logic before app ready and update visual baseline
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.
2026-01-23 18:28:50 +00:00
thePR0M3TH3AN 19aa272bae Enhance search query parsing and filters 2026-01-23 13:13:40 -05:00
thePR0M3TH3AN 81513b338b Add search sort options and stable sorting 2026-01-23 12:58:12 -05:00
thePR0M3TH3AN e8a5da7ebe Update search relay filters 2026-01-23 12:31:34 -05:00
thePR0M3TH3AN 6c088161ba Update search filtering for video results 2026-01-23 12:14:03 -05:00
thePR0M3TH3AN 460ba22d51 Add search filter state syncing 2026-01-23 12:07:55 -05:00
thePR0M3TH3AN 40707e76af Add search filter parsing and hash persistence 2026-01-23 11:08:16 -05:00
thePR0M3TH3AN ce7b76bf1b Merge pull request #1478 from PR0M3TH3AN/feat/feed-info-popovers-17616740575820035536
Add Info Popovers to Feed Views
2026-01-21 16:02:34 -05:00
google-labs-jules[bot] ba28ceaf09 feat: add info popovers to feed views
- 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)
2026-01-21 20:59:11 +00:00
google-labs-jules[bot] 83ad3a1132 feat: limit channel search results with show more button
- 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.
2026-01-21 20:35:58 +00:00
google-labs-jules[bot] 52043a1872 feat: Implement local profile name search fallback
- 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.
2026-01-17 03:56:09 +00:00
google-labs-jules[bot] be5c39f6e8 Implement search functionality for profiles and videos
- 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.
2026-01-17 03:44:23 +00:00
google-labs-jules[bot] 2515ed9e8e Implement user and video search functionality
- 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.
2026-01-16 23:02:42 +00:00