added media fixes, search, push updates, pwa, metrics. preparing release 1.0
CI / Go (build + vet + test) (push) Canceled after 0s
CI / Web (build + lint) (push) Canceled after 0s

This commit is contained in:
vantablackTea
2026-09-27 23:26:15 +03:00
parent 855a62755c
commit 6fc6d977bf
59 changed files with 6823 additions and 113 deletions
+19
View File
@@ -2,7 +2,9 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import Sidebar from '../components/Sidebar'
import ChatWindow from '../components/ChatWindow'
import NewChatDialog from '../components/NewChatDialog'
import SearchDialog from '../components/SearchDialog'
import { api } from '../lib/api'
import { ensurePushSubscription } from '../lib/push'
import { useAuth } from '../auth/AuthContext'
import { useConversations } from '../hooks/useConversations'
import { useMessages } from '../hooks/useMessages'
@@ -21,6 +23,7 @@ export default function ChatApp({ user }: ChatAppProps) {
const [presence, setPresence] = useState<Record<number, boolean>>({})
const [typing, setTyping] = useState<Record<number, boolean>>({})
const [dialogOpen, setDialogOpen] = useState(false)
const [searchOpen, setSearchOpen] = useState(false)
const [focusTick, setFocusTick] = useState(0)
const [membersVersion, setMembersVersion] = useState(0)
@@ -78,6 +81,10 @@ export default function ChatApp({ user }: ChatAppProps) {
void loadContacts()
}, [loadContacts])
useEffect(() => {
void ensurePushSubscription()
}, [])
useEffect(() => {
const onFocus = () => setFocusTick((tick) => tick + 1)
window.addEventListener('focus', onFocus)
@@ -348,6 +355,7 @@ export default function ChatApp({ user }: ChatAppProps) {
typing={typing}
onSelect={handleSelect}
onNewChat={() => setDialogOpen(true)}
onSearch={() => setSearchOpen(true)}
onRetry={() => void reload()}
onLogout={() => void logout()}
/>
@@ -386,6 +394,17 @@ export default function ChatApp({ user }: ChatAppProps) {
onContactsChanged={() => void loadContacts()}
/>
)}
{searchOpen && (
<SearchDialog
onClose={() => setSearchOpen(false)}
onSelect={handleSelect}
conversations={conversations}
peers={peers}
directory={directory}
currentUser={user}
/>
)}
</div>
)
}