Skip to content

Add tabbed Find/Replace dialog in ted and implement Editor find/replace API#26

Merged
tig merged 6 commits into
developfrom
copilot/implement-find-replace-feature
May 9, 2026
Merged

Add tabbed Find/Replace dialog in ted and implement Editor find/replace API#26
tig merged 6 commits into
developfrom
copilot/implement-find-replace-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 9, 2026

This PR adds the initial Find/Replace UX in ted (as requested in the Edit menu) and introduces the corresponding Editor API surface to perform find navigation and replacements.

  • Ted UX: Edit menu + shared dialog

    • Added _Find... and _Replace... as the first items in the Edit menu.
    • Both actions open the same FindReplaceDialog with Tabs:
      • Find tab: find-next
      • Replace tab: find-next, replace, replace-all
    • _Find... opens on the Find tab; _Replace... opens on the Replace tab.
  • Editor API: find/replace operations

    • Added Editor.FindNext, Editor.FindPrevious, Editor.ReplaceNext, and Editor.ReplaceAll.
    • Search uses ordinal/ordinal-ignore-case matching with optional wrap behavior.
    • Match navigation updates selection/caret to the found range; replace APIs operate on current/next match.
    • Added guardrails around selection/document bounds in matching and dialog prefill paths.
  • Coverage updates

    • Added unit coverage for next/previous find and replace-next/replace-all behavior.
    • Added integration coverage asserting Edit menu exposure of Find... and Replace....
// Editor API now available to ted dialog and other callers:
editor.FindNext("needle", matchCase: false, wrapAround: true);
editor.ReplaceNext("needle", "replacement", matchCase: false, wrapAround: true);
int count = editor.ReplaceAll("needle", "replacement", matchCase: true);

Copilot AI assigned Copilot and tig May 9, 2026
Copilot AI linked an issue May 9, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add find and replace functionality to editor Add tabbed Find/Replace dialog in ted and implement Editor find/replace API May 9, 2026
Copilot AI requested a review from tig May 9, 2026 12:47
Copilot finished work on behalf of tig May 9, 2026 12:47
@tig tig marked this pull request as ready for review May 9, 2026 13:31
@tig tig merged commit 923703d into develop May 9, 2026
0 of 6 checks passed
@tig tig deleted the copilot/implement-find-replace-feature branch May 9, 2026 15:10
tig added a commit that referenced this pull request May 9, 2026
…my spec

Editor.FindReplace.cs:
  ReplaceAll now wraps its loop in TextDocument.RunUpdate () so every match
  it rewrites is grouped into one undo entry. Without this, replacing N
  occurrences took N Ctrl+Z presses to undo — a real R5 violation that
  shipped with PR #26. New tests in EditorFindReplaceTests cover:
    * ReplaceAll counts and rewrites every match
    * One undo step restores the original text
    * Zero matches → no-op, no document mutation
    * Null replacement throws
    * FindNext caret-relative selection + wraparound

specs/10-autonomous-three-agent.md:
  Mini-spec for running Claude Code, Codex, and GitHub Copilot Coding Agent
  concurrently on a Mac mini, each independently executing toward MLP per
  specs/00-plan.md. Covers topology (per-agent clones, not worktrees),
  collision avoidance (branch prefixes, mirrored issue triplets, branch
  protection on develop), per-agent run modes, observability capture,
  comparison rubric, operator runbook.
tig added a commit that referenced this pull request May 9, 2026
examples/ted/FindReplaceDialog.cs:
  Add a "Find Previous" button to the Find tab that calls
  Editor.FindPrevious. Closes the gap that PR #26 introduced (FindPrevious
  shipped public with no caller).

specs/00-plan.md:
  Add R9 to the architectural rules: no unused public/internal APIs in
  src/. Every public/internal member must have a non-test caller in src/
  or examples/. Reviewers enforce this; Roslyn IDE0051 only catches
  private-scope cases. Cite the FindPrevious gap as the seed example.

CLAUDE.md:
  Add a one-line cross-reference under "Coding standards" pointing at R9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Find/Replace

2 participants