@@ -17,7 +17,6 @@ import {
1717 RoomPanelHeader ,
1818 RoomListContainer ,
1919 RoomItemStyled ,
20- SearchResultBadge ,
2120 LlmRoomBadge ,
2221 OnlinePresenceSection ,
2322 OnlinePresenceLabel ,
@@ -48,7 +47,6 @@ export const RoomPanel = React.memo((props: RoomPanelProps) => {
4847 onlineUsers,
4948 sidebarStyle,
5049 onRoomSwitch,
51- onRoomJoin,
5250 onRoomLeave,
5351 onInviteAccept,
5452 onInviteDecline,
@@ -81,7 +79,7 @@ export const RoomPanel = React.memo((props: RoomPanelProps) => {
8179 setIsSearchMode ( true ) ;
8280 const lower = q . toLowerCase ( ) ;
8381 setSearchResults (
84- rooms . filter ( ( r ) => r . type === "public" && r . name . toLowerCase ( ) . includes ( lower ) ) ,
82+ rooms . filter ( ( r ) => r . name . toLowerCase ( ) . includes ( lower ) ) ,
8583 ) ;
8684 } ;
8785
@@ -91,11 +89,6 @@ export const RoomPanel = React.memo((props: RoomPanelProps) => {
9189 setSearchResults ( [ ] ) ;
9290 } ;
9391
94- const handleJoinAndClear = ( roomId : string ) => {
95- onRoomJoin ( roomId ) ;
96- clearSearch ( ) ;
97- } ;
98-
9992 const roomListItems = isSearchMode ? searchResults : rooms ;
10093
10194 const publicRooms = roomListItems . filter ( ( r ) => r . type === "public" ) ;
@@ -112,13 +105,14 @@ export const RoomPanel = React.memo((props: RoomPanelProps) => {
112105 $active = { isActive }
113106 $sidebarStyle = { sidebarStyle }
114107 onClick = { ( ) => {
115- if ( isSearch ) {
116- handleJoinAndClear ( room . id ) ;
117- } else if ( ! isActive ) {
108+ if ( ! isActive ) {
118109 onRoomSwitch ( room . id ) ;
119110 }
111+ if ( isSearch ) {
112+ clearSearch ( ) ;
113+ }
120114 } }
121- title = { isSearch ? trans ( "chatBox.joinRoomTitle" , { roomName : room . name } ) : room . name }
115+ title = { room . name }
122116 >
123117 { room . type === "llm" ? (
124118 < RobotOutlined
@@ -154,7 +148,6 @@ export const RoomPanel = React.memo((props: RoomPanelProps) => {
154148 { trans ( "chatBox.aiShortLabel" ) }
155149 </ LlmRoomBadge >
156150 ) }
157- { isSearch && < SearchResultBadge > { trans ( "chatBox.joinAction" ) } </ SearchResultBadge > }
158151 { isActive && ! isSearch && (
159152 < Popconfirm
160153 title = { trans ( "chatBox.leaveRoomConfirm" , { roomName : room . name } ) }
@@ -209,7 +202,7 @@ export const RoomPanel = React.memo((props: RoomPanelProps) => {
209202 < div style = { { padding : "8px 8px 0" } } >
210203 < Input
211204 size = "small"
212- placeholder = { trans ( "chatBox.searchPublicRoomsPlaceholder " ) }
205+ placeholder = { trans ( "chatBox.searchPlaceholder " ) }
213206 prefix = { < SearchOutlined style = { { color : "#aaa" } } /> }
214207 value = { searchQuery }
215208 onChange = { ( e ) => handleSearch ( e . target . value ) }
@@ -228,7 +221,7 @@ export const RoomPanel = React.memo((props: RoomPanelProps) => {
228221 : "chatBox.searchResultsCountPlural" ,
229222 { count : searchResults . length } ,
230223 )
231- : trans ( "chatBox.noPublicRoomsMatch " , { searchQuery } ) }
224+ : trans ( "chatBox.noRoomsMatch " , { searchQuery } ) }
232225 < Button
233226 type = "link"
234227 size = "small"
0 commit comments