Repository navigation
fix: replace only the selected config field in find and replace - #640
Merged
Merged
Conversation
Replacing a single config match reduced it to its node and then ran the replacement over every string in that node's config. Picking only workingDirectory therefore also changed the script and any other field containing the search text. Matches now carry their config path as segments, and the replacement touches exactly the strings at the selected paths. A label match no longer changes config either. Replace All covers the same strings as before, because it passes every match. Fixes #597 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #597
Replacing one config match reduced it to its node id and then replaced the search text in every string of that node's config. Selecting only
workingDirectoryalso rewrote the script.configPath), and the replacement only touches the strings at the selected paths. Segments instead of the dotted display path, because a config key can contain a dot (header names).Tests run locally (vitest):
src/__tests__/lib/findReplace.test.ts: new cases for single-field replacement, label-only replacement and a dotted key. Two of them fail on main.src/__tests__/components/overlays/FindReplaceOverlay.test.tsx: new UI test that selects theworkingDirectoryresult and replaces it🤖 Generated with Claude Code