Skip to content

Add Preview auto-refresh and CSV column/row editing to the web IDE

Mike Boyer requested to merge experimental-dynamic-previews into main

Preview now auto-refreshes from disk on an adjustable interval (Settings -> "Preview auto-refresh (s)", 0 disables it) while open, skipping entirely whenever the active tab is dirty so a background refresh can never clobber an in-progress edit. CSV Preview also gains "+ add column"/"+ add row" and per-header/per-row "x" buttons, backed by new optional edit_columns()/edit_rows() plugin hooks that round-trip through Python's real csv module rather than a naive text edit.

Three real bugs surfaced across actual multi-pane browser sessions, none reachable from the HTTP/Node test suite alone (see NOTES/dynamic-previews.md for each root cause):

  • A synchronous-dialog/timer race where prompt()/confirm() blocking the JS thread let the auto-refresh poll's already-due timer fire and silently overwrite a just-applied edit before Save ever saw it.
  • Save writing the wrong pane's content in a two-pane layout, since opening/using Preview never used to count as "focusing" that pane.
  • The same file open in a second pane going silently stale after a save elsewhere, now synced via the same reloadTabFromDisk() Replace All already uses, skipping any pane with its own unsaved edit there.

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

Merge request reports