Skip to content

Sidebar file preview reveals the most recent Chat #969

Description

@jeonghun-jj-lee

Important

Problem — A Sidebar single-click can open Preview inside a hidden Amicode Chat while a native VS Code editor remains active. A fresh Landing draft drops the same request because it has no Preview surface.
Approach — Reveal the most recently active live Chat in place before forwarding the existing Preview request. Give Landing drafts a local Preview pane that reuses the established file-preview workspace without promoting or selecting a session.
Scope — in: recent-Chat activation, draft-local Preview, extension-to-fork regression coverage, and overlay synchronization. Out: session promotion, a new file lifecycle, broadcasting to every Chat, and changing double-click behavior.
Assumptions — A file single-click is a Preview intent; a missing Chat retains the existing native-editor fallback.

Acceptance Criteria

  • A Sidebar single-click from a native editor reveals the most recently active Chat and displays the selected file in Preview.
  • Multiple open Chats route the file only to the most recently active Chat.
  • A Landing draft displays Preview without creating, promoting, or selecting a real session.
  • Closing draft Preview hides it; a later Sidebar file selection reopens it.
  • With no live Chat, Sidebar single-click retains the native-editor fallback.
  • Double-click remains a pinned native editor action.

Testing Decisions

Extend extension-host tests for recent-Chat selection, in-place reveal, message delivery, and the no-Chat fallback. Add browser coverage for Preview in a Landing draft, repeated file selection, close/reopen, and unchanged draft routing. Retain the existing Preview interaction contracts.

Key Decisions

The Sidebar activates an existing Chat tab but never changes its internal session. The extension retains primary-Chat behavior for unrelated callers and adds a distinct recent-Chat lookup for this file-preview flow. Landing Preview is a focused local surface, not the session side-panel subsystem.

Constraints & Invariants

  • Existing Preview renderers, file handling, and capacity behavior remain authoritative.
  • No Preview request creates a session or changes a draft URL.
  • The Chat remains in its existing VS Code editor group when revealed.
  • The extension does not use a broadcast delivery path.

Prior Art

Source

Extends #934 and is implemented alongside harmoniqs/opencode#319.

Activity

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions