--- epic: 10 story: 10.6 title: "Find & Replace" status: draft --- ## Epic 10 — Notepad UX (Cross-Platform Spec) **Goal:** Consistent editor behavior specified once, implemented per platform. ### Story 10.6: Find & Replace As a user, I want to find and replace text in my sheet, So that I can quickly locate expressions and make bulk edits. **Acceptance Criteria:** **Given** a user is in the editor **When** they press `Ctrl+F` (or `Cmd+F` on macOS) **Then** a find bar appears at the top or bottom of the editor **And** focus moves to the search input field **Given** the find bar is open and the user types a search term **When** matches exist in the sheet **Then** all matching occurrences are highlighted in the editor **And** the current match is distinctly highlighted (e.g., different color) **And** a match count indicator shows "N of M" matches **Given** the user presses `Ctrl+H` (or `Cmd+H` on macOS) **When** the replace bar appears **Then** it includes both a search field and a replacement field **And** "Replace" and "Replace All" buttons are available **Given** a user clicks "Replace All" **When** matches exist **Then** all occurrences are replaced simultaneously **And** the operation is recorded as a single undoable action (Ctrl+Z reverts all replacements) **Given** a user enables the regex toggle in the find bar **When** they type a regular expression pattern **Then** the search uses regex matching **And** invalid regex shows an error indicator without crashing