Skip to content

Tags: boldsoftware/shelley

Tags

v0.427.912206636

Toggle v0.427.912206636's commit message
Release v0.427.912206636 (290d9e)

headless-shell/v147.0.7727.117

Toggle headless-shell/v147.0.7727.117's commit message
shelley: fix diff viewer backspace/arrow keys deleting multiple chars

Prompt: sometimes, when I use shelley, and i'm trying to edit code in
the monaco diff view, clicking backspace removes multiple characters.
arrow keys go multiple steps. Something's borked. See if you can repro
and fix.

In the diff viewer, after switching files or diffs a few times, pressing
Backspace would delete several characters at once and arrow keys would
jump multiple columns per press. Each keystroke fired as many cursor
commands as the number of diff editors ever created in the session.

Root cause: monaco-editor 0.44 keeps references to every diff editor
ever created via monaco.editor.getDiffEditors(); disposing an editor
releases its DOM and its code editors but leaves global keybinding
contributions (and the reference) behind. Every one of those stale
keybinding contributions routes keystrokes to the currently focused
editor, so N stale editors = N cursor commands per keypress.

DiffViewer was recreating the entire monaco.editor.createDiffEditor on
every file, commit-messages update, cwd change, and isMobile flip.
Recreate is the leak source.

Fix: create the diff editor once (keyed only on monacoLoaded) and swap
models when the selected file or diff changes. Dispose the previous
models after swapping so they don't accumulate. Apply mobile-dependent
layout options via updateOptions on resize instead of rebuilding the
editor. Move the event handlers that depended on per-file or per-
viewport state (isHeadCommit, cwd, isMobile) behind refs so a single
set of listeners can live for the editor's lifetime.

Co-authored-by: Shelley <[email protected]>

v0.426.951554135

Toggle v0.426.951554135's commit message
Release v0.426.951554135 (a6d85d)

v0.425.973756433

Toggle v0.425.973756433's commit message
Release v0.425.973756433 (efdd1b)

v0.424.930023736

Toggle v0.424.930023736's commit message
Release v0.424.930023736 (6027de)

v0.423.943344423

Toggle v0.423.943344423's commit message
Release v0.423.943344423 (8dc913)

v0.422.931263174

Toggle v0.422.931263174's commit message
Release v0.422.931263174 (65667c)

v0.421.927404403

Toggle v0.421.927404403's commit message
Release v0.421.927404403 (5e0903)

v0.420.921175161

Toggle v0.420.921175161's commit message
Release v0.420.921175161 (44fa71)

v0.419.924473021

Toggle v0.419.924473021's commit message
Release v0.419.924473021 (527611)