Skip to content

Support unsaved CSV and TSV documents with native ownership - #122

Closed
jonaraphael wants to merge 14 commits into
codex/switch-table-textfrom
codex/edit-untitled-csv
Closed

jonaraphael wants to merge 14 commits into
codex/switch-table-textfrom
codex/edit-untitled-csv

Conversation

@jonaraphael

@jonaraphael jonaraphael commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Untitled CSV/TSV documents now open as editable tables against their existing native text buffer, including text entered before changing language mode. Switching from the temporary table to text commits the active cell, reveals that same document, and closes the table. Switching back creates a new table against the unchanged owner. The toolbar action is available in both supported untitled text views and their tables.

The native text tab remains open while an untitled table is displayed because it owns the unsaved buffer. Native replacement is unsafe for associated-path untitled documents: VS Code can route their URI to a nonexistent saved file. Saved-file replacement is provided by parent #120. Neither switch saves or discards document contents.

A single sequenced draft-commit protocol serves switching, Save As, language changes, disable/re-enable and owner rebinding. Delayed edits finish before the owning document changes; failed drafts remain available for retry or Escape discard. Fresh acknowledgments preserve newer edits started during recovery. Split-editor routing selects the visible owner in the invoking group instead of relying on the globally active text editor.

The table adds CSV: Save Untitled Document As… and Ctrl/Cmd+S support. These commit the active cell, reveal the native owner and use VS Code's normal Save As command. Native File > Save cannot target a standalone table panel, so it must be used from the source. README and manifest describe these behaviors. No new settings.

Validation:

  • Node 20.20.0: compile and 284/284 tests pass; lint has zero errors and 87 existing warnings; diff checks pass. Independent merge review verifies preservation of the child acknowledgment and owner-rebinding protocol.
  • Parent Switch CSV table and text in one editor tab #120 and its Preserve native search destinations and CSV editor lifecycle #110 routing manager are integrated as real Git parents. Saved-file switching inherits persistent Text choice, precise routing restoration and native tab-event completion. The untitled module remains unchanged; temporary tables continue to use their native source owner.
  • Tests cover real provider/webview delayed multiline drafts, failed edits and recovery, stale/fresh acknowledgments, pending Save As/close priority, disposal, split groups, host lifecycle and reversible editor preferences. Off handoff uses this branch's single fresh-acknowledgment protocol for both saved and untitled documents.
  • Exact parent Switch CSV table and text in one editor tab #120 head passes native VS Code 1.142 saved CSV/TSV/TAB/PSV dirty-buffer round trips, unchanged disk bytes, one representation, counterpart reuse, unrelated groups and controlled cancellation.
  • Combined 1.4.1 passes 681 tests and native SearchView checks through enabled Text choice, Off/On and a normal installed-host window restart. Files with the same basename elsewhere retain automatic tables; successful Table return restores the owned binding.
  • Exact PR head 5abb7ad1cb71f0a4810b30b77741e5d06ea91cc0, normal installed VS Code 1.142 host: isolated CSV/TSV ownership, language round trips, table/text switching, disable/re-enable, actual native Save As and controlled cancellation pass. CSV/TSV Save As completed in 84/63 ms with exact quoted multiline disk bytes; old untitled owners and temporary controllers closed. Cancellation called the native save no-op once and retained the dirty source and reusable table. Cases close only the previous fixture’s known clean saved tabs after their assertions. This isolation avoids, rather than fixes, the separately documented multi-file focus race. The diagnostic polling deadline was 30 seconds; measured saves finished within the original five-second window.

Boundaries: native File > Save must be used from the untitled source, as explained above. A file still in Table mode cannot receive a native search range through the stable custom-editor callback. Unsupported URI authorities and conflicting editor associations retain explicit guidance. A normal installed-host multi-file sequence reproduced a focus limitation: after saving one CSV and opening an untitled TSV, Off/On can activate the earlier CSV instead of restoring the untitled table. The TSV owner stays live, dirty and unchanged; no file is saved or discarded. This source-preserving focus race is documented for review, alongside the existing late native-handoff limitation. Workbench internal selection/OverlayWebview messages can appear during replacement while native assertions pass.
Depends on #120. Closes #85. Closes #94.

@jonaraphael
jonaraphael marked this pull request as ready for review October 17, 2026 04:58
@jonaraphael
jonaraphael marked this pull request as draft October 17, 2026 05:46
@jonaraphael
jonaraphael marked this pull request as ready for review October 17, 2026 06:33
@jonaraphael
jonaraphael deleted the codex/edit-untitled-csv 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