0.2.69 - Homepage loading improvements pass

This commit is contained in:
ponzischeme89
2026-08-16 21:20:55 +12:00
parent b9374baaf1
commit 845fa349e4
23 changed files with 663 additions and 262 deletions
+2 -6
View File
@@ -6,7 +6,6 @@ import { NotificationBell } from './NotificationBell';
import { nav } from '../nav';
import { useNotifications } from '../lib/notifications';
import { useGateway } from '../lib/gateway';
import { time } from '../lib/format';
import { Confirm } from './ui';
/* The shell: a top bar spanning the width, a rail down the left, and the page.
@@ -133,7 +132,7 @@ function Rail({ open, onNavigate }: { open: boolean; onNavigate: () => void }) {
}
export function Layout() {
const { version, currentUser, online, checkedAt, loading, status, setMaintenance } = useGateway();
const { version, currentUser, online, loading, status, setMaintenance } = useGateway();
const [railOpen, setRailOpen] = useState(false);
const [accountOpen, setAccountOpen] = useState(false);
const [changingAvailability, setChangingAvailability] = useState(false);
@@ -143,7 +142,6 @@ export function Layout() {
const account = useRef<HTMLDivElement>(null);
const initial = Array.from(currentUser.trim())[0]?.toLocaleUpperCase('en-NZ') || 'A';
const statusTone = status && online && !offline ? 'ok' : status || !loading ? 'bad' : 'checking';
const statusLabel = offline ? 'offline' : status && online ? 'online' : loading ? 'checking' : 'not responding';
const toggleAvailability = async () => {
if (changingAvailability || !status) return;
@@ -234,9 +232,7 @@ export function Layout() {
aria-label={offline ? 'Memby is offline. Bring it online' : status && online ? 'Memby is online. Take it offline' : loading ? 'Checking Memby status' : 'Memby is not responding'}
onClick={() => offline ? void toggleAvailability() : setConfirmingOffline(true)}
>
<span className="dot" />
<b>{statusLabel}</b>
<span>{offline ? 'click to bring back online' : checkedAt ? `updated ${time(checkedAt)}` : ''}</span>
<span className="dot" aria-hidden="true" />
</button>
<NotificationBell />
<div className="account-menu" data-open={accountOpen || undefined} ref={account}>
+1 -1
View File
@@ -74,7 +74,7 @@ export function OmniSearch() {
.filter((entry) => entry.rank > 0)
.sort((a, b) => b.rank - a.rank || a.index - b.index)
.map(({ item, rank }) => ({ item, rank }));
}, [query]);
}, [query, status]);
// Something is always selected, so Enter has an answer without an arrow press first.
useEffect(() => setCursor(0), [query]);