feat: add space search to recent activity page (#59) #119

Merged
hodlbod merged 5 commits from junaiddshaukat/flotilla:feature/59-space-search into dev 2026-04-03 16:58:35 +00:00
Contributor

Adds a search bar to the recent activity page that searches across all content within the current space.

What it does:

  • Adds a search input at the top of the recent activity page (/spaces/[relay]/recent)
  • Searches across messages, threads, classifieds, goals, and calendar events within the current space using createSearch from Welshman (fuse.js fuzzy matching)
  • When a search term is entered, the activity list is filtered to show only matching items
  • Individual matching events that aren't in the aggregated activity view are shown as clickable cards that navigate to the event
  • When the search field is empty, the normal recent activity view is displayed

Implementation notes:

  • Reuses the existing createSearch pattern from @welshman/app (same as SpaceSearch and spaces/+page.svelte)
  • Follows the project's import ordering, code style, and naming conventions per AGENTS.md
  • No new dependencies added

Checks:

  • pnpm run format — pass
  • pnpm run lint — pass
  • pnpm run check — 0 errors, 0 warnings

Closes #59

Adds a search bar to the recent activity page that searches across all content within the current space. **What it does:** - Adds a search input at the top of the recent activity page (`/spaces/[relay]/recent`) - Searches across messages, threads, classifieds, goals, and calendar events within the current space using `createSearch` from Welshman (fuse.js fuzzy matching) - When a search term is entered, the activity list is filtered to show only matching items - Individual matching events that aren't in the aggregated activity view are shown as clickable cards that navigate to the event - When the search field is empty, the normal recent activity view is displayed **Implementation notes:** - Reuses the existing `createSearch` pattern from `@welshman/app` (same as `SpaceSearch` and `spaces/+page.svelte`) - Follows the project's import ordering, code style, and naming conventions per `AGENTS.md` - No new dependencies added **Checks:** - `pnpm run format` — pass - `pnpm run lint` — pass - `pnpm run check` — 0 errors, 0 warnings Closes #59
junaiddshaukat added 1 commit 2026-04-02 18:22:17 +00:00
Add a search bar on the recent activity page that allows users to
search across all content within the current space — messages, threads,
classifieds, goals, and calendar events. Uses createSearch from Welshman
with fuse.js for client-side fuzzy matching. When the search field is
empty, the normal recent activity view is shown. Matching activity items
are filtered inline; individual event matches can be clicked to navigate.
junaiddshaukat added 1 commit 2026-04-02 18:22:30 +00:00
Author
Contributor

@hodlbod please have a look at this PR when you got time.

@hodlbod please have a look at this PR when you got time.
hodlbod requested changes 2026-04-02 18:26:53 +00:00
@@ -91,0 +104,4 @@
getValue: (event: TrustedEvent) => event.id,
fuseOptions: {keys: ["content", "tags.1"]},
}),
)
Owner

Let's switch to pure NIP 50 search, I think we need to move away from storing so many events in memory.

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}
Owner

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.

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.
hodlbod marked this conversation as resolved
junaiddshaukat added 1 commit 2026-04-02 22:17:13 +00:00
Address review feedback:
- Replace client-side fuse.js search with NIP-50 relay-side search
  using request from @welshman/net with debounced queries and
  AbortController for cancellation
- Move search from inline bar to a search icon in SpaceBar that
  opens a popover/dialog, matching the existing SpaceSearch pattern
- Search results grouped by age (24h, 7d, older) with timestamps
- Recent activity view remains untouched when search is closed
Author
Contributor

I have addressed both comments:

  • Switched to NIP-50 relay-side search using request from @welshman/net with debounced queries and AbortController
  • Moved search to a magnifier icon in the SpaceBar that opens a popover, matching the SpaceSearch UI pattern
I have addressed both comments: - Switched to NIP-50 relay-side search using request from @welshman/net with debounced queries and AbortController - Moved search to a magnifier icon in the SpaceBar that opens a popover, matching the SpaceSearch UI pattern
hodlbod reviewed 2026-04-02 22:25:19 +00:00
@@ -94,0 +179,4 @@
if (searchId === currentSearchId) {
searchResults = sortEventsDesc(uniqBy((e: TrustedEvent) => e.id, events))
}
Owner

searchId/currentSearchId are redundant with AbortController, they can be removed

searchId/currentSearchId are redundant with AbortController, they can be removed
junaiddshaukat added 1 commit 2026-04-03 07:24:22 +00:00
AbortController already handles cancellation of stale requests,
making the searchId/currentSearchId pattern unnecessary.
junaiddshaukat added 1 commit 2026-04-03 07:24:39 +00:00
Author
Contributor

@hodlbod I have removed searchId/currentSearchId — AbortController already handles stale request cancellation.

@hodlbod I have removed searchId/currentSearchId — AbortController already handles stale request cancellation.
hodlbod merged commit 4f3a2a1660 into dev 2026-04-03 16:58:35 +00:00
hodlbod deleted branch feature/59-space-search 2026-04-03 16:58:36 +00:00
Sign in to join this conversation.