Better Chat
All checks were successful
Build and Release / build-and-release (push) Successful in 11m38s

This commit is contained in:
Bryan1029384756
2026-02-17 10:12:38 -06:00
parent 9162ca7c94
commit bebf0bf989
11 changed files with 1142 additions and 201 deletions

View File

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