<!-- source-hash: 52e6bfa6e916758ef4a95f83d0eb97da -->
Unified click-handler for chat-rendered navigation links. Centralizes the routing decision logic (same-tab vs. new-tab, embed vs. host, modifier-key pass-through) so callers like chip blocks, entity-card wrappers, and markdown anchor wrappers share a single implementation.

## Key Components

### `ChatNavClickInput`
Input interface describing the navigation target:
- `href` — destination URL (required)
- `path` — optional internal route path
- `targetPlatform` — optional platform hint for routing decisions

### `NavClickEvent`
Structural mouse-event interface (subset of `React.MouseEvent`) that keeps the handler callable from non-anchor surfaces without requiring a cast.

### `handleChatNavClick(e, runtime, input): boolean`
The core export. Processes a click event against a `ChatRuntime` and returns:
- `true` — handler took action and called `preventDefault()`
- `false` — modifier-click or non-primary button; browser default applies

**Routing rules in priority order:**
1. Empty `href` → `preventDefault` + no-op
2. Non-primary button or any modifier key (`meta`, `ctrl`, `shift`, `alt`) → pass through to browser
3. New-tab decision via `computeIsNewTab` → `runtime.navigation.openExternal` or `window.open`
4. Same-tab → `runtime.navigation.navigate?.()` → fallback to `window.location.assign`

## Usage Example

```typescript
import { handleChatNavClick } from './nav-click-handler'
import { useChatRuntime } from '../../../contexts/chat-runtime-context'

function NavChip({ href, path, targetPlatform }) {
  const runtime = useChatRuntime()

  return (
    <button
      onClick={(e) =>
        handleChatNavClick(e, runtime, { href, path, targetPlatform })
      }
    >
      {label}
    </button>
  )
}
```

> **Note:** Pass-through (`return false`) preserves native `<a>` semantics for modifier-clicks (e.g., Cmd+Click opens a new tab), so wrapping anchor elements still behave correctly without extra logic in the caller.