feat: add space search to recent activity page (#59) #119
Reference in New Issue
Block a user
Delete Branch "junaiddshaukat/flotilla:feature/59-space-search"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a search bar to the recent activity page that searches across all content within the current space.
What it does:
/spaces/[relay]/recent)createSearchfrom Welshman (fuse.js fuzzy matching)Implementation notes:
createSearchpattern from@welshman/app(same asSpaceSearchandspaces/+page.svelte)AGENTS.mdChecks:
pnpm run format— passpnpm run lint— passpnpm run check— 0 errors, 0 warningsCloses #59
@hodlbod please have a look at this PR when you got time.
@@ -91,0 +104,4 @@getValue: (event: TrustedEvent) => event.id,fuseOptions: {keys: ["content", "tags.1"]},}),)Let's switch to pure NIP 50 search, I think we need to move away from storing so many events in memory.
@@ -116,0 +176,4 @@{/each}{:else if term && searchResults.length === 0}<p class="flex flex-col items-center py-20 text-center">No results found.</p>{:else if filteredActivity.length === 0}Take a look at how the room search works — we should add a search icon to the PageBar which shows the same kind of popover/dialog when clicked.
I have addressed both comments:
@@ -94,0 +179,4 @@if (searchId === currentSearchId) {searchResults = sortEventsDesc(uniqBy((e: TrustedEvent) => e.id, events))}searchId/currentSearchId are redundant with AbortController, they can be removed
@hodlbod I have removed searchId/currentSearchId — AbortController already handles stale request cancellation.