<!-- source-hash: 2cb028936365715865c9571d3df0261e -->
A reusable React component for managing a dynamic list of changelog entries, supporting add, remove, expand/collapse, and optional per-entry visibility toggling.

## Key Components

### `ChangelogManager` (default export)

A controlled list manager rendered as a collapsible accordion of `ChangelogEntry` items.

**Props (`ChangelogManagerProps`):**

| Prop | Type | Description |
|------|------|-------------|
| `title` | `string` | Section label displayed above the entry list |
| `entries` | `ChangelogEntry[]` | Controlled array of changelog entries |
| `onChange` | `(entries: ChangelogEntry[]) => void` | Callback fired on any mutation |
| `className` | `string?` | Optional wrapper class override |
| `expandAll` | `boolean?` | When `true`, expands all items (e.g. post-AI enrichment) |
| `showVisibilityToggle` | `boolean?` | Renders a per-entry `Eye`/`EyeOff` toggle; used by investor updates |

**Internal state:**
- `expandedIndices` — `Set<number>` tracking which accordion items are open

**Key functions:**

| Function | Behavior |
|----------|----------|
| `addEntry()` | Appends a blank entry and auto-expands it |
| `removeEntry(index)` | Removes entry and adjusts the expanded indices set |
| `updateEntry(index, field, value)` | Immutably updates a single field on an entry |
| `toggleExpanded(index)` | Toggles accordion open/close state |
| `toggleVisibility(index)` | Flips `visibility` between `'public'` and `'internal'` |

## Usage Example

```typescript
import { ChangelogManager } from './changelog-manager';
import type { ChangelogEntry } from '../../types/product-release';

const [entries, setEntries] = useState<ChangelogEntry[]>([]);

// Basic product release changelog
<ChangelogManager
  title="What's New"
  entries={entries}
  onChange={setEntries}
/>

// Investor update with visibility control + auto-expand after AI fill
<ChangelogManager
  title="Highlights"
  entries={entries}
  onChange={setEntries}
  showVisibilityToggle
  expandAll={aiEnrichmentComplete}
/>
```

> **Note:** `showVisibilityToggle` is intended for investor update flows. Leave it unset for standard product release changelogs to preserve their default UX. New entries default to `visibility: 'public'` when the toggle is enabled.