PROTOCOL FOUR// field manual
FieldField Manual
SystemsSystems
AssetsAssets
Field Manual/World
05 / 14

World

Where the other agents live

CommunitySearchConvex Search Index

Overview

Searching is the primary action. The text input lives inline at the top — type two characters and we fire two live Convex search index queries in parallel — one for clubs, one for agents. The total agent count appears as a watermark on the right when the search is empty, so you can feel the size of the network. The 'Take a break' utility lives here too — same sheet as on Missions. Below that, YOUR CLUBS as a horizontal scroll of joined clubs, and DISCOVER as a full vertical list of curated clubs the agent hasn't joined. At the bottom, a Tell Us prompt opens the feedback sheet for club requests.

How it works

1

Search uses a 200ms `useDebounced` hook to throttle keystrokes, and only fires when the query is ≥2 chars. Both query hooks pass `'skip'` when empty so we don't spam the backend on every focus.

2

`clubs.list` returns two arrays — `joined` and `discover` — computed server-side so the client doesn't have to know membership state to filter.

3

Each `ClubCard` in DISCOVER pulls a preview stack of agent avatars from the club's `previewAgentCodes` array. These can be real or synthetic agents — the avatar component renders either identically. This is how a brand-new club feels populated.

4

Tapping a club routes to `/club/[slug]`. Tapping an agent search result routes to `/agent-profile?userId=...`. Both dismiss the keyboard first.

5

The 'X AGENTS' counter on the right of the search bar pulls `users.totalCount` — a cheap aggregate that updates as the network grows.

6

The feedback CTA at the bottom opens a FeedbackSheet so we have a backlog of clubs to add.

Key decisions

Search as the primary surface, not a tab

We considered tucking search behind an icon. But the World tab's job is discovery, and discovery needs a typing surface in the user's hand within one tap. Putting the search inline forces us to design the empty state too — which is now the agent count + your joined clubs.

Synthetic agents in preview stacks

When a club has 3 real members, its avatar stack looks empty. We seed each club with deterministic synthetic agent codes that render identically to real ones — so even cold-start clubs feel alive. As real joins accumulate, the preview rotates them in.

Convex search index over client filtering

It would have been easier to pull all clubs and filter in JS. But the search needs to work across all 676k future agents, and Convex's typed search index gives us prefix + token matching at server speed. It's one line per index.

World

Quick Reference

Routeapp/(app)/(tabs)/world.tsx
StoreConvex queries
APIsclubs.list, clubs.search, users.search, users.totalCount, minerals.getBalances
Components
ClubCardJoinedClubTileAvatarAvatarStackBreakSheetFeedbackSheet
PreviousMissionsNextYou