Unify IDE preview and inspector on one extension-managed dft serve
Problem
Design and implement a single extension-managed dft serve runtime for both preview and inspector so the IDE stops mixing direct dft render calls with a separate inspect server lifecycle. Cover variable state, unsaved editor refresh semantics, route design, server discovery/reuse, and migration of preview/open-in-browser/inspector flows onto the shared server.
Context
- The extension currently mixes direct render calls with a separate inspect-server lifecycle, which creates duplicated runtime management and stale-state risk inside the IDE.
- A single extension-managed
dft serveruntime could simplify preview and inspector coordination, but only if it handles unsaved edits, variable state, and extension-host lifecycle cleanly. - This task should define the runtime contract before implementation so preview and inspector stop behaving like loosely related subsystems.
Possible Solutions
- A - Keep preview and inspector on separate runtime paths and patch the rough edges: lower immediate change cost, but it preserves the architectural split.
- B - Recommended: converge both surfaces on one extension-managed
dft serveruntime: unify state management, reduce duplicate process handling, and make the IDE contract easier to reason about. - C - Push all runtime responsibility onto external user-managed commands: simpler for the extension, but much worse for the intended analyst workflow.
Plan
- Document the current preview and inspector runtime paths, including state management, process lifecycle, and failure modes.
- Design the single
dft servecontract the extension should own, including unsaved edits, variable state, restart behavior, and how webviews consume the runtime. - Implement the convergence in the extension-managed surfaces with focused safeguards for stale state and extension-host lifecycle changes.
- Add integration-style extension tests and runbook notes that prove preview and inspector now share one reliable runtime model.
Implementation Progress
QA Exploration
- [ ] QA exploration completed (or N/A for non-UI tasks)
Review Feedback
- [ ] Review cleared