# Global search — handoff

## Summary

Quick global search modal for jumping to rooms, users, and recent conversations. Distinct from full message search — optimized for navigation, not event content search.

## User-facing behavior

- Keyboard shortcut / sidebar tab opens search modal
- Type to filter rooms and users
- Select result to navigate

## Architecture

```
SearchModalRenderer (in Router.tsx)
  → features/search/Search.tsx
  → searchModal.ts atom for open state
useAsyncSearch or similar for filtering
```

## Key files

| Path | Role |
|------|------|
| `cinny/src/app/features/search/Search.tsx` | Modal UI |
| `cinny/src/app/state/searchModal.ts` | Open/close state |
| `cinny/src/app/pages/client/sidebar/SearchTab.tsx` | Sidebar entry |

## Data model

| Key | Storage |
|-----|---------|
| `searchModal` atom | memory |

## Dependencies

- Local room list + user index from sync

## Integration points

- **routing-and-navigation**: `SearchModalRenderer` in router
- **home-and-sidebar**: SearchTab
- **message-search**: different feature — don't merge UIs

## Testing

### Manual

1. Open search modal from sidebar.
2. Filter rooms by name.
3. Select room; navigates and modal closes.

### Automated

- None

## Known issues & gotchas

- Two "search" features confuse users — message search vs global nav search
- Modal focus trap via folds Overlay patterns

## Future work

- Unify search entry points with tabs (rooms / messages / users)
- Recent searches persistence

## Related docs

- [message-search HANDOFF](../message-search/HANDOFF.md)
- [routing-and-navigation HANDOFF](../routing-and-navigation/HANDOFF.md)

## Add your extra things here

- `SearchModalRenderer` mounted at client root level in Router.tsx
