# Ticket 5.6 — Session Sharing

**Phase**: 5 — OpenCode-Specific Features
**Priority**: Low
**Depends on**: 2.3

## Description

Allow users to share a session as a read-only link. OpenCode provides a `POST /session/:id/share` endpoint that generates a shareable URL.

## Acceptance Criteria

### AC1: Share button on sessions

```gherkin
Given an active session
When the user clicks the "Share" button in the session header
Then it calls POST /session/:id/share
And returns a shareable URL
And the URL is copied to the clipboard
And a toast notification confirms: "Share link copied"
```

### AC2: Shared session is read-only

```gherkin
Given a shared session URL
When someone opens it
Then they can read the full conversation
And they cannot send messages or approve permissions
And the input field is hidden or disabled
```

### AC3: Share status indicator

```gherkin
Given a session has been shared
When the session list renders
Then the shared session shows a 🔗 icon
And the share URL is accessible from the session menu
```

## Testable Components

| Component | Test Type | What to Assert |
|-----------|-----------|----------------|
| Share API call | Unit | Constructs correct POST to /session/:id/share |
| Share button | E2E | Share button visible on session, triggers API call |
| Clipboard copy | E2E | URL copied to clipboard, toast confirmation shown |
| Share indicator | E2E | Shared sessions show share icon in session list |

## Reference

- OpenCode share: `POST /session/:id/share`
- OpenCode session.share field in session model
