Skip to content

view: the code pane can replace text the user typed #2066

Closed

Description

@shunichironomura

Warning

This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.

Found in the review of #2057, which adds the experimental view. It does not block that PR; #2059 fixed the findings that did. Paths refer to #2059's head.

Problem

Text typed in the code pane can be replaced by the host's copy of the file.

adoptModels calls syncEditor in web/view/src/main.ts, which calls editor.show(file, hostText) in web/view/src/editor.ts. show cancels the pending debounce and replaces the document with the host's text. This loses typing in these cases:

  • In compare mode, text typed before the base ref has arrived from GitHub.
  • Text the host rejected because it did not compile yet, when a later model update (a cell edit, for example) replaces it.
  • A pending change when the user switches files within the 350 ms debounce.

Proposed fix

  • Record the text last sent to and received from the host, and do not replace the document while it differs from that text.
  • Flush the pending change before switching files.

Activity

  1. added
    bugSomething isn't working
    webviewThe experimental view (web/view, graphcal view, graphcal/viewModel)
    on Oct 14, 2026
  2. added a commit that references this issue on Oct 17, 2026
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

    bugSomething isn't workingwebviewThe experimental view (web/view, graphcal view, graphcal/viewModel)

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions