Skip to content

Search Bar Enhancement: wire message content search - #3445

Open
Kaveh-Vakili wants to merge 29 commits into
devfrom
Search-Bar-Enhancement
Open

Search Bar Enhancement: wire message content search#3445
Kaveh-Vakili wants to merge 29 commits into
devfrom
Search-Bar-Enhancement

Conversation

@Kaveh-Vakili

@Kaveh-Vakili Kaveh-Vakili commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Goes with SEMOSS/Semoss#2764

Description

Formulated a more robust solution for the playground search bar that is able to search for content within different rooms.

Changes Made

  • global-nav.tsx: fire SearchRoomMessages when searching, merge content-match rooms into bucketed list, fix empty-state check to use mergedRooms so content matches are not hidden
  • chats-page.tsx: same SearchRoomMessages useEffect pattern, merge content-match-only rooms into visibleRooms

How to Test

  1. Create multiple different rooms with conversations
  2. With the Playground All Chats search bar, search for content within those rooms

Notes

…ats page

- global-nav.tsx: fire SearchRoomMessages when searching, merge
  content-match rooms into bucketed list, fix empty-state check
  to use mergedRooms so content matches are not hidden
- chats-page.tsx: same SearchRoomMessages useEffect pattern,
  merge content-match-only rooms into visibleRooms
@snyk-io

snyk-io Bot commented Jul 17, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

}));
},
{ limit: 50 },
[debouncedSearch, chat.keys.roomCounter],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should call refresh()/reset() directly on roomCounter change, like getRooms already does, instead of just adding it to useIteratorPixel's deps array

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^^

@Kaveh-Vakili
Kaveh-Vakili marked this pull request as ready for review July 30, 2026 18:47
@Kaveh-Vakili
Kaveh-Vakili requested a review from a team as a code owner July 30, 2026 18:47
@Kaveh-Vakili Kaveh-Vakili changed the title Search Bar Enhancement: wire message content search to sidebar and ch… Search Bar Enhancement: wire message content search Jul 30, 2026
@kunal0137

kunal0137 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Confirmed locally: pagination is applied to matching messages, but the UI displays matching rooms.
For example, assume Room A contains 50 separate messages containing “spain,” while Room B contains one message containing “spain.” With limit=50, the backend can return all 50 rows from Room A. The UI then deduplicates those rows and displays only Room A, so Room B is incorrectly missing.
In my local data, “spain” matched 136 messages across 44 rooms. The first 50 message rows represented only 18 rooms, leaving 26 valid matching rooms out of the results.
The backend should reduce the results to one row per room before applying limit and offset. When testing, ensure the room name does not contain the search term; otherwise the separate room-name search masks this issue.

additionally infinite or additonal scroll doesnt work after.

tevanburen and others added 6 commits August 7, 2026 10:09
…moss-ui into Search-Bar-Enhancement

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Comment thread packages/playground/src/pages/chats-page.tsx Outdated
Comment thread packages/playground/src/pages/chats-page.tsx Outdated
}));
},
{ limit: 50 },
[debouncedSearch, chat.keys.roomCounter],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

>(
(limit, offset) =>
debouncedSearch
? `META | SearchRoomMessages(search=["<encode>${debouncedSearch}</encode>"], project=["${SYSTEM__PLAYGROUND}"], limit=[${limit}], offset=[${offset}], includeMessageText=[false]);`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use JSON.stringify for these params? like search=${JSON.stringify(debouncedSearch)}

}));
},
{ limit: 50 },
[debouncedSearch, chat.keys.roomCounter],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^^

@tevanburen

Copy link
Copy Markdown
Contributor

Kaveh are you seeing my comments about we should call refresh()/reset() directly on roomCounter change, like getRooms already does, instead of just adding it to useIteratorPixel's deps array

@Kaveh-Vakili

Copy link
Copy Markdown
Contributor Author

should be good now. just saw this one

@tevanburen

Copy link
Copy Markdown
Contributor

Pushed a commit fixing the chats-page loading flash (spinner/no-chats flashing on every reload). Root cause was in the shared useIteratorPixel hook - it clears data on every dependency change, unlike useIteratorApi which deliberately doesn't. Fixed that plus reworked chats-page's loading state to dim in place instead of clearing.

Made the fix directly rather than flagging it - it's existing dev behavior, not something from this PR.

@tevanburen
tevanburen requested a review from kzsb03 August 14, 2026 13:05
@tevanburen

Copy link
Copy Markdown
Contributor

FE looks good to me, BE still has a comment outstanding (BE PR needs to be merged first)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants