Skip to content

Preserve native search destinations and CSV editor lifecycle - #110

Closed
jonaraphael wants to merge 4 commits into
codex/fix-edit-integrityfrom
codex/fix-editor-navigation
Closed

jonaraphael wants to merge 4 commits into
codex/fix-edit-integrityfrom
codex/fix-editor-navigation

Conversation

@jonaraphael

@jonaraphael jonaraphael commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

When CSV is Off, VS Code can still choose the contributed CSV editor before delivering a Find in Files destination. The custom-editor callback carries no requested range, so reopening text afterward loses the destination and can create a second representation.

The existing Toggle Extension command installs reversible native-editor associations while Off and restores prior choices when On. It honors workspace/global enabled scope, preserves other editors and unrelated associations, and relinquishes user-edited keys. Immutable recovery journals and one transaction queue order startup, configuration changes and toggles across delayed windows. Denied or conflicting changes produce an error and roll back the toggle.

The same manager now offers file-scoped Text ownership for dependent #120. That ownership survives restart and Off/On independently of temporary disabled-state routing. A successful Table replacement releases only the owned file binding; failed switches restore only their still-owned changes. Literal path glob characters are escaped, and external edits/deletions cannot resurrect an old ownership journal. This PR provides the manager API; #120 wires the existing switch action to it.

Enabling uses VS Code's native resolver and preserves native/external editor choices and dirty source owners. Lifecycle fixes observe disposal before remote file checks, reuse an existing native destination in the same group, hand off once, and retain the extension URI scheme/authority for webview resources. No new contributed setting or UI control.

Stacked on #109. Refs #90, #104 and #127. The Off workflow is fixed here; enabled files explicitly switched to Text are handled by #120. Search into a file still in Table mode remains outside the stable custom-editor API's navigation contract. This does not claim every #104/#127 workflow is resolved.

Validation:

  • Node 20.20.0: compile and 174/174 tests pass; lint 0 errors, 87 existing warnings; diff checks pass.
  • Manager tests cover scopes, old journals, restart, Off/On, literal/unsupported URIs, denied writes, external edits/deletion, per-file rollback, exact absent/empty restoration, and concurrent ownership.
  • Independent review ran 13 additional ownership/concurrency probes successfully.
  • Normal installed VS Code 1.142 host, combined 1.4.1: native SearchView first/second/repeated FIND_ME_104 results retain exact selection in one text tab after Text choice; Off/On and normal window restart preserve it. Same-basename other files remain tables; returning to Table releases the owned binding.
  • Native SearchView uses Find in Files / Focus Next Search Result / Open Match commands; this is not a GUI mouse-click claim. Disposable profiles only; no real user settings were modified.
  • WSL/remote lifecycle is simulated; interactive Windows replication was not performed, as requested.

Boundaries: external editor associations are preserved. Unsafe partial broad associations fail with guidance. File association matching is case-insensitive and cannot isolate URI authorities; dependent #120 reports these limitations rather than widening the preference.

Known view limitation outside this search repair: during multi-file Off/On, an inactive saved CSV handoff/upgrade can activate that file instead of restoring the current untitled table. A normal installed-host probe preserved the untitled source and all edits; this is recorded for review and is not a claim that every multi-file focus sequence is fixed.

@jonaraphael
jonaraphael force-pushed the codex/fix-editor-navigation branch from ad254c5 to 0c3ec94 Compare October 17, 2026 04:12
@jonaraphael
jonaraphael changed the base branch from main to codex/fix-edit-integrity October 17, 2026 04:12
@jonaraphael jonaraphael changed the title Preserve CSV editor lifecycle and native text navigation handoffs Preserve native search destinations and CSV editor lifecycle Oct 17, 2026
@jonaraphael
jonaraphael deleted the codex/fix-editor-navigation branch October 17, 2026 21:13
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.

1 participant