Skip to content

Adopt quadraui's shared preview-tab tier; delete vimcode's private copy #658

Description

@JDonaghy

What

Replace vimcode's private preview/pin implementation with quadraui's shared
WorkspaceController preview tier (quadraui #597), and delete the local copy.

Why now

quadraui #597 ports vimcode's own preview policy into the framework so coord-tui can use the
same behaviour. Until this issue lands there are two implementations of the same rules — the
original here and the port there — and they drift on the first change.

That defeats the reason the port happened. The stated goal is that vimcode and coord-tui behave the
same, and that a future move toward VS Code's narrower promotion rules is one change both apps
inherit. That is only true once vimcode consumes the shared tier rather than paralleling it.

Behaviour must not change in this issue. All six promotion triggers stay exactly as they are today,
including promote-on-select (goto_tab), which is vimcode's deliberate divergence from VS Code
and is now the agreed cross-app contract.

Design

  • Take the quadraui pin to a rev containing #480: TUI: Migrate Source Control panel (commit row, branch picker, help dialog) to shared primitives #597 (its own reviewable commit).
  • Replace Engine::preview_buffer_id + promote_preview() + the find-else-replace branch in
    open_file_preview with calls into the shared tier.
  • Map vimcode's BufferId to the controller's opaque document id.
  • Keep every existing preview test green, unchanged. If a test needs editing to compile, that is a
    signal the port changed behaviour — stop and reconcile rather than adjusting the assertion.

Acceptance criteria

  • preview_buffer_id and the local promote_preview no longer exist in src/core/.
  • All five existing preview tests pass untouched in their assertions:
    test_open_file_preview_creates_preview_tab, test_double_click_promotes_preview,
    test_open_file_preview_double_click_promotes, test_edit_promotes_preview,
    test_save_promotes_preview, plus test_behavior_goto_tab_promotes_preview.
  • Single-click in the file explorer still replaces the preview tab rather than adding one.
  • Selecting a preview tab still promotes it.
  • cargo build && cargo test EXIT=0.

Files

  • src/core/engine/buffers.rs
  • src/core/engine/windows.rs
  • src/core/buffer_manager.rs
  • Cargo.toml (quadraui pin bump, separate commit)

Depends on

quadraui #597 (preview tier), which depends on quadraui #596 (WorkspaceController).

Out of scope

  • Any behaviour change. This is a de-duplication, not a redesign.
  • The other three quadraui-duplication cleanups, filed separately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked on a prereq (linked in body)coordTracked by coord-tui pipelineenhancementNew feature or requeststatus:readyRefined and ready to enter the work pipeline

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions