Better Chat
All checks were successful
Build and Release / build-and-release (push) Successful in 11m38s
All checks were successful
Build and Release / build-and-release (push) Successful in 11m38s
This commit is contained in:
@@ -38,6 +38,10 @@ const Chat = () => {
|
||||
const [showPinned, setShowPinned] = useState(false);
|
||||
const [mobileView, setMobileView] = useState('sidebar');
|
||||
|
||||
// Jump-to-message state (for search result clicks)
|
||||
const [jumpToMessageId, setJumpToMessageId] = useState(null);
|
||||
const clearJumpToMessage = useCallback(() => setJumpToMessageId(null), []);
|
||||
|
||||
// Search state
|
||||
const [searchQuery, setSearchQuery] = useState('');
|
||||
const [showSearchDropdown, setShowSearchDropdown] = useState(false);
|
||||
@@ -453,15 +457,7 @@ const Chat = () => {
|
||||
}
|
||||
setShowSearchResults(false);
|
||||
setSearchQuery('');
|
||||
// Give time for channel to render then scroll
|
||||
setTimeout(() => {
|
||||
const el = document.getElementById(`msg-${messageId}`);
|
||||
if (el) {
|
||||
el.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
el.classList.add('message-highlight');
|
||||
setTimeout(() => el.classList.remove('message-highlight'), 2000);
|
||||
}
|
||||
}, 300);
|
||||
setJumpToMessageId(messageId);
|
||||
}, [dmChannels]);
|
||||
|
||||
// Shared search props for ChatHeader
|
||||
@@ -540,6 +536,8 @@ const Chat = () => {
|
||||
onOpenDM={openDM}
|
||||
showPinned={showPinned}
|
||||
onTogglePinned={() => setShowPinned(false)}
|
||||
jumpToMessageId={jumpToMessageId}
|
||||
onClearJumpToMessage={clearJumpToMessage}
|
||||
/>
|
||||
<SearchPanel
|
||||
visible={showSearchResults}
|
||||
@@ -623,6 +621,8 @@ const Chat = () => {
|
||||
onOpenDM={openDM}
|
||||
showPinned={showPinned}
|
||||
onTogglePinned={() => setShowPinned(false)}
|
||||
jumpToMessageId={jumpToMessageId}
|
||||
onClearJumpToMessage={clearJumpToMessage}
|
||||
/>
|
||||
<MembersList
|
||||
channelId={activeChannel}
|
||||
|
||||
Reference in New Issue
Block a user