Skip to content

Add find and replace support in Search Panel#658

Merged
chrisgregan merged 16 commits into
mainfrom
find-replace
Mar 11, 2026
Merged

Add find and replace support in Search Panel#658
chrisgregan merged 16 commits into
mainfrom
find-replace

Conversation

@chrisgregan
Copy link
Copy Markdown
Contributor

This pull request introduces new text editing and replacement functionality, including batch text edits, and adds comprehensive unit tests for these features. It also updates localization strings to support the new replace operations and improves search panel status messages. Additionally, it includes documentation and naming improvements for clarity and consistency.

Fixes #657

Text editing and replacement functionality:

  • Added TextEdit and DocumentEdit record types and the IApplyEditsCommand interface to support batch text edits for documents, including insert, delete, and replace operations. (app/Core/Celbridge.Foundation/Documents/IApplyEditsCommand.cs)
  • Added ApplyEditsAsync method to the IDocumentView interface to apply a batch of text edits as a single undo unit. (app/Core/Celbridge.Foundation/Documents/IDocumentView.cs)
  • Added GetDocumentView method to the IDocumentsPanel interface to retrieve an open document view by resource. (app/Core/Celbridge.Foundation/Documents/IDocumentsPanel.cs)

Unit tests for text editing and replacement:

  • Added TextEditTests covering insert, delete, replace, and document edit scenarios. (app/Celbridge.Tests/Documents/TextEditTests.cs)
  • Added TextReplacerTests providing thorough coverage of text replacement operations, including edge cases and line ending preservation. (app/Celbridge.Tests/Search/TextReplacerTests.cs)

Localization and UI improvements:

  • Added and updated localization strings for replace operations and search panel status messages, including new tooltips, placeholders, and confirmation dialogs. (app/Celbridge/Resources/Strings/en-US/Resources.resw) [1] [2] [3]

Test and documentation improvements:

  • Improved and renamed unit tests for document saving to clarify their purpose and remove unnecessary messaging assertions. (app/Celbridge.Tests/Markdown/MarkdownDocumentViewModelTests.cs)
  • Updated documentation to clarify when DocumentSaveCompletedMessage is sent and improved code style guidelines for class structure. (app/Core/Celbridge.Foundation/Documents/DocumentMessages.cs, app/.github/copilot-instructions.md) [1] [2]

Configuration and naming consistency:

  • Updated feature flag naming in development settings for consistency. (app/Celbridge/appsettings.development.json)

@chrisgregan chrisgregan merged commit 717e9df into main Mar 11, 2026
5 checks passed
@chrisgregan chrisgregan deleted the find-replace branch March 11, 2026 17:23
chrisgregan added a commit that referenced this pull request Mar 19, 2026
* Initial implementation of replace all in file

* Replace single match item

* Center align buttons

* Rename to ReplaceMode

* Fix string concatenation

* Improve text replace UX

* Update navigate to result for multiline

* Implement find-replace

* Collapse large search results to improve responsiveness

* Make file header selectable

* Persist search and replace history in workspace settings

* Added tests for TextReplacer service

* Misc tidy ups

* Refactor SearchPanelViewModel
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.

Add find and replace support to Search Panel

1 participant