Skip to content

fix: replace only the selected config field in find and replace - #640

Merged
Sev7eNup merged 1 commit into
mainfrom
fix/replace-only-selected-field
Oct 24, 2026
Merged

Sev7eNup merged 1 commit into
mainfrom
fix/replace-only-selected-field

Conversation

@Sev7eNup

Copy link
Copy Markdown
Owner

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 workingDirectory also rewrote the script.

  • Matches now carry their config path as segments (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).
  • A node-label match no longer changes config.
  • Replace All passes every match, so it changes the same strings as before. The 50-result cap (Replace All leaves matching values unchanged after the first 50 results #598) is not part of this change.

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 the workingDirectory result and replaces it
  • all overlay tests: 145 passed; tsc and eslint clean

🤖 Generated with Claude Code

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>
@Sev7eNup
Sev7eNup merged commit e2ca49f into main Oct 24, 2026
17 checks passed
@Sev7eNup
Sev7eNup deleted the fix/replace-only-selected-field branch October 24, 2026 19:22
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.

Replacing a selected search result also changes unselected configuration fields

1 participant