diff --git a/CHANGELOG.md b/CHANGELOG.md index e3cf276ab19d..7abedd99e9dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,15 @@ Code v99.99.999 ## Unreleased +### Added + +- On-demand on-screen keyboard for the Monaco editor on touch devices. The + editor starts in a read mode where taps scroll and position the caret + without summoning the OS keyboard; a double-tap inside the editor opts + into typing mode, and a tap outside the editor (or the OS reporting the + keyboard dismissed) exits back to read mode. Makes code-server practical + to use as an actual editor on a phone instead of just as a viewer. + ## [4.146.0](https://github.com/coder/code-server/releases/tag/v4.146.0) - 2026-11-20 Code v1.146.0 diff --git a/patches/mobile-on-demand-keyboard.diff b/patches/mobile-on-demand-keyboard.diff new file mode 100644 index 000000000000..35cd00092e16 --- /dev/null +++ b/patches/mobile-on-demand-keyboard.diff @@ -0,0 +1,336 @@ +Add on-demand on-screen keyboard for the Monaco editor on touch devices + +Adds a small zero-dep module (mobileOnDemandKeyboard.ts) that suppresses +the OS virtual keyboard from popping up on a tap into the Monaco editor +and instead enters a read-only "view mode" by default on touch devices. +The user explicitly opts into typing mode with a double-tap inside the +editor; tapping outside the editor, or the browser/OS reporting the +on-screen keyboard dismissed, exits typing mode back to view mode. + +Suppression is enforced with three cooperating layers against Monaco's +focus path (both the legacy `textarea.inputarea` and the modern +`div.native-edit-context`): a `.focus()` method override on the input +prototypes, a capture-phase `focusin` blur guard, and `inputmode="none"` +stamping via synchronous setter hooks on `Element.prototype` plus a +MutationObserver safety net. The module is imported and invoked once +from the existing workbench.ts bundle entry, so no new