diff --git a/web/components/Header.tsx b/web/components/Header.tsx
index db0acbb..e67352b 100644
--- a/web/components/Header.tsx
+++ b/web/components/Header.tsx
@@ -11,7 +11,7 @@ import { Logo } from "./Logo";
import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { cn } from "@/lib/utils";
-import { openCommandPalette } from "@/components/discovery/DiscoveryCommand";
+import { openCommandPalette, openCalendar } from "@/components/discovery/DiscoveryCommand";
const NAV = [
{ href: "/discover", label: "Discover", icon: "ic:round-explore" },
@@ -80,20 +80,37 @@ export function Header({
- {/* Center: search bar — absolutely centered (lg+). The wrapper ignores
- pointer events so it never blocks the left/right clusters; only the
- button itself is interactive. */}
+ {/* Center: search bar + calendar — absolutely centered (lg+). The wrapper
+ ignores pointer events so it never blocks the left/right clusters;
+ only the buttons themselves are interactive. The calendar sits to the
+ right of the search bar and opens the app-level calendar dialog. */}
-
+
+
+
+
+
+
+ Calendar
+
+
{/* Right: actions */}
diff --git a/web/components/discovery/DiscoveryCommand.tsx b/web/components/discovery/DiscoveryCommand.tsx
index 2208a0a..e8b453e 100644
--- a/web/components/discovery/DiscoveryCommand.tsx
+++ b/web/components/discovery/DiscoveryCommand.tsx
@@ -1,6 +1,6 @@
"use client";
-import { useCallback, useEffect, useState } from "react";
+import { useEffect, useState } from "react";
import { useRouter } from "next/navigation";
import { useDiscoverEvents } from "@/lib/events";
import { useKeyboardShortcuts } from "@/lib/useKeyboardShortcuts";
@@ -8,15 +8,23 @@ import { CommandPalette } from "./CommandPalette";
import { CalendarViewDialog } from "./CalendarViewDialog";
import { ShortcutsHelpDialog } from "./ShortcutsHelpDialog";
-/** Custom DOM event other components dispatch to open the palette (Header button,
- * mobile search affordance) without prop drilling through the layout. */
+/** Custom DOM events other components dispatch to open the palette / calendar
+ * (Header buttons, mobile search affordance) without prop drilling through the
+ * layout. The calendar dialog lives here in the island, so the global Header
+ * opens it via this event rather than owning its own state. */
export const OPEN_COMMAND_EVENT = "hostit:open-command";
+export const OPEN_CALENDAR_EVENT = "hostit:open-calendar";
/** Dispatch from anywhere (e.g. the Header Cmd+K button) to open the palette. */
export function openCommandPalette() {
if (typeof window !== "undefined") window.dispatchEvent(new Event(OPEN_COMMAND_EVENT));
}
+/** Dispatch from anywhere (e.g. the Header Calendar button) to open the calendar. */
+export function openCalendar() {
+ if (typeof window !== "undefined") window.dispatchEvent(new Event(OPEN_CALENDAR_EVENT));
+}
+
/**
* App-level discovery command island: mounts the Cmd+K command palette, the
* calendar dialog, the shortcuts help, and the global keyboard-shortcut listener
@@ -32,24 +40,20 @@ export function DiscoveryCommand() {
const [helpOpen, setHelpOpen] = useState(false);
useEffect(() => {
- const open = () => setPaletteOpen(true);
- window.addEventListener(OPEN_COMMAND_EVENT, open);
- return () => window.removeEventListener(OPEN_COMMAND_EVENT, open);
+ const openCmd = () => setPaletteOpen(true);
+ const openCal = () => setCalendarOpen(true);
+ window.addEventListener(OPEN_COMMAND_EVENT, openCmd);
+ window.addEventListener(OPEN_CALENDAR_EVENT, openCal);
+ return () => {
+ window.removeEventListener(OPEN_COMMAND_EVENT, openCmd);
+ window.removeEventListener(OPEN_CALENDAR_EVENT, openCal);
+ };
}, []);
- const focusSearch = useCallback(() => {
- const el = document.getElementById("discover-search");
- if (el instanceof HTMLInputElement) {
- el.focus();
- el.select();
- } else {
- router.push("/discover");
- }
- }, [router]);
-
useKeyboardShortcuts({
onCommandPalette: () => setPaletteOpen((v) => !v),
- onFocusSearch: focusSearch,
+ // "/" — no inline search bar anymore, so open the command palette (search).
+ onFocusSearch: () => setPaletteOpen(true),
onGoDiscover: () => router.push("/discover"),
onGoTickets: () => router.push("/wallet"),
onGoDashboard: () => router.push("/dashboard"),
diff --git a/web/components/screens/DiscoverScreen.tsx b/web/components/screens/DiscoverScreen.tsx
index fc50b21..f12c88b 100644
--- a/web/components/screens/DiscoverScreen.tsx
+++ b/web/components/screens/DiscoverScreen.tsx
@@ -1,6 +1,6 @@
"use client";
-import { useCallback, useDeferredValue, useMemo, useState } from "react";
+import { useCallback, useMemo, useState } from "react";
import Link from "next/link";
import { useCurrentAccount } from "@/lib/hooks";
import { useEventList, useEventObjects, useActivityFeed, buildDiscoverEvents } from "@/lib/events";
@@ -14,11 +14,9 @@ import { TrendingRow } from "@/components/discovery/TrendingRow";
import { FeaturedCarousel } from "@/components/discovery/FeaturedCarousel";
import { RecentlyViewedRow } from "@/components/discovery/RecentlyViewedRow";
import { RecommendedRow } from "@/components/discovery/RecommendedRow";
-import { CalendarViewDialog } from "@/components/discovery/CalendarViewDialog";
import { openCommandPalette } from "@/components/discovery/DiscoveryCommand";
import { Card, CardContent } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
-import { Input } from "@/components/ui/input";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
export function DiscoverScreen() {
@@ -36,9 +34,7 @@ export function DiscoverScreen() {
const { mints } = useActivityFeed();
- const [q, setQ] = useState("");
const [cat, setCat] = useState("all");
- const [calendarOpen, setCalendarOpen] = useState(false);
// event_id -> searchable metadata (from Walrus metadata, fetched lazily by cards)
const [eventMeta, setEventMeta] = useState<
Record
@@ -61,31 +57,15 @@ export function DiscoverScreen() {
[],
);
- // Defer the heavy filter so typing stays responsive — the tracks `q`
- // immediately while the full-list filter recomputes off the deferred value.
- const deferredQ = useDeferredValue(q);
+ // Text search lives in the Cmd+K palette now; the page filters by category.
+ // Events with no category metadata yet are kept under any active category.
const filtered = useMemo(() => {
- const ql = deferredQ.trim().toLowerCase();
+ if (cat === "all") return events;
return events.filter((e) => {
const meta = eventMeta[e.eventId];
- const organizerName = names.get(e.organizer) ?? "";
- const searchable = [
- e.name,
- e.organizer,
- organizerName,
- meta?.category,
- meta?.city,
- meta?.venue,
- ]
- .filter(Boolean)
- .join(" ")
- .toLowerCase();
-
- if (ql && !searchable.includes(ql)) return false;
- if (cat !== "all" && meta?.category && meta.category !== cat) return false;
- return true;
+ return !meta?.category || meta.category === cat;
});
- }, [events, deferredQ, cat, eventMeta, names]);
+ }, [events, cat, eventMeta]);
// Flattened, on-chain-derived events for the curated discovery rows + calendar.
// Reuses the data already fetched here (list + objects + prices + lazy meta) —
@@ -95,9 +75,9 @@ export function DiscoverScreen() {
[events, eventObjects, pricesBySeq, eventMeta],
);
- // Curated rows only show in the default browse view (no active search/filter),
- // above the grid. Searching/filtering collapses straight to the grid.
- const browsing = q.trim() === "" && cat === "all";
+ // Curated rows only show in the default browse view (no active category
+ // filter), above the grid. Filtering by category collapses straight to the grid.
+ const browsing = cat === "all";
const showRows = browsing && !isLoading && !isError && events.length > 0;
return (
@@ -110,35 +90,17 @@ export function DiscoverScreen() {
-
-
- {/* Mobile palette affordance (Header Cmd+K button is desktop-only). */}
-
-
+ {/* Mobile search + commands — the header search/calendar is desktop-only
+ (md+). Opens the Cmd+K palette, which also has the calendar action. */}
+
No events found.
- Try a different search, or{" "}
+ Try a different category, or{" "}
host your own.
- Search covers the {events.length} most recent events — older ones aren't loaded yet.
+ Showing the {events.length} most recent events — older ones aren't loaded yet.
)}
>
)}
-
-
);
}
diff --git a/web/lib/suins.ts b/web/lib/suins.ts
index 555b972..814b458 100644
--- a/web/lib/suins.ts
+++ b/web/lib/suins.ts
@@ -4,11 +4,12 @@ import { useQuery } from "@tanstack/react-query";
import { getSuiNSClient, SUINS_NETWORK } from "./suinsClient";
/**
- * Reverse-look up a Sui address → its default/primary suiNS name, or null.
- * Resolves on the MAINNET suiNS client (see lib/suinsClient.ts) — names don't
- * exist on testnet. Returns null for an address with no default name (the common
- * case, not an error); genuine RPC failures surface as a query error (one retry)
- * so they aren't masked as "no name forever" — consumers fall back to hex.
+ * Reverse-look up a Sui address → its primary suiNS name, or null. Resolves on
+ * the app's active network (see lib/suinsClient.ts `SUINS_NETWORK`, testnet by
+ * default), so a testnet wallet's `.sui` name resolves. Returns null for an
+ * address with no name (the common case, not an error); genuine RPC failures
+ * surface as a query error (one retry) so they aren't masked as "no name
+ * forever" — consumers fall back to hex.
*/
export function useSuiNSName(address: string | null | undefined) {
const client = getSuiNSClient();
@@ -28,7 +29,8 @@ export function useSuiNSName(address: string | null | undefined) {
/**
* Forward-resolve a suiNS name → address (for search by name). Accepts a bare
- * label or a `.sui` name; resolves on mainnet. Returns null if unregistered.
+ * label or a `.sui` name; resolves on the app's active network. Returns null if
+ * unregistered.
*/
export function useResolveSuiNSAddress(name: string | null | undefined) {
const client = getSuiNSClient();
diff --git a/web/lib/suinsClient.ts b/web/lib/suinsClient.ts
index 3d0491a..4e7573b 100644
--- a/web/lib/suinsClient.ts
+++ b/web/lib/suinsClient.ts
@@ -1,13 +1,17 @@
-// suiNS names live on Sui **mainnet**, even though HostIt runs on testnet. The
-// app's dapp-kit client is the active (testnet) client, so resolving names there
-// always returned `[]` — the bug where a connected wallet's `.sui` name never
-// rendered. This is a dedicated read-only MAINNET client used ONLY for suiNS
-// reverse/forward resolution, independent of the app's active network.
+// suiNS resolution runs on the app's ACTIVE network (lib/config `NETWORK`,
+// testnet by default). suiNS is live on Sui testnet, so a testnet wallet's
+// `.sui` name resolves on the testnet fullnode — names resolve on the same
+// network the app and all its addresses live on. (Previously hard-coded to
+// mainnet on the false premise that "names don't exist on testnet", so every
+// lookup returned [] and no `.sui` name ever rendered — GH#113.) Dedicated
+// read-only client for reverse/forward resolution; names only resolve where a
+// name service exists (testnet/mainnet), not on localnet.
import { SuiJsonRpcClient, getJsonRpcFullnodeUrl } from "@mysten/sui/jsonRpc";
+import { NETWORK } from "./config";
/** The network suiNS names are resolved against (part of every cache key). */
-export const SUINS_NETWORK = "mainnet" as const;
+export const SUINS_NETWORK = NETWORK;
interface SuiNSResolver {
resolveNameServiceNames: (input: { address: string; limit?: number }) => Promise<{
@@ -19,7 +23,7 @@ interface SuiNSResolver {
let cached: SuiNSResolver | null = null;
-/** Singleton read-only mainnet client for suiNS resolution (lazy; never at module load). */
+/** Singleton read-only client for suiNS resolution on the app network (lazy; never at module load). */
export function getSuiNSClient(): SuiNSResolver {
if (!cached) {
cached = new SuiJsonRpcClient({
diff --git a/web/lib/verification.ts b/web/lib/verification.ts
index 8f456d9..8ae726a 100644
--- a/web/lib/verification.ts
+++ b/web/lib/verification.ts
@@ -7,8 +7,9 @@ import { getSuiNSClient, SUINS_NETWORK } from "./suinsClient";
* Batched suiNS reverse-lookup for many addresses at once. Each lookup is
* keyed individually in tanstack-query so the cache survives address-list
* changes (an additional address just fires one new query). Resolves on the
- * MAINNET suiNS client (names don't exist on testnet) — shares the same
- * network-scoped cache key as `useSuiNSName`, so single + batch lookups dedupe.
+ * app's active network (see `SUINS_NETWORK`, testnet by default), so testnet
+ * `.sui` names resolve — shares the same network-scoped cache key as
+ * `useSuiNSName`, so single + batch lookups dedupe.
*/
export function useSuiNSNames(addresses: string[]): Map {
const client = getSuiNSClient();