Switching programming languages causes undo to restore text in the wrong language
メンテナーはふだん 1 日以内に返信
評価
この issue はまだ評価されていません。
説明
Observed behavior
Undo after switching languages can restore text deleted in another language. In manual testing, undo in JavaScript restored BBB deleted from Python, and undo in Python restored 222 deleted from JavaScript.
The original report described this as cleared undo history. Further testing shows that this description is incomplete: some simple cases restore the deleted text, while interleaved edits across languages can produce incorrect results.
Expected behavior
Each programming language should retain its own undo/redo history. Undo and redo should affect only the current language's edits. Switching languages should not be an undoable edit.
Reproduction
Keep the starter code in both languages. Append the following text below it rather than replacing the starter code.
- In Python, append two lines:
AAAandBBB. - Switch to JavaScript and append two lines:
111and222. - Select only the text
222and delete it, leaving the newline. - Switch to Python, select only
BBB, and delete it, leaving the newline. - Switch back to JavaScript and press
Ctrl+Z. Expected: restore222. Observed manually:BBBappears instead. - Switch back to Python and press
Ctrl+Z. Expected: restoreBBB. Observed manually:222appears instead.
These cross-language results are from manual testing; this sequence has not yet been verified by an automated regression test.
Original reproduction
- Enter several lines in Python.
- Delete a line and press
Ctrl+Zto confirm that undo works. - Delete the line again.
- Switch to another language and back to Python.
- Press
Ctrl+Zto restore the deleted line.
A simplified automated version of this sequence passes on commit 3198a99ed99be8930371d9fe7480b1e565c56488 with Chrome 156.0.8078.47. Passing this case does not establish that histories are isolated between languages.
Proposed approach
Use a bounded in-page undo/redo history for each language. Switching languages selects the corresponding buffer and history without recording an edit.
Record typed input, paste, cut, drop, each IME composition as one entry, and programmatic edits through applyEditorEdit, including Tab, Shift+Tab, Ctrl+/, and the starter-code restore in #398. Undo and redo restore selection bounds and direction, preserving the behavior from #390, and update the saved code, editor display, and existing synchronization.
Route Ctrl+Z, Ctrl+Shift+Z, Ctrl+Y, their applicable macOS equivalents, and browser historyUndo/historyRedo actions through this history.
Retain the original five-step regression test and add the cross-language reproduction above, including redo checks. Cover each edit path with undo and redo tests.
Original report version and environment
CodeTrial: 0.1.0 (5b4d8c7)
OS: Windows 11 Home Single Language, Version 25H2 (Build 26200.9711)
Browser: Google Chrome 155.0.8059.80 (64-bit)
Interview loop: Coding interview
Problem: Sensor Calibration Index (LeetCode 108)
REACTO or STAR step: Code
Reconnect: None
Follow-up testing
Local checkout: 3198a99ed99be8930371d9fe7480b1e565c56488
Automated test browser: Google Chrome 156.0.8078.47
Cross-language reproduction: manually observed with Python and JavaScript.
Public data confirmation
- I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
- 主要言語
- Rust
- スター
- 177
- フォーク
- 100
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 182
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/codetrial のほかの issue
-
Selecting a pen color leaves Example drawing in eraser mode対応中かも @Aa99841 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
sysprog21/codetrial#437 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Python tests lose every result when the solution returns inf or NaN対応中かも @shensyuan が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
sysprog21/codetrial#419 · コメント 3 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Allow deselecting a chosen problem card by clicking it again対応中かも @woohsin が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
sysprog21/codetrial#392 · コメント 4 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Audio output can be confirmed without playing a test sound対応中かも @ChenYingHan1121 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
sysprog21/codetrial#359 · コメント 5 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Add a Copy code button to the final report対応中かも @yansawu が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
sysprog21/codetrial#318 · コメント 6 件 · リアクション 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
sysprog21/codetrial の issue をすべて見る
似ている issue
-
checkpoint/verify/rebuild_indexes on a thread holding a WriteTransaction deadlock instead of INT-001オープンbug known-issue
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
project-minigraf/minigraf#734 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
bug CLI documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
openai/codex#56630 · コメント 3 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
DayuanJiang/PecoFence#139 ·
メンテナーはふだん 1 日以内に返信