Web UI: ConfigEditorModal — preserve CodeMirror undo history and cursor across New/Revert/Save As

オープン
#147 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python, typescript
領域
desktop, frontend

調査の方向性

Start with ConfigEditorModal.tsx:414-459 and trace the view effect's [open, load] dependencies, then read the New, Revert, and Save As flows at lines 738-761. Check how CodeMirror dispatches document changes and how loadedTextRef and baselineHashRef are updated. Done means those actions update the document without losing undo history, cursor, or scroll position.

索引モデルが issue の本文から書いたものです。

説明

code-quality frontend

Problem

The view effect depends on [open, load] (ConfigEditorModal.tsx:414-459), so any setLoad destroys and recreates the CodeMirror view: after New, Revert, and after Save As (markSaved, lines 738-761, whose anchorChanged branch deliberately bumps load). The comments already acknowledge the hazard ("the remount would rebuild the view…"), and plain Save works around it — but the Save-As/New/Revert remounts reset undo history, cursor and scroll position.

Suggested fix

Create the view once per open session and swap content via dispatch({ changes: { insert: text, from: 0, to: doc.length } }) (which also keeps a sensible undo entry), updating loadedTextRef/baselineHashRef as today.

主要言語
Python
スター
1
フォーク
1
平均マージ
4時間 46分
マージ済み PR(30日)
55

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

falbany/ProFiles のほかの issue

falbany/ProFiles の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。