<!-- source-hash: 7bb7ab52d16e8c26a26fa5ab1feba948 -->
A client-side `<a>` wrapper used within the chat tree to handle link navigation by reading the active `ChatRuntime` and routing clicks through the shared `handleChatNavClick` utility.

## Key Components

### `NavLinkAnchorViaRuntimeProps`
| Prop | Type | Description |
|------|------|-------------|
| `href` | `string` | Raw href to resolve |
| `path` | `string \| null` | Optional internal path hint |
| `targetPlatform` | `string \| null` | Platform target override |
| `className` | `string` | Optional CSS class |
| `children` | `ReactNode` | Optional child content |

### `NavLinkAnchorViaRuntime`
The main exported component. Orchestrates four responsibilities:
1. **Resolves `href`** via `resolveHrefForRuntime` (runtime-aware URL normalization)
2. **Decides new-tab vs. same-tab** via `computeIsNewTab` (embed-mode short-circuit → `runtime.navigation.decideNewTab` → lib fallback)
3. **Sets `target`/`rel`** attributes via `newTabAnchorAttrs`
4. **Closes the chat panel** on same-tab navigation via `ChatPanelContext.closeChat`

> **⚠️ Chat-tree only:** Uses `useRequiredChatRuntime`, which **throws** when mounted outside a `<ChatRuntimeContext.Provider>`. This is intentional — no silent fallback. For surfaces outside the chat tree (header chrome, marketing pages), use the hub's `useNavLink`-based anchor instead.

## Usage Example

```typescript
// Used in markdown-rendered chat bodies or source-chip drill-ins
<NavLinkAnchorViaRuntime
  href="https://example.com/docs/setup"
  path="/docs/setup"
  targetPlatform="web"
  className="chat-link"
>
  View Setup Guide
</NavLinkAnchorViaRuntime>
```

At runtime:
- **Same-tab click** → navigates and calls `panel.closeChat()` to dismiss the chat panel
- **New-tab click** → opens in a new tab, leaving the chat panel open